From c3c28109d40c9d72eb332b7b34fb5e0495b702db Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 3 Mar 2026 21:18:08 +0000 Subject: [PATCH 1/2] feat: Add a new field to support Dataplex integration configuration PiperOrigin-RevId: 878006289 Source-Link: https://github.com/googleapis/googleapis/commit/938377b80d3444b91cd329164b0c10507f07f9e8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ffc697ffda76e53f7dd2549f68e5f7cc67e05a8f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6ImZmYzY5N2ZmZGE3NmU1M2Y3ZGQyNTQ5ZjY4ZTVmN2NjNjdlMDVhOGYifQ== --- .../google-cloud-alloydb/.eslintignore | 7 + .../google-cloud-alloydb/.eslintrc.json | 3 + .../google-cloud-alloydb/.gitattributes | 4 + .../google-cloud-alloydb/.gitignore | 14 + .../google-cloud-alloydb/.jsdoc.js | 55 + .../google-cloud-alloydb/.mocharc.js | 33 + owl-bot-staging/google-cloud-alloydb/.nycrc | 24 + .../google-cloud-alloydb/.prettierignore | 6 + .../google-cloud-alloydb/.prettierrc.js | 22 + .../google-cloud-alloydb/CODE_OF_CONDUCT.md | 94 + .../google-cloud-alloydb/CONTRIBUTING.md | 76 + owl-bot-staging/google-cloud-alloydb/LICENSE | 202 + .../google-cloud-alloydb/README.md | 232 + .../cloud/alloydb/v1/csql_resources.proto | 40 + .../cloud/alloydb/v1/csql_service.proto | 79 + .../google/cloud/alloydb/v1/data_model.proto | 62 + .../google/cloud/alloydb/v1/resources.proto | 1718 + .../google/cloud/alloydb/v1/service.proto | 2234 + .../alloydb/v1alpha/csql_resources.proto | 40 + .../cloud/alloydb/v1alpha/csql_service.proto | 79 + .../cloud/alloydb/v1alpha/data_model.proto | 62 + .../google/cloud/alloydb/v1alpha/gemini.proto | 60 + .../cloud/alloydb/v1alpha/resources.proto | 1795 + .../cloud/alloydb/v1alpha/service.proto | 2305 + .../cloud/alloydb/v1beta/csql_resources.proto | 40 + .../cloud/alloydb/v1beta/csql_service.proto | 79 + .../cloud/alloydb/v1beta/data_model.proto | 62 + .../google/cloud/alloydb/v1beta/gemini.proto | 60 + .../cloud/alloydb/v1beta/resources.proto | 1786 + .../google/cloud/alloydb/v1beta/service.proto | 2305 + .../google-cloud-alloydb/protos/protos.d.ts | 54745 ++++++ .../google-cloud-alloydb/protos/protos.js | 142445 +++++++++++++++ .../google-cloud-alloydb/protos/protos.json | 17399 ++ .../alloy_d_b_admin.batch_create_instances.js | 81 + .../v1/alloy_d_b_admin.create_backup.js | 91 + .../v1/alloy_d_b_admin.create_cluster.js | 93 + .../v1/alloy_d_b_admin.create_instance.js | 93 + ...lloy_d_b_admin.create_secondary_cluster.js | 93 + ...loy_d_b_admin.create_secondary_instance.js | 93 + .../v1/alloy_d_b_admin.create_user.js | 90 + .../v1/alloy_d_b_admin.delete_backup.js | 88 + .../v1/alloy_d_b_admin.delete_cluster.js | 93 + .../v1/alloy_d_b_admin.delete_instance.js | 89 + .../v1/alloy_d_b_admin.delete_user.js | 81 + .../v1/alloy_d_b_admin.execute_sql.js | 90 + .../v1/alloy_d_b_admin.export_cluster.js | 84 + .../v1/alloy_d_b_admin.failover_instance.js | 83 + ...y_d_b_admin.generate_client_certificate.js | 94 + .../v1/alloy_d_b_admin.get_backup.js | 61 + .../v1/alloy_d_b_admin.get_cluster.js | 67 + .../v1/alloy_d_b_admin.get_connection_info.js | 76 + .../v1/alloy_d_b_admin.get_instance.js | 66 + .../generated/v1/alloy_d_b_admin.get_user.js | 62 + .../v1/alloy_d_b_admin.import_cluster.js | 91 + .../v1/alloy_d_b_admin.inject_fault.js | 88 + .../v1/alloy_d_b_admin.list_backups.js | 80 + .../v1/alloy_d_b_admin.list_clusters.js | 83 + .../v1/alloy_d_b_admin.list_databases.js | 81 + .../v1/alloy_d_b_admin.list_instances.js | 85 + ...d_b_admin.list_supported_database_flags.js | 82 + .../v1/alloy_d_b_admin.list_users.js | 80 + .../v1/alloy_d_b_admin.promote_cluster.js | 89 + .../v1/alloy_d_b_admin.restart_instance.js | 88 + .../v1/alloy_d_b_admin.restore_cluster.js | 102 + .../v1/alloy_d_b_admin.switchover_cluster.js | 83 + .../v1/alloy_d_b_admin.update_backup.js | 94 + .../v1/alloy_d_b_admin.update_cluster.js | 95 + .../v1/alloy_d_b_admin.update_instance.js | 95 + .../v1/alloy_d_b_admin.update_user.js | 92 + .../v1/alloy_d_b_admin.upgrade_cluster.js | 93 + ..._c_s_q_l_admin.restore_from_cloud_s_q_l.js | 77 + ...ppet_metadata_google.cloud.alloydb.v1.json | 2027 + .../alloy_d_b_admin.batch_create_instances.js | 81 + .../v1alpha/alloy_d_b_admin.create_backup.js | 91 + .../v1alpha/alloy_d_b_admin.create_cluster.js | 93 + .../alloy_d_b_admin.create_database.js | 71 + .../alloy_d_b_admin.create_instance.js | 93 + ...lloy_d_b_admin.create_secondary_cluster.js | 93 + ...loy_d_b_admin.create_secondary_instance.js | 93 + .../v1alpha/alloy_d_b_admin.create_user.js | 90 + .../v1alpha/alloy_d_b_admin.delete_backup.js | 88 + .../v1alpha/alloy_d_b_admin.delete_cluster.js | 93 + .../alloy_d_b_admin.delete_instance.js | 89 + .../v1alpha/alloy_d_b_admin.delete_user.js | 81 + .../v1alpha/alloy_d_b_admin.execute_sql.js | 91 + .../v1alpha/alloy_d_b_admin.export_cluster.js | 84 + .../alloy_d_b_admin.failover_instance.js | 83 + ...y_d_b_admin.generate_client_certificate.js | 99 + .../v1alpha/alloy_d_b_admin.get_backup.js | 61 + .../v1alpha/alloy_d_b_admin.get_cluster.js | 67 + .../alloy_d_b_admin.get_connection_info.js | 76 + .../v1alpha/alloy_d_b_admin.get_instance.js | 66 + .../v1alpha/alloy_d_b_admin.get_user.js | 62 + .../v1alpha/alloy_d_b_admin.import_cluster.js | 91 + .../v1alpha/alloy_d_b_admin.inject_fault.js | 88 + .../v1alpha/alloy_d_b_admin.list_backups.js | 80 + .../v1alpha/alloy_d_b_admin.list_clusters.js | 83 + .../v1alpha/alloy_d_b_admin.list_databases.js | 81 + .../v1alpha/alloy_d_b_admin.list_instances.js | 85 + ...d_b_admin.list_supported_database_flags.js | 82 + .../v1alpha/alloy_d_b_admin.list_users.js | 80 + .../alloy_d_b_admin.promote_cluster.js | 89 + .../alloy_d_b_admin.restart_instance.js | 88 + .../alloy_d_b_admin.restore_cluster.js | 102 + .../alloy_d_b_admin.switchover_cluster.js | 83 + .../v1alpha/alloy_d_b_admin.update_backup.js | 94 + .../v1alpha/alloy_d_b_admin.update_cluster.js | 95 + .../alloy_d_b_admin.update_instance.js | 95 + .../v1alpha/alloy_d_b_admin.update_user.js | 92 + .../alloy_d_b_admin.upgrade_cluster.js | 93 + ..._c_s_q_l_admin.restore_from_cloud_s_q_l.js | 77 + ...metadata_google.cloud.alloydb.v1alpha.json | 2079 + .../alloy_d_b_admin.batch_create_instances.js | 81 + .../v1beta/alloy_d_b_admin.create_backup.js | 91 + .../v1beta/alloy_d_b_admin.create_cluster.js | 93 + .../v1beta/alloy_d_b_admin.create_database.js | 71 + .../v1beta/alloy_d_b_admin.create_instance.js | 93 + ...lloy_d_b_admin.create_secondary_cluster.js | 93 + ...loy_d_b_admin.create_secondary_instance.js | 93 + .../v1beta/alloy_d_b_admin.create_user.js | 90 + .../v1beta/alloy_d_b_admin.delete_backup.js | 88 + .../v1beta/alloy_d_b_admin.delete_cluster.js | 93 + .../v1beta/alloy_d_b_admin.delete_instance.js | 89 + .../v1beta/alloy_d_b_admin.delete_user.js | 81 + .../v1beta/alloy_d_b_admin.execute_sql.js | 91 + .../v1beta/alloy_d_b_admin.export_cluster.js | 84 + .../alloy_d_b_admin.failover_instance.js | 83 + ...y_d_b_admin.generate_client_certificate.js | 99 + .../v1beta/alloy_d_b_admin.get_backup.js | 61 + .../v1beta/alloy_d_b_admin.get_cluster.js | 67 + .../alloy_d_b_admin.get_connection_info.js | 76 + .../v1beta/alloy_d_b_admin.get_instance.js | 66 + .../v1beta/alloy_d_b_admin.get_user.js | 62 + .../v1beta/alloy_d_b_admin.import_cluster.js | 91 + .../v1beta/alloy_d_b_admin.inject_fault.js | 88 + .../v1beta/alloy_d_b_admin.list_backups.js | 80 + .../v1beta/alloy_d_b_admin.list_clusters.js | 83 + .../v1beta/alloy_d_b_admin.list_databases.js | 81 + .../v1beta/alloy_d_b_admin.list_instances.js | 85 + ...d_b_admin.list_supported_database_flags.js | 82 + .../v1beta/alloy_d_b_admin.list_users.js | 80 + .../v1beta/alloy_d_b_admin.promote_cluster.js | 89 + .../alloy_d_b_admin.restart_instance.js | 88 + .../v1beta/alloy_d_b_admin.restore_cluster.js | 102 + .../alloy_d_b_admin.switchover_cluster.js | 83 + .../v1beta/alloy_d_b_admin.update_backup.js | 94 + .../v1beta/alloy_d_b_admin.update_cluster.js | 95 + .../v1beta/alloy_d_b_admin.update_instance.js | 95 + .../v1beta/alloy_d_b_admin.update_user.js | 92 + .../v1beta/alloy_d_b_admin.upgrade_cluster.js | 93 + ..._c_s_q_l_admin.restore_from_cloud_s_q_l.js | 77 + ..._metadata_google.cloud.alloydb.v1beta.json | 2079 + .../google-cloud-alloydb/src/index.ts | 31 + .../src/v1/alloy_d_b_admin_client.ts | 6582 + .../src/v1/alloy_d_b_admin_client_config.json | 223 + .../src/v1/alloy_d_b_admin_proto_list.json | 7 + .../src/v1/alloy_d_b_c_s_q_l_admin_client.ts | 1422 + ...alloy_d_b_c_s_q_l_admin_client_config.json | 30 + .../alloy_d_b_c_s_q_l_admin_proto_list.json | 7 + .../src/v1/gapic_metadata.json | 441 + .../google-cloud-alloydb/src/v1/index.ts | 20 + .../src/v1alpha/alloy_d_b_admin_client.ts | 6683 + .../alloy_d_b_admin_client_config.json | 228 + .../v1alpha/alloy_d_b_admin_proto_list.json | 8 + .../v1alpha/alloy_d_b_c_s_q_l_admin_client.ts | 1422 + ...alloy_d_b_c_s_q_l_admin_client_config.json | 30 + .../alloy_d_b_c_s_q_l_admin_proto_list.json | 8 + .../src/v1alpha/gapic_metadata.json | 451 + .../google-cloud-alloydb/src/v1alpha/index.ts | 20 + .../src/v1beta/alloy_d_b_admin_client.ts | 6683 + .../v1beta/alloy_d_b_admin_client_config.json | 228 + .../v1beta/alloy_d_b_admin_proto_list.json | 8 + .../v1beta/alloy_d_b_c_s_q_l_admin_client.ts | 1422 + ...alloy_d_b_c_s_q_l_admin_client_config.json | 30 + .../alloy_d_b_c_s_q_l_admin_proto_list.json | 8 + .../src/v1beta/gapic_metadata.json | 451 + .../google-cloud-alloydb/src/v1beta/index.ts | 20 + .../system-test/fixtures/sample/src/index.js | 28 + .../system-test/fixtures/sample/src/index.ts | 38 + .../system-test/install.ts | 49 + .../test/gapic_alloy_d_b_admin_v1.ts | 7199 + .../test/gapic_alloy_d_b_admin_v1alpha.ts | 7307 + .../test/gapic_alloy_d_b_admin_v1beta.ts | 7307 + .../test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts | 1522 + .../gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts | 1522 + .../gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts | 1522 + .../google-cloud-alloydb/tsconfig.json | 22 + .../google-cloud-alloydb/webpack.config.js | 64 + 188 files changed, 297287 insertions(+) create mode 100644 owl-bot-staging/google-cloud-alloydb/.eslintignore create mode 100644 owl-bot-staging/google-cloud-alloydb/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-alloydb/.gitattributes create mode 100644 owl-bot-staging/google-cloud-alloydb/.gitignore create mode 100644 owl-bot-staging/google-cloud-alloydb/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/.nycrc create mode 100644 owl-bot-staging/google-cloud-alloydb/.prettierignore create mode 100644 owl-bot-staging/google-cloud-alloydb/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-alloydb/LICENSE create mode 100644 owl-bot-staging/google-cloud-alloydb/README.md create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-alloydb/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js create mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-alloydb/webpack.config.js diff --git a/owl-bot-staging/google-cloud-alloydb/.eslintignore b/owl-bot-staging/google-cloud-alloydb/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-alloydb/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-alloydb/.gitattributes b/owl-bot-staging/google-cloud-alloydb/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-alloydb/.gitignore b/owl-bot-staging/google-cloud-alloydb/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-alloydb/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/.jsdoc.js new file mode 100644 index 00000000000..2622fc93a10 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/alloydb', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-alloydb/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-alloydb/.nycrc b/owl-bot-staging/google-cloud-alloydb/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/.prettierignore b/owl-bot-staging/google-cloud-alloydb/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-alloydb/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md b/owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md new file mode 100644 index 00000000000..22fe4269f70 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Alloydb API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=alloydb.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/LICENSE b/owl-bot-staging/google-cloud-alloydb/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/LICENSE @@ -0,0 +1,202 @@ + + 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-alloydb/README.md b/owl-bot-staging/google-cloud-alloydb/README.md new file mode 100644 index 00000000000..682032063e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/README.md @@ -0,0 +1,232 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [AlloyDB API: Nodejs Client][homepage] + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority + +[![npm version](https://img.shields.io/npm/v/@google-cloud/alloydb.svg)](https://www.npmjs.org/package/@google-cloud/alloydb) + +AlloyDB API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [AlloyDB API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/alloydb/latest) +* [AlloyDB API Documentation](https://cloud.google.com/alloydb/docs) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the AlloyDB API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/alloydb +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| batch create instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js) | +| create backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js) | +| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js) | +| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js) | +| create secondary cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js) | +| create secondary instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js) | +| create user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js) | +| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js) | +| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js) | +| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js) | +| delete user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js) | +| execute sql | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js) | +| export cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js) | +| failover instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js) | +| generate client certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js) | +| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js) | +| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js) | +| get connection info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js) | +| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js) | +| get user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js) | +| import cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js) | +| inject fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js) | +| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js) | +| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js) | +| list databases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js) | +| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js) | +| list supported database flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js) | +| list users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js) | +| promote cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js) | +| restart instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js) | +| restore cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js) | +| switchover cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js) | +| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js) | +| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js) | +| update instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js) | +| update user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js) | +| upgrade cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js) | +| restore from cloud s q l | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json) | +| batch create instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js) | +| create backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js) | +| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js) | +| create database | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js) | +| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js) | +| create secondary cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js) | +| create secondary instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js) | +| create user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js) | +| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js) | +| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js) | +| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js) | +| delete user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js) | +| execute sql | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js) | +| export cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js) | +| failover instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js) | +| generate client certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js) | +| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js) | +| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js) | +| get connection info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js) | +| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js) | +| get user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js) | +| import cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js) | +| inject fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js) | +| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js) | +| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js) | +| list databases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js) | +| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js) | +| list supported database flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js) | +| list users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js) | +| promote cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js) | +| restart instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js) | +| restore cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js) | +| switchover cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js) | +| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js) | +| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js) | +| update instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js) | +| update user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js) | +| upgrade cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js) | +| restore from cloud s q l | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json) | +| batch create instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js) | +| create backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js) | +| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js) | +| create database | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js) | +| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js) | +| create secondary cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js) | +| create secondary instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js) | +| create user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js) | +| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js) | +| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js) | +| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js) | +| delete user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js) | +| execute sql | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js) | +| export cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js) | +| failover instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js) | +| generate client certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js) | +| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js) | +| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js) | +| get connection info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js) | +| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js) | +| get user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js) | +| import cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js) | +| inject fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js) | +| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js) | +| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js) | +| list databases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js) | +| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js) | +| list supported database flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js) | +| list users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js) | +| promote cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js) | +| restart instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js) | +| restore cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js) | +| switchover cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js) | +| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js) | +| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js) | +| update instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js) | +| update user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js) | +| upgrade cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js) | +| restore from cloud s q l | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/alloydb@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=alloydb.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto new file mode 100644 index 00000000000..43893ff3350 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto @@ -0,0 +1,40 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "CsqlResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDB::V1"; + +// The source CloudSQL backup resource. +message CloudSQLBackupRunSource { + // The project ID of the source CloudSQL instance. This should be the same as + // the AlloyDB cluster's project. + string project = 1; + + // Required. The CloudSQL instance ID. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The CloudSQL backup run ID. + int64 backup_run_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto new file mode 100644 index 00000000000..bff72301bcb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1/csql_resources.proto"; +import "google/cloud/alloydb/v1/resources.proto"; +import "google/cloud/alloydb/v1/service.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "CSQLServiceProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDB::V1"; + +// Service for interactions with CloudSQL. +service AlloyDBCSQLAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Restores an AlloyDB cluster from a CloudSQL resource. + rpc RestoreFromCloudSQL(RestoreFromCloudSQLRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL" + body: "*" + }; + option (google.api.method_signature) = "parent,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for registering Restoring from CloudSQL resource. +message RestoreFromCloudSQLRequest { + // The source CloudSQL resource to restore from. + oneof source { + // Cluster created from CloudSQL backup run. + CloudSQLBackupRunSource cloudsql_backup_run_source = 101; + } + + // Required. The location of the new cluster. For the required format, see the + // comment on Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto new file mode 100644 index 00000000000..cdbcc925ffb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "DataModelProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDB::V1"; + +// SqlResult represents the result for the execution of a sql statement. +message SqlResult { + // List of columns included in the result. This also includes the data type + // of the column. + repeated SqlResultColumn columns = 1; + + // Rows returned by the SQL statement. + repeated SqlResultRow rows = 2; +} + +// Contains the name and datatype of a column in a SQL Result. +message SqlResultColumn { + // Name of the column. + string name = 1; + + // Datatype of the column as reported by the postgres driver. + // Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + // "INT", and "BIGINT". + string type = 2; +} + +// A single row from a sql result. +message SqlResultRow { + // List of values in a row of sql result. + repeated SqlResultValue values = 1; +} + +// A single value in a row from a sql result. +message SqlResultValue { + // The cell value represented in string format. + // Timestamps are converted to string using RFC3339Nano format. + optional string value = 1; + + // Set to true if cell value is null. + optional bool null_value = 2; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto new file mode 100644 index 00000000000..a5a80e137f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto @@ -0,0 +1,1718 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1/csql_resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/date.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDB::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ServiceAttachment" + pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" +}; + +// View on Instance. Pass this enum to rpcs that returns an Instance message to +// control which subsets of fields to get. +enum 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; +} + +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum 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; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // 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; +} + +// Subscription_type added to distinguish between Standard and Trial +// subscriptions. By default, a subscription type is considered STANDARD unless +// explicitly specified. +enum 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; +} + +// The username/password for a database user. Used for specifying initial +// users at cluster creation time. +message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; +} + +// Subset of the source instance configuration that is available when reading +// the cluster resource. +message MigrationSource { + // Denote the type of migration source that created this cluster. + enum MigrationSourceType { + // Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + + // DMS source means the cluster was created via DMS migration job. + DMS = 1; + } + + // Output only. The host and port of the on-premises instance in host:port + // format + string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Place holder for the external source identifier(e.g DMS job + // name) that created the cluster. + string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of migration source. + MigrationSourceType source_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EncryptionConfig describes the encryption config of a cluster or a backup +// that is encrypted with a CMEK (customer-managed encryption key). +message EncryptionConfig { + // 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] + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; +} + +// EncryptionInfo describes the encryption information of a cluster or a backup. +message EncryptionInfo { + // Possible encryption types. + enum 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; + } + + // Output only. Type of encryption. + Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud KMS key versions that are being used to protect the + // database or the backup. + repeated string kms_key_versions = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// SSL configuration. +message SslConfig { + // SSL mode options. + enum 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 [deprecated = true]; + + // SSL connections are required. CA verification not enforced. + // Clients may use locally self-signed certificates (default psql client + // behavior). + SSL_MODE_REQUIRE = 2 [deprecated = true]; + + // 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 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; + } + + // Certificate Authority (CA) source for SSL/TLS certificates. + enum 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; + } + + // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + // supported currently, and is the default value. + CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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. +message AutomatedBackupPolicy { + // 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. + message WeeklySchedule { + // 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. + repeated google.type.TimeOfDay start_times = 1; + + // 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. + repeated google.type.DayOfWeek days_of_week = 2; + } + + // A time based retention policy specifies that all backups within a certain + // time period should be retained. + message TimeBasedRetention { + // The retention period. + google.protobuf.Duration retention_period = 1; + } + + // A quantity based policy specifies that a certain number of the most recent + // successful backups should be retained. + message QuantityBasedRetention { + // The number of backups to retain. + int32 count = 1; + } + + // The schedule for this automated backup policy. + // + // A schedule specifies times at which to start a backup. If a backup + // window is also provided, the backup is guaranteed to be started and + // completed within the start time plus the backup window. If the backup is + // not completed within the backup window it is marked as failed. + // + // If not set, the schedule defaults to a weekly schedule with one backup + // per day and a start time chosen arbitrarily. + oneof schedule { + // Weekly schedule for the Backup. + WeeklySchedule weekly_schedule = 2; + } + + // The retention policy for automated backups. + // + // The retention policy for a backup is fixed at the time the backup is + // created. Changes to this field only apply to new backups taken with the + // policy; the retentions of existing backups remain unchanged. + // + // If no retention policy is set, a default of 14 days is used. + oneof retention { + // Time-based Backup retention policy. + TimeBasedRetention time_based_retention = 4; + + // Quantity-based Backup retention policy to retain recent backups. + QuantityBasedRetention quantity_based_retention = 5; + } + + // Whether automated automated backups are enabled. If not set, defaults to + // true. + optional bool enabled = 1; + + // 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. + google.protobuf.Duration backup_window = 3; + + // 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. + EncryptionConfig encryption_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string location = 6; + + // Labels to apply to backups created using this configuration. + map labels = 7; +} + +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // 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. + int32 recovery_window_days = 4; + + // 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. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing a BackupSource. +message BackupSource { + // 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. + string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + string backup_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // 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. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// MaintenanceUpdatePolicy defines the policy for system updates. +message MaintenanceUpdatePolicy { + // MaintenanceWindow specifies a preferred day and time for maintenance. + message MaintenanceWindow { + // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + google.type.DayOfWeek day = 1; + + // Preferred time to start the maintenance operation on the specified day. + // Maintenance will start within 1 hour of this time. + google.type.TimeOfDay start_time = 2; + } + + // 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. + message DenyMaintenancePeriod { + // 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 + google.type.Date start_date = 1; + + // 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 + google.type.Date end_date = 2; + + // 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 + google.type.TimeOfDay time = 3; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; + + // Periods to deny maintenance. Currently limited to 1. + repeated DenyMaintenancePeriod deny_maintenance_periods = 2; +} + +// 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. +message MaintenanceSchedule { + // Output only. The scheduled start time for the maintenance. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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. +message Cluster { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + plural: "clusters" + singular: "cluster" + style: DECLARATIVE_FRIENDLY + }; + + // Metadata related to network configuration. + message NetworkConfig { + // 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. + string network = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // 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. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration information for the secondary cluster. This should be set + // if and only if the cluster is of type SECONDARY. + message SecondaryConfig { + // The name of the primary cluster name with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string primary_cluster_name = 1 [(google.api.resource_reference) = { + type: "alloydb.googleapis.com/Cluster" + }]; + } + + // 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. + message PrimaryConfig { + // Output only. Names of the clusters that are replicating from this + // cluster. + repeated string secondary_cluster_names = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Cluster" + } + ]; + } + + // PscConfig contains PSC related configuration at a cluster level. + message PscConfig { + // Optional. Create an instance that allows connections from Private Service + // Connect endpoints to the instance. + bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The project number that needs to be allowlisted on the + // network attachment to enable outbound connectivity. + int64 service_owned_project_number = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Contains information and all metadata related to TRIAL clusters. + message TrialMetadata { + // start time of the trial cluster. + google.protobuf.Timestamp start_time = 1; + + // End time of the trial cluster. + google.protobuf.Timestamp end_time = 2; + + // Upgrade time of trial cluster to Standard cluster. + google.protobuf.Timestamp upgrade_time = 3; + + // grace end time of the cluster. + google.protobuf.Timestamp grace_end_time = 4; + } + + // Configuration for Dataplex integration. + message DataplexConfig { + // Dataplex is enabled by default for resources such as clusters and + // instances. This flag controls the integration of AlloyDB PG + // resources (like databases, schemas, and tables) with Dataplex." + bool enabled = 1; + } + + // Cluster State + enum 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; + } + + // Type of Cluster + enum 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; + } + + // In case of an imported cluster, this field contains information about the + // source this cluster was imported from. + oneof source { + // Output only. Cluster created from backup. + BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created via DMS migration. + MigrationSource migration_source = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created from CloudSQL snapshot. + CloudSQLBackupRunSource cloudsql_backup_run_source = 42 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Cluster. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the cluster. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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` + ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; + + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string network = 10 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 11; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 12; + + // 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. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Initial user to setup during cluster creation. + // If used in `RestoreCluster` this is ignored. + UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // 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. + AutomatedBackupPolicy automated_backup_policy = 17; + + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; + + // 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. + EncryptionConfig encryption_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the cluster. + EncryptionInfo encryption_info = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cross Region replication config specific to SECONDARY cluster. + SecondaryConfig secondary_config = 22; + + // Output only. Cross Region replication config specific to PRIMARY cluster. + PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The configuration for Private Service Connect (PSC) for the + // cluster. + PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maintenance update policy determines when to allow or deny + // updates. + MaintenanceUpdatePolicy maintenance_update_policy = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The maintenance schedule for the cluster, generated for a + // specific rollout if a maintenance window is set. + MaintenanceSchedule maintenance_schedule = 37 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Subscription type of the cluster. + SubscriptionType subscription_type = 38 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Metadata for free trial clusters + TrialMetadata trial_metadata = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing" + // ``` + map tags = 41 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Configuration for Dataplex integration. + DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; +} + +// An Instance is a computing unit that an end customer can connect to. +// It's the main unit of computing resources in AlloyDB. +message Instance { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" + plural: "instances" + singular: "instance" + style: DECLARATIVE_FRIENDLY + }; + + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + + // 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. + string machine_type = 4; + } + + // 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. + message Node { + // Output only. The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the VM e.g. + // "test-read-0601-407e52be-ms3l". + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The private IP address of the VM e.g. "10.57.0.34". + string ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // QueryInsights Instance specific configuration. + message QueryInsightsInstanceConfig { + // Record application tags for an instance. + // This flag is turned "on" by default. + optional bool record_application_tags = 2; + + // Record client address for an instance. Client address is PII information. + // This flag is turned "on" by default. + optional bool record_client_address = 3; + + // Query string length. The default value is 1024. + // Any integer between 256 and 4500 is considered valid. + uint32 query_string_length = 4; + + // 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. + optional uint32 query_plans_per_minute = 5; + } + + // Observability Instance specific configuration. + message ObservabilityInstanceConfig { + // Observability feature status for an instance. + // This flag is turned "off" by default. + optional bool enabled = 1; + + // Preserve comments in query string for an instance. + // This flag is turned "off" by default. + optional bool preserve_comments = 2; + + // 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. + optional bool track_wait_events = 3; + + // 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. + optional bool track_wait_event_types = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Query string length. The default value is 10k. + optional int32 max_query_string_length = 5; + + // Record application tags for an instance. + // This flag is turned "off" by default. + optional bool record_application_tags = 6; + + // 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. + optional int32 query_plans_per_minute = 7; + + // Track actively running queries on the instance. + // If not set, this flag is "off" by default. + optional bool track_active_queries = 8; + } + + // Configuration for a read pool instance. + message ReadPoolConfig { + // Read capacity, i.e. number of nodes in a read pool instance. + int32 node_count = 1; + } + + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL configuration option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for setting up a PSC interface to enable outbound + // connectivity. + message PscInterfaceConfig { + // 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. + string network_attachment_resource = 1; + } + + // Configuration for setting up PSC service automation. Consumer projects in + // the configs will be allowlisted automatically for the instance. + message PscAutoConnectionConfig { + // The consumer project to which the PSC service automation endpoint will + // be created. + string consumer_project = 1; + + // 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. + string consumer_network = 2; + + // Output only. The IP address of the PSC service automation endpoint. + string ip_address = 3 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + string status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string consumer_network_status = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // PscInstanceConfig contains PSC related configuration at an + // instance level. + message PscInstanceConfig { + // 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/` + string service_attachment_link = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Optional. List of consumer projects that are allowed to create + // PSC endpoints to service-attachments to this instance. + repeated string allowed_consumer_projects = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The DNS name of the instance for PSC connectivity. + // Name convention: ...alloydb-psc.goog + string psc_dns_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated PscInterfaceConfig psc_interface_configs = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configurations for setting up PSC service automation. + repeated PscAutoConnectionConfig psc_auto_connections = 9 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Metadata related to instance-level network configuration. + message InstanceNetworkConfig { + // AuthorizedNetwork contains metadata for an authorized network. + message AuthorizedNetwork { + // CIDR range for one authorzied network of the instance. + string cidr_range = 1 [(google.api.field_info).format = IPV4]; + } + + // Optional. A list of external network authorized to access this instance. + repeated AuthorizedNetwork authorized_external_networks = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling public ip for the instance. + bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling an outbound public IP address to support a database + // server sending requests out into the internet. + bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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}`. + string network = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // 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])?. + string allocated_ip_range_override = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for Managed Connection Pool (MCP). + message ConnectionPoolConfig { + // Optional. Whether to enable Managed Connection Pool (MCP). + bool enabled = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Connection Pool flags, as a list of "key": "value" pairs. + map flags = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of running poolers per instance. + int32 pooler_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Instance State + enum 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; + } + + // Type of an Instance + enum 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; + } + + // 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). + enum AvailabilityType { + // This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional (or Highly) available instance. + REGIONAL = 2; + } + + // Specifies whether an instance needs to spin up. + enum ActivationPolicy { + // The policy is not specified. + ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is running. + ALWAYS = 1; + + // The instance is not running. + NEVER = 2; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Instance. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the instance. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the instance. Specified at creation time. + InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for the machines that host the underlying + // database engine. + MachineConfig machine_config = 10; + + // 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). + AvailabilityType availability_type = 11; + + // 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. + string gce_zone = 12; + + // 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. + map database_flags = 13; + + // Output only. This is set for the read-write VM of the PRIMARY instance + // only. + Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of available read-only VMs in this instance, including + // the standby for a PRIMARY instance. + repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for query insights. + QueryInsightsInstanceConfig query_insights_config = 21; + + // Configuration for observability. + ObservabilityInstanceConfig observability_config = 26; + + // Read pool instance configuration. + // This is required if the value of instanceType is READ_POOL. + ReadPoolConfig read_pool_config = 14; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string public_ip_address = 27 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 17; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 18; + + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The configuration for Private Service Connect (PSC) for the + // instance. + PscInstanceConfig psc_instance_config = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Instance-level network configuration. + InstanceNetworkConfig network_config = 29 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. All outbound public IP addresses configured for the instance. + repeated string outbound_public_ip_addresses = 34 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + ActivationPolicy activation_policy = 35 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for Managed Connection Pool (MCP). + ConnectionPoolConfig connection_pool_config = 37 + [(google.api.field_behavior) = OPTIONAL]; +} + +// ConnectionInfo singleton resource. +// https://google.aip.dev/156 +message ConnectionInfo { + option (google.api.resource) = { + type: "alloydb.googleapis.com/ConnectionInfo" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" + plural: "connectionInfos" + singular: "connectionInfo" + }; + + // The name of the ConnectionInfo singleton resource, e.g.: + // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + // This field currently has no semantic meaning. + string name = 1; + + // 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. + string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string public_ip_address = 5 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The unique ID of the Instance. + string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing Backup object +message Backup { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + plural: "backups" + singular: "backup" + style: DECLARATIVE_FRIENDLY + }; + + // 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) + message QuantityBasedExpiry { + // 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). + int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The length of the quantity-based queue, specified by the + // backup's retention policy. + int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Backup State + enum 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; + } + + // Backup Type + enum 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; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Backup. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the resource finished being created. + google.protobuf.Timestamp create_completion_time = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 6; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backup type, which suggests the trigger for the backup. + Type type = 8; + + // User-provided description of the backup. + string description = 9; + + // Output only. The system-generated UID of the cluster which was used to + // create this resource. + string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full resource name of the backup source cluster + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + string cluster_name = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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. + bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + EncryptionConfig encryption_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 14; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 16; + + // Output only. The size of the backup in bytes. + int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp expiry_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + QuantityBasedExpiry expiry_quantity = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing" + // ``` + map tags = 25 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// 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. +message SupportedDatabaseFlag { + option (google.api.resource) = { + type: "alloydb.googleapis.com/SupportedDatabaseFlag" + pattern: "projects/{project}/locations/{location}/flags/{flag}" + plural: "supportedDatabaseFlags" + singular: "supportedDatabaseFlag" + }; + + // Restrictions on STRING type values + message StringRestrictions { + // The list of allowed values, if bounded. This field will be empty + // if there is a unbounded number of allowed values. + repeated string allowed_values = 1; + } + + // Restrictions on INTEGER type values. + message IntegerRestrictions { + // The minimum value that can be specified, if applicable. + google.protobuf.Int64Value min_value = 1; + + // The maximum value that can be specified, if applicable. + google.protobuf.Int64Value max_value = 2; + } + + // 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". + enum 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; + } + + // The scope of the flag. + enum 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; + } + + // The restrictions on the flag value per type. + oneof restrictions { + // Restriction on STRING type value. + StringRestrictions string_restrictions = 7; + + // Restriction on INTEGER type value. + IntegerRestrictions integer_restrictions = 8; + } + + // The recommended value for the flag by type, if applicable. + oneof recommended_value { + // The recommended value for a STRING flag. + string recommended_string_value = 10; + + // The recommended value for an INTEGER flag. + google.protobuf.Int64Value recommended_integer_value = 11; + } + + // 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. + string name = 1; + + // The name of the database flag, e.g. "max_allowed_packets". + // The is a possibly key for the Instance.database_flags map field. + string flag_name = 2; + + ValueType value_type = 3; + + // Whether the database flag accepts multiple values. If true, + // a comma-separated list of stringified values may be specified. + bool accepts_multiple_values = 4; + + // Major database engine versions for which this flag is supported. + repeated DatabaseVersion supported_db_versions = 5; + + // 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). + bool requires_db_restart = 6; + + // The scope of the flag. + Scope scope = 9; +} + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + plural: "users" + singular: "user" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum 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; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Input only. If the user already exists and it has additional roles, keep + // them granted. + bool keep_extra_roles = 6 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Message describing Database object. +message Database { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Database" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}" + plural: "databases" + singular: "database" + style: DECLARATIVE_FRIENDLY + }; + + // Identifier. Name of the resource in the form of + // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. Immutable. Charset for the database. + // This field can contain any PostgreSQL supported charset name. + // Example values include "UTF8", "SQL_ASCII", etc. + string charset = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. lc_collate for the database. + // String sort order. + // Example values include "C", "POSIX", etc. + string collation = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. lc_ctype for the database. + // Character classification (What is a letter? The upper-case equivalent?). + // Example values include "C", "POSIX", etc. + string character_type = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Input only. Immutable. Template of the database to be used for creating a + // new database. + string database_template = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Whether the database is a template database. + optional bool is_template_database = 7 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto new file mode 100644 index 00000000000..140ec0fc059 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto @@ -0,0 +1,2234 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1/data_model.proto"; +import "google/cloud/alloydb/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1"; +option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.alloydb.v1"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; +option ruby_package = "Google::Cloud::AlloyDB::V1"; + +// Service describing handlers for resources +service AlloyDBAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Exports data from the cluster. + // Imperative only. + rpc ExportCluster(ExportClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:export" + body: "*" + }; + option (google.api.method_signature) = + "name,gcs_destination,database,csv_export_options,sql_export_options"; + option (google.longrunning.operation_info) = { + response_type: "ExportClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Imports data to the cluster. + // Imperative only. + rpc ImportCluster(ImportClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:import" + body: "*" + }; + option (google.api.method_signature) = "name,gcs_uri,database,user"; + option (google.longrunning.operation_info) = { + response_type: "ImportClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Upgrades a single Cluster. + // Imperative only. + rpc UpgradeCluster(UpgradeClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/clusters/*}:upgrade" + body: "*" + }; + option (google.api.method_signature) = "name,version"; + option (google.longrunning.operation_info) = { + response_type: "UpgradeClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc SwitchoverCluster(SwitchoverClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*}:switchover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc RestoreCluster(RestoreClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc BatchCreateInstances(BatchCreateInstancesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" + body: "requests" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Forces a Failover for a highly available instance. + // Failover promotes the HA standby instance as the new primary. + // Imperative only. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart an Instance in a cluster. + // Imperative only. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Executes a SQL statement in a database inside an AlloyDB instance. + rpc ExecuteSql(ExecuteSqlRequest) returns (ExecuteSqlResponse) { + option (google.api.http) = { + post: "/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql" + body: "*" + }; + option (google.api.method_signature) = + "instance,database,user,sql_statement,password"; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Backup in a given project and location. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists SupportedDatabaseFlags for a given project and location. + rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) + returns (ListSupportedDatabaseFlagsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc GenerateClientCertificate(GenerateClientCertificateRequest) + returns (GenerateClientCertificateResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Get instance metadata used for a connection. + rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Databases in a given project and location. + rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/databases" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Message for requesting list of Clusters +message ListClustersRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Clusters +message ListClustersResponse { + // The list of Cluster + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster +message GetClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message CreateSecondaryClusterRequest { + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Cluster +message CreateClusterRequest { + // Required. The location of the new cluster. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster +message UpdateClusterRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Destination for Export. Export will be done to cloud storage. +message GcsDestination { + // 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`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Export cluster request. +message ExportClusterRequest { + // Options for exporting data in CSV format. + message CsvExportOptions { + // Required. The SELECT query used to extract the data. + string select_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string field_delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string quote_character = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string escape_character = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Options for exporting data in SQL format. + message SqlExportOptions { + // Optional. Tables to export from. + repeated string tables = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, only export the schema. + optional bool schema_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, output commands to DROP all the dumped database + // objects prior to outputting the commands for creating them. + optional bool clean_target_objects = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, use DROP ... IF EXISTS commands to check for the + // object's existence before dropping it in clean_target_objects mode. + optional bool if_exist_target_objects = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Oneof field to support other destinations in future. + oneof destination { + // Required. Option to export data to cloud storage. + GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required field to specify export file type and options. + oneof export_options { + // Options for exporting data in CSV format. Required field to be set for + // CSV file type. + CsvExportOptions csv_export_options = 4; + + // Options for exporting data in SQL format. Required field to be set for + // SQL file type. + SqlExportOptions sql_export_options = 5; + } + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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. + string database = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of export cluster rpc. +message ExportClusterResponse { + // Oneof field to support other destinations in future. + oneof destination { + // Required. Option to export data to cloud storage. + GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Import cluster request. +message ImportClusterRequest { + // Options for importing data in SQL format. + message SqlImportOptions {} + + // Options for importing data in CSV format. + message CsvImportOptions { + // Required. The database table to import CSV file into. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The columns to which CSV data is imported. If not specified, + // all columns of the database table are loaded with CSV data. + repeated string columns = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string field_delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string quote_character = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string escape_character = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // oneof field to support various import formats like SQL and CSV. + oneof import_options { + // Options for importing data in SQL format. + SqlImportOptions sql_import_options = 4; + + // Options for importing data in CSV format. + CsvImportOptions csv_import_options = 7; + } + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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`. + string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string database = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string user = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of import rpc. +message ImportClusterResponse { + // Required. Size of the object downloaded from Google Cloud Storage in bytes. + int64 bytes_downloaded = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Upgrades a cluster. +message UpgradeClusterRequest { + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Required. The version the cluster is going to be upgraded to. + DatabaseVersion version = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// UpgradeClusterResponse contains the response for upgrade cluster operation. +message UpgradeClusterResponse { + // Stage information for different stages in the upgrade process. + message StageInfo { + // The stage. + Stage stage = 1; + + // Status of the stage. + Status status = 2; + + // 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. + string logs_url = 3; + } + + // Details regarding the upgrade of instances associated with a cluster. + message InstanceUpgradeDetails { + // Normalized name of the instance. + string name = 1; + + // Upgrade status of the instance. + Status upgrade_status = 2; + + // Instance type. + Instance.InstanceType instance_type = 3; + } + + // Upgrade details of a cluster. This cluster can be primary or secondary. + message ClusterUpgradeDetails { + // Normalized name of the cluster + string name = 1; + + // Upgrade status of the cluster. + Status upgrade_status = 2; + + // Cluster type which can either be primary or secondary. + Cluster.ClusterType cluster_type = 3; + + // 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. + DatabaseVersion database_version = 4; + + // Array containing stage info associated with this cluster. + repeated StageInfo stage_info = 5; + + // Upgrade details of the instances directly associated with this cluster. + repeated InstanceUpgradeDetails instance_upgrade_details = 6; + } + + // Status of upgrade operation. + enum 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; + } + + // Stage in the upgrade. + enum 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; + } + + // Status of upgrade operation. + Status status = 1; + + // A user friendly message summarising the upgrade operation details and the + // next steps for the user if there is any. + string message = 2; + + // Array of upgrade details for the current cluster and all the secondary + // clusters associated with this cluster. + repeated ClusterUpgradeDetails cluster_upgrade_details = 3; +} + +// Message for deleting a Cluster +message DeleteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to cascade delete child instances for given cluster. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for switching over to a cluster +message SwitchoverClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for restoring a Cluster from a backup or another cluster at a given +// point in time. +// NEXT_ID: 11 +message RestoreClusterRequest { + // Required. + // The source to import from. + oneof source { + // Backup source. + BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; + } + + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances +message ListInstancesRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Instances +message ListInstancesResponse { + // The list of Instance + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance +message GetInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // The view of the instance to return. + InstanceView view = 2; +} + +// Message for creating a Instance +message CreateInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// See usage below for notes. +message CreateInstanceRequests { + // Required. Primary and read replica instances to be created. This list + // should not be empty. + repeated CreateInstanceRequest create_instance_requests = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating a batch of instances under the specified cluster. +message BatchCreateInstancesRequest { + // Required. The name of the parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. Resources being created. + CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating batches of instances in a cluster. +message BatchCreateInstancesResponse { + // Created instances. + repeated Instance instances = 1; +} + +// Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 +message BatchCreateInstancesMetadata { + // 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. + repeated string instance_targets = 1; + + // 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. + map instance_statuses = 2; +} + +// 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. +message BatchCreateInstanceStatus { + // State contains all valid instance states for the BatchCreateInstances + // operation. This is mainly used for status reporting through the LRO + // metadata. + enum 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; + } + + // 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. + State state = 1; + + // DEPRECATED - Use the error field instead. + // Error, if any error occurred and is available, during instance creation. + string error_msg = 2; + + // The RPC status of the instance creation operation. This field will be + // present if an error happened during the instance creation. + google.rpc.Status error = 4; + + Instance.InstanceType type = 3; +} + +// Message for updating a Instance +message UpdateInstanceRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Instance +message DeleteInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering failover on an Instance +message FailoverInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +message RestartInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + // restart upon. Applicable only to read instances. + repeated string node_ids = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for ExecuteSql rpc. +message ExecuteSqlRequest { + // Oneof field to support other credential mechanisms in future like + // SecretManager etc. + oneof user_credential { + // Optional. The database native user’s password. + string password = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The instance where the SQL will be executed. For the required + // format, see the comment on the Instance.name field. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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. + string database = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string user = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. SQL statement to execute on database. Any valid statement is + // permitted, including DDL, DML, DQL statements. + string sql_statement = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validates the sql statement by performing + // syntax and semantic validation and doesn't execute the query. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execute a SQL statement response. +message ExecuteSqlResponse { + // SqlResult represents the results for the execution of sql statements. + repeated SqlResult sql_results = 1; + + // Any additional metadata information regarding the execution of the sql + // statement. + ExecuteSqlMetadata metadata = 3; +} + +// Any additional metadata information regarding the execution of the SQL +message ExecuteSqlMetadata { + // Status contains all valid Status a SQL execution can end up in. + enum 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; + } + + // 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." + string message = 1; + + // Set to true if SQL returned a result set larger than the acceptable + // response size limits and the result was truncated. + bool partial_result = 2; + + // The time duration taken to execute the sql statement. + google.protobuf.Duration sql_statement_execution_duration = 3; + + // Status of SQL execution. + Status status = 4; +} + +// Message for requesting list of Backups +message ListBackupsRequest { + // Required. Parent value for ListBackupsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Backups +message ListBackupsResponse { + // The list of Backup + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Backup +message GetBackupRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message for creating a Backup +message CreateBackupRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Required. ID of the requesting object. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Backup +message UpdateBackupRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Backup +message DeleteBackupRequest { + // Required. Name of the resource. For the required format, see the comment on + // the Backup.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for listing the information about the supported Database flags. +message ListSupportedDatabaseFlagsRequest { + // 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. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. The scope for which supported flags are requested. If not + // specified, default is DATABASE. + SupportedDatabaseFlag.Scope scope = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing SupportedDatabaseFlags. +message ListSupportedDatabaseFlagsResponse { + // The list of SupportedDatabaseFlags. + repeated SupportedDatabaseFlag supported_database_flags = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for requests to generate a client certificate signed by the Cluster +// CA. +message GenerateClientCertificateRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location}/clusters/{cluster} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + google.protobuf.Duration cert_duration = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message returned by a GenerateClientCertificate operation. +message GenerateClientCertificateResponse { + // 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. + repeated string pem_certificate_chain = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetConnectionInfo. +message GetConnectionInfoRequest { + // Required. The name of the parent resource. The required format is: + // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Request specific metadata, if any. + oneof request_specific { + // Output only. BatchCreateInstances related metadata. + BatchCreateInstancesMetadata batch_create_instances_metadata = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. UpgradeClusterStatus related metadata. + UpgradeClusterStatus upgrade_cluster_status = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for current status of the Major Version Upgrade operation. +message UpgradeClusterStatus { + // Status of an upgrade stage. + message StageStatus { + // Timing information for the stage execution. + message StageSchedule { + // When the stage is expected to start. Set only if the stage has not + // started yet. + google.protobuf.Timestamp estimated_start_time = 1; + + // Actual start time of the stage. Set only if the stage has started. + google.protobuf.Timestamp actual_start_time = 2; + + // When the stage is expected to end. Set only if the stage has not + // completed yet. + google.protobuf.Timestamp estimated_end_time = 3; + + // Actual end time of the stage. Set only if the stage has completed. + google.protobuf.Timestamp actual_end_time = 4; + } + + // Stage specific status information, if any. + oneof stage_specific_status { + // Read pool instances upgrade metadata. + ReadPoolInstancesUpgradeStageStatus read_pool_instances_upgrade = 11; + } + + // Upgrade stage. + UpgradeClusterResponse.Stage stage = 1; + + // State of this stage. + UpgradeClusterResponse.Status state = 2; + + // Output only. Timing information for the stage execution. + StageSchedule schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Read pool instances upgrade specific status. + message ReadPoolInstancesUpgradeStageStatus { + // Upgrade stats for read pool instances. + message Stats { + // Number of read pool instances for which upgrade has not started. + int32 not_started = 1; + + // Number of read pool instances undergoing upgrade. + int32 ongoing = 2; + + // Number of read pool instances successfully upgraded. + int32 success = 3; + + // Number of read pool instances which failed to upgrade. + int32 failed = 4; + } + + // Read pool instances upgrade statistics. + Stats upgrade_stats = 1; + } + + // Cluster Major Version Upgrade state. + UpgradeClusterResponse.Status state = 1; + + // Whether the operation is cancellable. + bool cancellable = 2; + + // Source database major version. + DatabaseVersion source_version = 3; + + // Target database major version. + DatabaseVersion target_version = 4; + + // Status of all upgrade stages. + repeated StageStatus stages = 5; +} + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for ListDatabases request. +message ListDatabasesRequest { + // Required. Parent value for ListDatabasesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Database" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + // This field is currently not supported, its value will be ignored if passed. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for ListDatabases response. +message ListDatabasesResponse { + // The list of databases. + repeated Database databases = 1; + + // A token identifying the next page of results the server should return. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto new file mode 100644 index 00000000000..551b6721e15 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto @@ -0,0 +1,40 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1alpha; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "CsqlResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; + +// The source CloudSQL backup resource. +message CloudSQLBackupRunSource { + // The project ID of the source CloudSQL instance. This should be the same as + // the AlloyDB cluster's project. + string project = 1; + + // Required. The CloudSQL instance ID. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The CloudSQL backup run ID. + int64 backup_run_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto new file mode 100644 index 00000000000..640b1ebe6d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1alpha/csql_resources.proto"; +import "google/cloud/alloydb/v1alpha/resources.proto"; +import "google/cloud/alloydb/v1alpha/service.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "CSQLServiceProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; + +// Service for interactions with CloudSQL. +service AlloyDBCSQLAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Restores an AlloyDB cluster from a CloudSQL resource. + rpc RestoreFromCloudSQL(RestoreFromCloudSQLRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL" + body: "*" + }; + option (google.api.method_signature) = "parent,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for registering Restoring from CloudSQL resource. +message RestoreFromCloudSQLRequest { + // The source CloudSQL resource to restore from. + oneof source { + // Cluster created from CloudSQL backup run. + CloudSQLBackupRunSource cloudsql_backup_run_source = 101; + } + + // Required. The location of the new cluster. For the required format, see the + // comment on Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto new file mode 100644 index 00000000000..6333cf834cd --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1alpha; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "DataModelProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; + +// SqlResult represents the result for the execution of a sql statement. +message SqlResult { + // List of columns included in the result. This also includes the data type + // of the column. + repeated SqlResultColumn columns = 1; + + // Rows returned by the SQL statement. + repeated SqlResultRow rows = 2; +} + +// Contains the name and datatype of a column in a SQL Result. +message SqlResultColumn { + // Name of the column. + string name = 1; + + // Datatype of the column as reported by the postgres driver. + // Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + // "INT", and "BIGINT". + string type = 2; +} + +// A single row from a sql result. +message SqlResultRow { + // List of values in a row of sql result. + repeated SqlResultValue values = 1; +} + +// A single value in a row from a sql result. +message SqlResultValue { + // The cell value represented in string format. + // Timestamps are converted to string using RFC3339Nano format. + optional string value = 1; + + // Set to true if cell value is null. + optional bool null_value = 2; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto new file mode 100644 index 00000000000..9da438c4389 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto @@ -0,0 +1,60 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1alpha; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "GeminiProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; + +// Enum representing the type of GCA entitlement assigned to a resource. +enum GCAEntitlementType { + // No GCA entitlement is assigned. + GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0; + + // The resource is entitled to the GCA Standard Tier. + GCA_STANDARD = 1; +} + +// Deprecated and unused. This message will be removed in the near future. +message GeminiClusterConfig { + // Output only. Deprecated and unused. This field will be removed in the near + // future. + bool entitled = 1 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Deprecated and unused. This message will be removed in the near future. +message GeminiInstanceConfig { + // Output only. Deprecated and unused. This field will be removed in the near + // future. + bool entitled = 1 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Instance level configuration parameters related to the Gemini Cloud Assist +// product. +message GCAInstanceConfig { + // Output only. Represents the GCA entitlement state of the instance. + GCAEntitlementType gca_entitlement = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto new file mode 100644 index 00000000000..d6cb76972f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto @@ -0,0 +1,1795 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1alpha/csql_resources.proto"; +import "google/cloud/alloydb/v1alpha/gemini.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/date.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ServiceAttachment" + pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" +}; + +// View on Instance. Pass this enum to rpcs that returns an Instance message to +// control which subsets of fields to get. +enum 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; +} + +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum 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; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // 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; +} + +// Subscription_type added to distinguish between Standard and Trial +// subscriptions. By default, a subscription type is considered STANDARD unless +// explicitly specified. +enum 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; +} + +// The username/password for a database user. Used for specifying initial +// users at cluster creation time. +message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; +} + +// Subset of the source instance configuration that is available when reading +// the cluster resource. +message MigrationSource { + // Denote the type of migration source that created this cluster. + enum MigrationSourceType { + // Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + + // DMS source means the cluster was created via DMS migration job. + DMS = 1; + } + + // Output only. The host and port of the on-premises instance in host:port + // format + string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Place holder for the external source identifier(e.g DMS job + // name) that created the cluster. + string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of migration source. + MigrationSourceType source_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EncryptionConfig describes the encryption config of a cluster or a backup +// that is encrypted with a CMEK (customer-managed encryption key). +message EncryptionConfig { + // 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] + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; +} + +// EncryptionInfo describes the encryption information of a cluster or a backup. +message EncryptionInfo { + // Possible encryption types. + enum 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; + } + + // Output only. Type of encryption. + Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud KMS key versions that are being used to protect the + // database or the backup. + repeated string kms_key_versions = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// SSL configuration. +message SslConfig { + // SSL mode options. + enum 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 [deprecated = true]; + + // SSL connections are required. CA verification not enforced. + // Clients may use locally self-signed certificates (default psql client + // behavior). + SSL_MODE_REQUIRE = 2 [deprecated = true]; + + // 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 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; + } + + // Certificate Authority (CA) source for SSL/TLS certificates. + enum 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; + } + + // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + // supported currently, and is the default value. + CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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. +message AutomatedBackupPolicy { + // 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. + message WeeklySchedule { + // 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. + repeated google.type.TimeOfDay start_times = 1; + + // 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. + repeated google.type.DayOfWeek days_of_week = 2; + } + + // A time based retention policy specifies that all backups within a certain + // time period should be retained. + message TimeBasedRetention { + // The retention period. + google.protobuf.Duration retention_period = 1; + } + + // A quantity based policy specifies that a certain number of the most recent + // successful backups should be retained. + message QuantityBasedRetention { + // The number of backups to retain. + int32 count = 1; + } + + // The schedule for this automated backup policy. + // + // A schedule specifies times at which to start a backup. If a backup + // window is also provided, the backup is guaranteed to be started and + // completed within the start time plus the backup window. If the backup is + // not completed within the backup window it is marked as failed. + // + // If not set, the schedule defaults to a weekly schedule with one backup + // per day and a start time chosen arbitrarily. + oneof schedule { + // Weekly schedule for the Backup. + WeeklySchedule weekly_schedule = 2; + } + + // The retention policy for automated backups. + // + // The retention policy for a backup is fixed at the time the backup is + // created. Changes to this field only apply to new backups taken with the + // policy; the retentions of existing backups remain unchanged. + // + // If no retention policy is set, a default of 14 days is used. + oneof retention { + // Time-based Backup retention policy. + TimeBasedRetention time_based_retention = 4; + + // Quantity-based Backup retention policy to retain recent backups. + QuantityBasedRetention quantity_based_retention = 5; + } + + // Whether automated automated backups are enabled. If not set, defaults to + // true. + optional bool enabled = 1; + + // 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. + google.protobuf.Duration backup_window = 3; + + // 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. + EncryptionConfig encryption_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string location = 6; + + // Labels to apply to backups created using this configuration. + map labels = 7; +} + +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // 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. + int32 recovery_window_days = 4; + + // 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. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing a BackupSource. +message BackupSource { + // 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. + string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + string backup_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // 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. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// MaintenanceUpdatePolicy defines the policy for system updates. +message MaintenanceUpdatePolicy { + // MaintenanceWindow specifies a preferred day and time for maintenance. + message MaintenanceWindow { + // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + google.type.DayOfWeek day = 1; + + // Preferred time to start the maintenance operation on the specified day. + // Maintenance will start within 1 hour of this time. + google.type.TimeOfDay start_time = 2; + } + + // 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. + message DenyMaintenancePeriod { + // 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 + google.type.Date start_date = 1; + + // 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 + google.type.Date end_date = 2; + + // 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 + google.type.TimeOfDay time = 3; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; + + // Periods to deny maintenance. Currently limited to 1. + repeated DenyMaintenancePeriod deny_maintenance_periods = 2; +} + +// 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. +message MaintenanceSchedule { + // Output only. The scheduled start time for the maintenance. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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. +message Cluster { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + plural: "clusters" + singular: "cluster" + style: DECLARATIVE_FRIENDLY + }; + + // Metadata related to network configuration. + message NetworkConfig { + // 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. + string network = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // 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. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration information for the secondary cluster. This should be set + // if and only if the cluster is of type SECONDARY. + message SecondaryConfig { + // The name of the primary cluster name with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string primary_cluster_name = 1 [(google.api.resource_reference) = { + type: "alloydb.googleapis.com/Cluster" + }]; + } + + // 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. + message PrimaryConfig { + // Output only. Names of the clusters that are replicating from this + // cluster. + repeated string secondary_cluster_names = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Cluster" + } + ]; + } + + // PscConfig contains PSC related configuration at a cluster level. + message PscConfig { + // Optional. Create an instance that allows connections from Private Service + // Connect endpoints to the instance. + bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The project number that needs to be allowlisted on the + // network attachment to enable outbound connectivity. + int64 service_owned_project_number = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Contains information and all metadata related to TRIAL clusters. + message TrialMetadata { + // start time of the trial cluster. + google.protobuf.Timestamp start_time = 1; + + // End time of the trial cluster. + google.protobuf.Timestamp end_time = 2; + + // Upgrade time of trial cluster to Standard cluster. + google.protobuf.Timestamp upgrade_time = 3; + + // grace end time of the cluster. + google.protobuf.Timestamp grace_end_time = 4; + } + + // Configuration for Dataplex integration. + message DataplexConfig { + // Dataplex is enabled by default for resources such as clusters and + // instances. This flag controls the integration of AlloyDB PG + // resources (like databases, schemas, and tables) with Dataplex." + bool enabled = 1; + } + + // Cluster State + enum 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; + } + + // Type of Cluster + enum 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; + } + + // In case of an imported cluster, this field contains information about the + // source this cluster was imported from. + oneof source { + // Output only. Cluster created from backup. + BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created via DMS migration. + MigrationSource migration_source = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created from CloudSQL snapshot. + CloudSQLBackupRunSource cloudsql_backup_run_source = 42 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Cluster. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the cluster. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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` + ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; + + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string network = 10 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 11; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 12; + + // 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. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Initial user to setup during cluster creation. Required. + // If used in `RestoreCluster` this is ignored. + UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // 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. + AutomatedBackupPolicy automated_backup_policy = 17; + + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; + + // 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. + EncryptionConfig encryption_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the cluster. + EncryptionInfo encryption_info = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cross Region replication config specific to SECONDARY cluster. + SecondaryConfig secondary_config = 22; + + // Output only. Cross Region replication config specific to PRIMARY cluster. + PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The configuration for Private Service Connect (PSC) for the + // cluster. + PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maintenance update policy determines when to allow or deny + // updates. + MaintenanceUpdatePolicy maintenance_update_policy = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The maintenance schedule for the cluster, generated for a + // specific rollout if a maintenance window is set. + MaintenanceSchedule maintenance_schedule = 37 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Deprecated and unused. This field will be removed in the near + // future. + GeminiClusterConfig gemini_config = 36 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Subscription type of the cluster. + SubscriptionType subscription_type = 38 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Metadata for free trial clusters + TrialMetadata trial_metadata = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing" + // ``` + map tags = 41 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // 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. + string service_account_email = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for Dataplex integration. + DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; +} + +// An Instance is a computing unit that an end customer can connect to. +// It's the main unit of computing resources in AlloyDB. +message Instance { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" + plural: "instances" + singular: "instance" + style: DECLARATIVE_FRIENDLY + }; + + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + + // 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. + string machine_type = 4; + } + + // 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. + message Node { + // Output only. The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the VM e.g. + // "test-read-0601-407e52be-ms3l". + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The private IP address of the VM e.g. "10.57.0.34". + string ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // QueryInsights Instance specific configuration. + message QueryInsightsInstanceConfig { + // Record application tags for an instance. + // This flag is turned "on" by default. + optional bool record_application_tags = 2; + + // Record client address for an instance. Client address is PII information. + // This flag is turned "on" by default. + optional bool record_client_address = 3; + + // Query string length. The default value is 1024. + // Any integer between 256 and 4500 is considered valid. + uint32 query_string_length = 4; + + // 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. + optional uint32 query_plans_per_minute = 5; + } + + // Observability Instance specific configuration. + message ObservabilityInstanceConfig { + // Observability feature status for an instance. + // This flag is turned "off" by default. + optional bool enabled = 1; + + // Preserve comments in query string for an instance. + // This flag is turned "off" by default. + optional bool preserve_comments = 2; + + // 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. + optional bool track_wait_events = 3; + + // 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. + optional bool track_wait_event_types = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Query string length. The default value is 10k. + optional int32 max_query_string_length = 5; + + // Record application tags for an instance. + // This flag is turned "off" by default. + optional bool record_application_tags = 6; + + // 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. + optional int32 query_plans_per_minute = 7; + + // Track actively running queries on the instance. + // If not set, this flag is "off" by default. + optional bool track_active_queries = 8; + + // Track client address for an instance. + // If not set, default value is "off". + optional bool track_client_address = 9; + + // Whether assistive experiences are enabled for this AlloyDB instance. + optional bool assistive_experiences_enabled = 10; + } + + // Configuration for a read pool instance. + message ReadPoolConfig { + // Read capacity, i.e. number of nodes in a read pool instance. + int32 node_count = 1; + } + + // Policy to be used while updating the instance. + message UpdatePolicy { + // Specifies the available modes of update. + enum 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; + } + + // Mode for updating the instance. + Mode mode = 1; + } + + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL configuration option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for setting up a PSC interface to enable outbound + // connectivity. + message PscInterfaceConfig { + // 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. + string network_attachment_resource = 1; + } + + // Configuration for setting up PSC service automation. Consumer projects in + // the configs will be allowlisted automatically for the instance. + message PscAutoConnectionConfig { + // The consumer project to which the PSC service automation endpoint will + // be created. + string consumer_project = 1; + + // 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. + string consumer_network = 2; + + // Output only. The IP address of the PSC service automation endpoint. + string ip_address = 3 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + string status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string consumer_network_status = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // PscInstanceConfig contains PSC related configuration at an + // instance level. + message PscInstanceConfig { + // 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/` + string service_attachment_link = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Optional. List of consumer projects that are allowed to create + // PSC endpoints to service-attachments to this instance. + repeated string allowed_consumer_projects = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The DNS name of the instance for PSC connectivity. + // Name convention: ...alloydb-psc.goog + string psc_dns_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated PscInterfaceConfig psc_interface_configs = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configurations for setting up PSC service automation. + repeated PscAutoConnectionConfig psc_auto_connections = 9 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Metadata related to instance-level network configuration. + message InstanceNetworkConfig { + // AuthorizedNetwork contains metadata for an authorized network. + message AuthorizedNetwork { + // CIDR range for one authorzied network of the instance. + string cidr_range = 1 [(google.api.field_info).format = IPV4]; + } + + // Optional. A list of external network authorized to access this instance. + repeated AuthorizedNetwork authorized_external_networks = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling public ip for the instance. + bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling an outbound public IP address to support a database + // server sending requests out into the internet. + bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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}`. + string network = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // 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])?. + string allocated_ip_range_override = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for Managed Connection Pool (MCP). + message ConnectionPoolConfig { + // Optional. Whether to enable Managed Connection Pool (MCP). + bool enabled = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Connection Pool flags, as a list of "key": "value" pairs. + map flags = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of running poolers per instance. + int32 pooler_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Instance State + enum 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; + } + + // Type of an Instance + enum 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; + } + + // 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). + enum AvailabilityType { + // This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional (or Highly) available instance. + REGIONAL = 2; + } + + // Specifies whether an instance needs to spin up. + enum ActivationPolicy { + // The policy is not specified. + ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is running. + ALWAYS = 1; + + // The instance is not running. + NEVER = 2; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Instance. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the instance. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the instance. Specified at creation time. + InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for the machines that host the underlying + // database engine. + MachineConfig machine_config = 10; + + // 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). + AvailabilityType availability_type = 11; + + // 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. + string gce_zone = 12; + + // 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. + map database_flags = 13; + + // Output only. This is set for the read-write VM of the PRIMARY instance + // only. + Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of available read-only VMs in this instance, including + // the standby for a PRIMARY instance. + repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for query insights. + QueryInsightsInstanceConfig query_insights_config = 21; + + // Configuration for observability. + ObservabilityInstanceConfig observability_config = 26; + + // Read pool instance configuration. + // This is required if the value of instanceType is READ_POOL. + ReadPoolConfig read_pool_config = 14; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string public_ip_address = 27 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 17; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 18; + + // 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. + UpdatePolicy update_policy = 22; + + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The configuration for Private Service Connect (PSC) for the + // instance. + PscInstanceConfig psc_instance_config = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Instance-level network configuration. + InstanceNetworkConfig network_config = 29 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated and unused. This field will be removed in the near + // future. + GeminiInstanceConfig gemini_config = 33 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Output only. All outbound public IP addresses configured for the instance. + repeated string outbound_public_ip_addresses = 34 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + ActivationPolicy activation_policy = 35 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for Managed Connection Pool (MCP). + ConnectionPoolConfig connection_pool_config = 37 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Configuration parameters related to Gemini Cloud Assist. + GCAInstanceConfig gca_config = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ConnectionInfo singleton resource. +// https://google.aip.dev/156 +message ConnectionInfo { + option (google.api.resource) = { + type: "alloydb.googleapis.com/ConnectionInfo" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" + plural: "connectionInfos" + singular: "connectionInfo" + }; + + // The name of the ConnectionInfo singleton resource, e.g.: + // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + // This field currently has no semantic meaning. + string name = 1; + + // 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. + string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string public_ip_address = 5 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + repeated string pem_certificate_chain = 3 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The unique ID of the Instance. + string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DNS name to use with PSC for the Instance. + string psc_dns_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing Backup object +message Backup { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + plural: "backups" + singular: "backup" + style: DECLARATIVE_FRIENDLY + }; + + // 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) + message QuantityBasedExpiry { + // 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). + int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The length of the quantity-based queue, specified by the + // backup's retention policy. + int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Backup State + enum 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; + } + + // Backup Type + enum 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; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Backup. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the resource finished being created. + google.protobuf.Timestamp create_completion_time = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 6; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backup type, which suggests the trigger for the backup. + Type type = 8; + + // User-provided description of the backup. + string description = 9; + + // Output only. The system-generated UID of the cluster which was used to + // create this resource. + string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full resource name of the backup source cluster + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + string cluster_name = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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. + bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + EncryptionConfig encryption_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 14; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 16; + + // Output only. The size of the backup in bytes. + int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp expiry_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + QuantityBasedExpiry expiry_quantity = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing" + // ``` + map tags = 25 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// 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. +message SupportedDatabaseFlag { + option (google.api.resource) = { + type: "alloydb.googleapis.com/SupportedDatabaseFlag" + pattern: "projects/{project}/locations/{location}/flags/{flag}" + plural: "supportedDatabaseFlags" + singular: "supportedDatabaseFlag" + }; + + // Restrictions on STRING type values + message StringRestrictions { + // The list of allowed values, if bounded. This field will be empty + // if there is a unbounded number of allowed values. + repeated string allowed_values = 1; + } + + // Restrictions on INTEGER type values. + message IntegerRestrictions { + // The minimum value that can be specified, if applicable. + google.protobuf.Int64Value min_value = 1; + + // The maximum value that can be specified, if applicable. + google.protobuf.Int64Value max_value = 2; + } + + // 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". + enum 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; + } + + // The scope of the flag. + enum 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; + } + + // The restrictions on the flag value per type. + oneof restrictions { + // Restriction on STRING type value. + StringRestrictions string_restrictions = 7; + + // Restriction on INTEGER type value. + IntegerRestrictions integer_restrictions = 8; + } + + // The recommended value for the flag by type, if applicable. + oneof recommended_value { + // The recommended value for a STRING flag. + string recommended_string_value = 10; + + // The recommended value for an INTEGER flag. + google.protobuf.Int64Value recommended_integer_value = 11; + } + + // 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. + string name = 1; + + // The name of the database flag, e.g. "max_allowed_packets". + // The is a possibly key for the Instance.database_flags map field. + string flag_name = 2; + + ValueType value_type = 3; + + // Whether the database flag accepts multiple values. If true, + // a comma-separated list of stringified values may be specified. + bool accepts_multiple_values = 4; + + // Major database engine versions for which this flag is supported. + repeated DatabaseVersion supported_db_versions = 5; + + // 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). + bool requires_db_restart = 6; + + // The scope of the flag. + Scope scope = 9; +} + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + plural: "users" + singular: "user" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum 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; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Input only. If the user already exists and it has additional roles, keep + // them granted. + bool keep_extra_roles = 6 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Message describing Database object. +message Database { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Database" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}" + plural: "databases" + singular: "database" + style: DECLARATIVE_FRIENDLY + }; + + // Identifier. Name of the resource in the form of + // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. Immutable. Charset for the database. + // This field can contain any PostgreSQL supported charset name. + // Example values include "UTF8", "SQL_ASCII", etc. + string charset = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. lc_collate for the database. + // String sort order. + // Example values include "C", "POSIX", etc. + string collation = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. lc_ctype for the database. + // Character classification (What is a letter? The upper-case equivalent?). + // Example values include "C", "POSIX", etc. + string character_type = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Whether the database is a template database. + // Deprecated in favor of is_template_database. + bool is_template = 5 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Input only. Immutable. Template of the database to be used for creating a + // new database. + string database_template = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Whether the database is a template database. + optional bool is_template_database = 7 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto new file mode 100644 index 00000000000..a25497c1ec0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto @@ -0,0 +1,2305 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1alpha/data_model.proto"; +import "google/cloud/alloydb/v1alpha/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; +option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.alloydb.v1alpha"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; +option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; + +// Service describing handlers for resources +service AlloyDBAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Exports data from the cluster. + // Imperative only. + rpc ExportCluster(ExportClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:export" + body: "*" + }; + option (google.api.method_signature) = + "name,gcs_destination,database,csv_export_options,sql_export_options"; + option (google.longrunning.operation_info) = { + response_type: "ExportClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Imports data to the cluster. + // Imperative only. + rpc ImportCluster(ImportClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:import" + body: "*" + }; + option (google.api.method_signature) = "name,gcs_uri,database,user"; + option (google.longrunning.operation_info) = { + response_type: "ImportClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Upgrades a single Cluster. + // Imperative only. + rpc UpgradeCluster(UpgradeClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{name=projects/*/locations/*/clusters/*}:upgrade" + body: "*" + }; + option (google.api.method_signature) = "name,version"; + option (google.longrunning.operation_info) = { + response_type: "UpgradeClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc SwitchoverCluster(SwitchoverClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:switchover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc RestoreCluster(RestoreClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc BatchCreateInstances(BatchCreateInstancesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" + body: "requests" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Forces a Failover for a highly available instance. + // Failover promotes the HA standby instance as the new primary. + // Imperative only. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart an Instance in a cluster. + // Imperative only. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Executes a SQL statement in a database inside an AlloyDB instance. + rpc ExecuteSql(ExecuteSqlRequest) returns (ExecuteSqlResponse) { + option (google.api.http) = { + post: "/v1alpha/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql" + body: "*" + }; + option (google.api.method_signature) = + "instance,database,user,sql_statement,password"; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Backup in a given project and location. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1alpha/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists SupportedDatabaseFlags for a given project and location. + rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) + returns (ListSupportedDatabaseFlagsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc GenerateClientCertificate(GenerateClientCertificateRequest) + returns (GenerateClientCertificateResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Get instance metadata used for a connection. + rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Databases in a given project and location. + rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new Database in a given project, location, and cluster. + rpc CreateDatabase(CreateDatabaseRequest) returns (Database) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases" + body: "database" + }; + option (google.api.method_signature) = "parent,database,database_id"; + } +} + +// Message for requesting list of Clusters +message ListClustersRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Clusters +message ListClustersResponse { + // The list of Cluster + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster +message GetClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message CreateSecondaryClusterRequest { + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Cluster +message CreateClusterRequest { + // Required. The location of the new cluster. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster +message UpdateClusterRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Destination for Export. Export will be done to cloud storage. +message GcsDestination { + // 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`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Export cluster request. +message ExportClusterRequest { + // Options for exporting data in CSV format. + message CsvExportOptions { + // Required. The SELECT query used to extract the data. + string select_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string field_delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string quote_character = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string escape_character = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Options for exporting data in SQL format. + message SqlExportOptions { + // Optional. Tables to export from. + repeated string tables = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, only export the schema. + optional bool schema_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, output commands to DROP all the dumped database + // objects prior to outputting the commands for creating them. + optional bool clean_target_objects = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, use DROP ... IF EXISTS commands to check for the + // object's existence before dropping it in clean_target_objects mode. + optional bool if_exist_target_objects = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Oneof field to support other destinations in future. + oneof destination { + // Required. Option to export data to cloud storage. + GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required field to specify export file type and options. + oneof export_options { + // Options for exporting data in CSV format. Required field to be set for + // CSV file type. + CsvExportOptions csv_export_options = 4; + + // Options for exporting data in SQL format. Required field to be set for + // SQL file type. + SqlExportOptions sql_export_options = 5; + } + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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. + string database = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of export cluster rpc. +message ExportClusterResponse { + // Oneof field to support other destinations in future. + oneof destination { + // Required. Option to export data to cloud storage. + GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Import cluster request. +message ImportClusterRequest { + // Options for importing data in SQL format. + message SqlImportOptions {} + + // Options for importing data in CSV format. + message CsvImportOptions { + // Required. The database table to import CSV file into. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The columns to which CSV data is imported. If not specified, + // all columns of the database table are loaded with CSV data. + repeated string columns = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string field_delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string quote_character = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string escape_character = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // oneof field to support various import formats like SQL and CSV. + oneof import_options { + // Options for importing data in SQL format. + SqlImportOptions sql_import_options = 4; + + // Options for importing data in CSV format. + CsvImportOptions csv_import_options = 7; + } + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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`. + string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string database = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string user = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of import rpc. +message ImportClusterResponse { + // Required. Size of the object downloaded from Google Cloud Storage in bytes. + int64 bytes_downloaded = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Upgrades a cluster. +message UpgradeClusterRequest { + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Required. The version the cluster is going to be upgraded to. + DatabaseVersion version = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// UpgradeClusterResponse contains the response for upgrade cluster operation. +message UpgradeClusterResponse { + // Stage information for different stages in the upgrade process. + message StageInfo { + // The stage. + Stage stage = 1; + + // Status of the stage. + Status status = 2; + + // 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. + string logs_url = 3; + } + + // Details regarding the upgrade of instances associated with a cluster. + message InstanceUpgradeDetails { + // Normalized name of the instance. + string name = 1; + + // Upgrade status of the instance. + Status upgrade_status = 2; + + // Instance type. + Instance.InstanceType instance_type = 3; + } + + // Upgrade details of a cluster. This cluster can be primary or secondary. + message ClusterUpgradeDetails { + // Normalized name of the cluster + string name = 1; + + // Upgrade status of the cluster. + Status upgrade_status = 2; + + // Cluster type which can either be primary or secondary. + Cluster.ClusterType cluster_type = 3; + + // 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. + DatabaseVersion database_version = 4; + + // Array containing stage info associated with this cluster. + repeated StageInfo stage_info = 5; + + // Upgrade details of the instances directly associated with this cluster. + repeated InstanceUpgradeDetails instance_upgrade_details = 6; + } + + // Status of upgrade operation. + enum 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; + } + + // Stage in the upgrade. + enum 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; + } + + // Status of upgrade operation. + Status status = 1; + + // A user friendly message summarising the upgrade operation details and the + // next steps for the user if there is any. + string message = 2; + + // Array of upgrade details for the current cluster and all the secondary + // clusters associated with this cluster. + repeated ClusterUpgradeDetails cluster_upgrade_details = 3; +} + +// Message for deleting a Cluster +message DeleteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to cascade delete child instances for given cluster. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for switching over to a cluster +message SwitchoverClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for restoring a Cluster from a backup or another cluster at a given +// point in time. +// NEXT_ID: 11 +message RestoreClusterRequest { + // Required. + // The source to import from. + oneof source { + // Backup source. + BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; + } + + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances +message ListInstancesRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Instances +message ListInstancesResponse { + // The list of Instance + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance +message GetInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // The view of the instance to return. + InstanceView view = 2; +} + +// Message for creating a Instance +message CreateInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// See usage below for notes. +message CreateInstanceRequests { + // Required. Primary and read replica instances to be created. This list + // should not be empty. + repeated CreateInstanceRequest create_instance_requests = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating a batch of instances under the specified cluster. +message BatchCreateInstancesRequest { + // Required. The name of the parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. Resources being created. + CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating batches of instances in a cluster. +message BatchCreateInstancesResponse { + // Created instances. + repeated Instance instances = 1; +} + +// Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 +message BatchCreateInstancesMetadata { + // 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. + repeated string instance_targets = 1; + + // 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. + map instance_statuses = 2; +} + +// 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. +message BatchCreateInstanceStatus { + // State contains all valid instance states for the BatchCreateInstances + // operation. This is mainly used for status reporting through the LRO + // metadata. + enum 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; + } + + // 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. + State state = 1; + + // DEPRECATED - Use the error field instead. + // Error, if any error occurred and is available, during instance creation. + string error_msg = 2; + + // The RPC status of the instance creation operation. This field will be + // present if an error happened during the instance creation. + google.rpc.Status error = 4; + + Instance.InstanceType type = 3; +} + +// Message for updating a Instance +message UpdateInstanceRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Instance +message DeleteInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering failover on an Instance +message FailoverInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +message RestartInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + // restart upon. Applicable only to read instances. + repeated string node_ids = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for ExecuteSql rpc. +message ExecuteSqlRequest { + // Oneof field to support other credential mechanisms in future like + // SecretManager etc. + oneof user_credential { + // Optional. The database native user’s password. + string password = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The instance where the SQL will be executed. For the required + // format, see the comment on the Instance.name field. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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. + string database = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. SQL statement to execute on database. Any valid statement is + // permitted, including DDL, DML, DQL statements. + string sql_statement = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validates the sql statement by performing + // syntax and semantic validation and doesn't execute the query. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execute a SQL statement response. +message ExecuteSqlResponse { + // SqlResult represents the results for the execution of sql statements. + repeated SqlResult sql_results = 1; + + // Any additional metadata information regarding the execution of the sql + // statement. + ExecuteSqlMetadata metadata = 3; +} + +// Any additional metadata information regarding the execution of the SQL +message ExecuteSqlMetadata { + // Status contains all valid Status a SQL execution can end up in. + enum 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; + } + + // 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." + string message = 1; + + // Set to true if SQL returned a result set larger than the acceptable + // response size limits and the result was truncated. + bool partial_result = 2; + + // The time duration taken to execute the sql statement. + google.protobuf.Duration sql_statement_execution_duration = 3; + + // Status of SQL execution. + Status status = 4; +} + +// Message for requesting list of Backups +message ListBackupsRequest { + // Required. Parent value for ListBackupsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Backups +message ListBackupsResponse { + // The list of Backup + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Backup +message GetBackupRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message for creating a Backup +message CreateBackupRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Required. ID of the requesting object. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Backup +message UpdateBackupRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Backup +message DeleteBackupRequest { + // Required. Name of the resource. For the required format, see the comment on + // the Backup.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for listing the information about the supported Database flags. +message ListSupportedDatabaseFlagsRequest { + // 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. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. The scope for which supported flags are requested. If not + // specified, default is DATABASE. + SupportedDatabaseFlag.Scope scope = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing SupportedDatabaseFlags. +message ListSupportedDatabaseFlagsResponse { + // The list of SupportedDatabaseFlags. + repeated SupportedDatabaseFlag supported_database_flags = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for requests to generate a client certificate signed by the Cluster +// CA. +message GenerateClientCertificateRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location}/clusters/{cluster} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pem-encoded X.509 certificate signing request (CSR). It is + // recommended to use public_key instead. + string pem_csr = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // 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. + google.protobuf.Duration cert_duration = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message returned by a GenerateClientCertificate operation. +message GenerateClientCertificateResponse { + // Output only. The pem-encoded, signed X.509 certificate. + string pem_certificate = 1 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated string pem_certificate_chain = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetConnectionInfo. +message GetConnectionInfoRequest { + // Required. The name of the parent resource. The required format is: + // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Request specific metadata, if any. + oneof request_specific { + // Output only. BatchCreateInstances related metadata. + BatchCreateInstancesMetadata batch_create_instances_metadata = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. PromoteClusterStatus related metadata. + PromoteClusterStatus promote_cluster_status = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. UpgradeClusterStatus related metadata. + UpgradeClusterStatus upgrade_cluster_status = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for current status of the database during Promote Cluster operation. +message PromoteClusterStatus { + // State contains all valid states of the database during promote cluster + // operation. This is used for status reporting through the LRO metadata. + enum 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; + } + + // 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 + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for current status of the Major Version Upgrade operation. +message UpgradeClusterStatus { + // Status of an upgrade stage. + message StageStatus { + // Timing information for the stage execution. + message StageSchedule { + // When the stage is expected to start. Set only if the stage has not + // started yet. + google.protobuf.Timestamp estimated_start_time = 1; + + // Actual start time of the stage. Set only if the stage has started. + google.protobuf.Timestamp actual_start_time = 2; + + // When the stage is expected to end. Set only if the stage has not + // completed yet. + google.protobuf.Timestamp estimated_end_time = 3; + + // Actual end time of the stage. Set only if the stage has completed. + google.protobuf.Timestamp actual_end_time = 4; + } + + // Stage specific status information, if any. + oneof stage_specific_status { + // Read pool instances upgrade metadata. + ReadPoolInstancesUpgradeStageStatus read_pool_instances_upgrade = 11; + } + + // Upgrade stage. + UpgradeClusterResponse.Stage stage = 1; + + // State of this stage. + UpgradeClusterResponse.Status state = 2; + + // Output only. Timing information for the stage execution. + StageSchedule schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Read pool instances upgrade specific status. + message ReadPoolInstancesUpgradeStageStatus { + // Upgrade stats for read pool instances. + message Stats { + // Number of read pool instances for which upgrade has not started. + int32 not_started = 1; + + // Number of read pool instances undergoing upgrade. + int32 ongoing = 2; + + // Number of read pool instances successfully upgraded. + int32 success = 3; + + // Number of read pool instances which failed to upgrade. + int32 failed = 4; + } + + // Read pool instances upgrade statistics. + Stats upgrade_stats = 1; + } + + // Cluster Major Version Upgrade state. + UpgradeClusterResponse.Status state = 1; + + // Whether the operation is cancellable. + bool cancellable = 2; + + // Source database major version. + DatabaseVersion source_version = 3; + + // Target database major version. + DatabaseVersion target_version = 4; + + // Status of all upgrade stages. + repeated StageStatus stages = 5; +} + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for ListDatabases request. +message ListDatabasesRequest { + // Required. Parent value for ListDatabasesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Database" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + // This field is currently not supported, its value will be ignored if passed. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for ListDatabases response. +message ListDatabasesResponse { + // The list of databases. + repeated Database databases = 1; + + // A token identifying the next page of results the server should return. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message for CreateDatabase request. +message CreateDatabaseRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Database" + } + ]; + + // Required. ID of the requesting object. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Database database = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto new file mode 100644 index 00000000000..220a3f97801 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto @@ -0,0 +1,40 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1beta; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "CsqlResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDB::V1beta"; + +// The source CloudSQL backup resource. +message CloudSQLBackupRunSource { + // The project ID of the source CloudSQL instance. This should be the same as + // the AlloyDB cluster's project. + string project = 1; + + // Required. The CloudSQL instance ID. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The CloudSQL backup run ID. + int64 backup_run_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto new file mode 100644 index 00000000000..d107bcf6180 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1beta/csql_resources.proto"; +import "google/cloud/alloydb/v1beta/resources.proto"; +import "google/cloud/alloydb/v1beta/service.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "CSQLServiceProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDB::V1beta"; + +// Service for interactions with CloudSQL. +service AlloyDBCSQLAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Restores an AlloyDB cluster from a CloudSQL resource. + rpc RestoreFromCloudSQL(RestoreFromCloudSQLRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL" + body: "*" + }; + option (google.api.method_signature) = "parent,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for registering Restoring from CloudSQL resource. +message RestoreFromCloudSQLRequest { + // The source CloudSQL resource to restore from. + oneof source { + // Cluster created from CloudSQL backup run. + CloudSQLBackupRunSource cloudsql_backup_run_source = 101; + } + + // Required. The location of the new cluster. For the required format, see the + // comment on Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto new file mode 100644 index 00000000000..fbbe75a363a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1beta; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "DataModelProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDB::V1beta"; + +// SqlResult represents the result for the execution of a sql statement. +message SqlResult { + // List of columns included in the result. This also includes the data type + // of the column. + repeated SqlResultColumn columns = 1; + + // Rows returned by the SQL statement. + repeated SqlResultRow rows = 2; +} + +// Contains the name and datatype of a column in a SQL Result. +message SqlResultColumn { + // Name of the column. + string name = 1; + + // Datatype of the column as reported by the postgres driver. + // Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + // "INT", and "BIGINT". + string type = 2; +} + +// A single row from a sql result. +message SqlResultRow { + // List of values in a row of sql result. + repeated SqlResultValue values = 1; +} + +// A single value in a row from a sql result. +message SqlResultValue { + // The cell value represented in string format. + // Timestamps are converted to string using RFC3339Nano format. + optional string value = 1; + + // Set to true if cell value is null. + optional bool null_value = 2; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto new file mode 100644 index 00000000000..0e0c32dd2cf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto @@ -0,0 +1,60 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1beta; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "GeminiProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDB::V1beta"; + +// Enum representing the type of GCA entitlement assigned to a resource. +enum GCAEntitlementType { + // No GCA entitlement is assigned. + GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0; + + // The resource is entitled to the GCA Standard Tier. + GCA_STANDARD = 1; +} + +// Deprecated and unused. This message will be removed in the near future. +message GeminiClusterConfig { + // Output only. Deprecated and unused. This field will be removed in the near + // future. + bool entitled = 1 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Deprecated and unused. This message will be removed in the near future. +message GeminiInstanceConfig { + // Output only. Deprecated and unused. This field will be removed in the near + // future. + bool entitled = 1 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Instance level configuration parameters related to the Gemini Cloud Assist +// product. +message GCAInstanceConfig { + // Output only. Represents the GCA entitlement state of the instance. + GCAEntitlementType gca_entitlement = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto new file mode 100644 index 00000000000..7b3ef0259b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto @@ -0,0 +1,1786 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1beta/csql_resources.proto"; +import "google/cloud/alloydb/v1beta/gemini.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/date.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDB::V1beta"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ServiceAttachment" + pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" +}; + +// View on Instance. Pass this enum to rpcs that returns an Instance message to +// control which subsets of fields to get. +enum 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; +} + +// View on Cluster. Pass this enum to rpcs that returns a cluster message to +// control which subsets of fields to get. +enum 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; +} + +// The supported database engine versions. +enum DatabaseVersion { + // This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0; + + // DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 [deprecated = true]; + + // 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; +} + +// Subscription_type added to distinguish between Standard and Trial +// subscriptions. By default, a subscription type is considered STANDARD unless +// explicitly specified. +enum 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; +} + +// The username/password for a database user. Used for specifying initial +// users at cluster creation time. +message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; +} + +// Subset of the source instance configuration that is available when reading +// the cluster resource. +message MigrationSource { + // Denote the type of migration source that created this cluster. + enum MigrationSourceType { + // Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; + + // DMS source means the cluster was created via DMS migration job. + DMS = 1; + } + + // Output only. The host and port of the on-premises instance in host:port + // format + string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Place holder for the external source identifier(e.g DMS job + // name) that created the cluster. + string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of migration source. + MigrationSourceType source_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// EncryptionConfig describes the encryption config of a cluster or a backup +// that is encrypted with a CMEK (customer-managed encryption key). +message EncryptionConfig { + // 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] + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; +} + +// EncryptionInfo describes the encryption information of a cluster or a backup. +message EncryptionInfo { + // Possible encryption types. + enum 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; + } + + // Output only. Type of encryption. + Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud KMS key versions that are being used to protect the + // database or the backup. + repeated string kms_key_versions = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// SSL configuration. +message SslConfig { + // SSL mode options. + enum 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 [deprecated = true]; + + // SSL connections are required. CA verification not enforced. + // Clients may use locally self-signed certificates (default psql client + // behavior). + SSL_MODE_REQUIRE = 2 [deprecated = true]; + + // 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 [deprecated = true]; + + // SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; + + // SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5; + } + + // Certificate Authority (CA) source for SSL/TLS certificates. + enum 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; + } + + // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + // supported currently, and is the default value. + CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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. +message AutomatedBackupPolicy { + // 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. + message WeeklySchedule { + // 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. + repeated google.type.TimeOfDay start_times = 1; + + // 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. + repeated google.type.DayOfWeek days_of_week = 2; + } + + // A time based retention policy specifies that all backups within a certain + // time period should be retained. + message TimeBasedRetention { + // The retention period. + google.protobuf.Duration retention_period = 1; + } + + // A quantity based policy specifies that a certain number of the most recent + // successful backups should be retained. + message QuantityBasedRetention { + // The number of backups to retain. + int32 count = 1; + } + + // The schedule for this automated backup policy. + // + // A schedule specifies times at which to start a backup. If a backup + // window is also provided, the backup is guaranteed to be started and + // completed within the start time plus the backup window. If the backup is + // not completed within the backup window it is marked as failed. + // + // If not set, the schedule defaults to a weekly schedule with one backup + // per day and a start time chosen arbitrarily. + oneof schedule { + // Weekly schedule for the Backup. + WeeklySchedule weekly_schedule = 2; + } + + // The retention policy for automated backups. + // + // The retention policy for a backup is fixed at the time the backup is + // created. Changes to this field only apply to new backups taken with the + // policy; the retentions of existing backups remain unchanged. + // + // If no retention policy is set, a default of 14 days is used. + oneof retention { + // Time-based Backup retention policy. + TimeBasedRetention time_based_retention = 4; + + // Quantity-based Backup retention policy to retain recent backups. + QuantityBasedRetention quantity_based_retention = 5; + } + + // Whether automated automated backups are enabled. If not set, defaults to + // true. + optional bool enabled = 1; + + // 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. + google.protobuf.Duration backup_window = 3; + + // 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. + EncryptionConfig encryption_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string location = 6; + + // Labels to apply to backups created using this configuration. + map labels = 7; +} + +// ContinuousBackupConfig describes the continuous backups recovery +// configurations of a cluster. +message ContinuousBackupConfig { + // Whether ContinuousBackup is enabled. + optional bool enabled = 1; + + // 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. + int32 recovery_window_days = 4; + + // 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. + EncryptionConfig encryption_config = 3; +} + +// ContinuousBackupInfo describes the continuous backup properties of a +// cluster. +message ContinuousBackupInfo { + // Output only. The encryption information for the WALs and backups required + // for ContinuousBackup. + EncryptionInfo encryption_info = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When ContinuousBackup was most recently enabled. Set to null + // if ContinuousBackup is not enabled. + google.protobuf.Timestamp enabled_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Days of the week on which a continuous backup is taken. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp earliest_restorable_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing a BackupSource. +message BackupSource { + // 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. + string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the backup resource with the format: + // * projects/{project}/locations/{region}/backups/{backup_id} + string backup_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message describing a ContinuousBackupSource. +message ContinuousBackupSource { + // 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. + string cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The point in time to restore to. + google.protobuf.Timestamp point_in_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// MaintenanceUpdatePolicy defines the policy for system updates. +message MaintenanceUpdatePolicy { + // MaintenanceWindow specifies a preferred day and time for maintenance. + message MaintenanceWindow { + // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + google.type.DayOfWeek day = 1; + + // Preferred time to start the maintenance operation on the specified day. + // Maintenance will start within 1 hour of this time. + google.type.TimeOfDay start_time = 2; + } + + // 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. + message DenyMaintenancePeriod { + // 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 + google.type.Date start_date = 1; + + // 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 + google.type.Date end_date = 2; + + // 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 + google.type.TimeOfDay time = 3; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; + + // Periods to deny maintenance. Currently limited to 1. + repeated DenyMaintenancePeriod deny_maintenance_periods = 2; +} + +// 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. +message MaintenanceSchedule { + // Output only. The scheduled start time for the maintenance. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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. +message Cluster { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + plural: "clusters" + singular: "cluster" + style: DECLARATIVE_FRIENDLY + }; + + // Metadata related to network configuration. + message NetworkConfig { + // 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. + string network = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // 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. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration information for the secondary cluster. This should be set + // if and only if the cluster is of type SECONDARY. + message SecondaryConfig { + // The name of the primary cluster name with the format: + // * projects/{project}/locations/{region}/clusters/{cluster_id} + string primary_cluster_name = 1 [(google.api.resource_reference) = { + type: "alloydb.googleapis.com/Cluster" + }]; + } + + // 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. + message PrimaryConfig { + // Output only. Names of the clusters that are replicating from this + // cluster. + repeated string secondary_cluster_names = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Cluster" + } + ]; + } + + // PscConfig contains PSC related configuration at a cluster level. + message PscConfig { + // Optional. Create an instance that allows connections from Private Service + // Connect endpoints to the instance. + bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The project number that needs to be allowlisted on the + // network attachment to enable outbound connectivity. + int64 service_owned_project_number = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Contains information and all metadata related to TRIAL clusters. + message TrialMetadata { + // start time of the trial cluster. + google.protobuf.Timestamp start_time = 1; + + // End time of the trial cluster. + google.protobuf.Timestamp end_time = 2; + + // Upgrade time of trial cluster to Standard cluster. + google.protobuf.Timestamp upgrade_time = 3; + + // grace end time of the cluster. + google.protobuf.Timestamp grace_end_time = 4; + } + + // Configuration for Dataplex integration. + message DataplexConfig { + // Dataplex is enabled by default for resources such as clusters and + // instances. This flag controls the integration of AlloyDB PG + // resources (like databases, schemas, and tables) with Dataplex." + bool enabled = 1; + } + + // Cluster State + enum 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; + } + + // Type of Cluster + enum 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; + } + + // In case of an imported cluster, this field contains information about the + // source this cluster was imported from. + oneof source { + // Output only. Cluster created from backup. + BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created via DMS migration. + MigrationSource migration_source = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster created from CloudSQL snapshot. + CloudSQLBackupRunSource cloudsql_backup_run_source = 42 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Cluster. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the cluster. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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` + ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; + + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string network = 10 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 11; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 12; + + // 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. + bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Initial user to setup during cluster creation. Required. + // If used in `RestoreCluster` this is ignored. + UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // 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. + AutomatedBackupPolicy automated_backup_policy = 17; + + // SSL configuration for this AlloyDB cluster. + SslConfig ssl_config = 18 [deprecated = true]; + + // 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. + EncryptionConfig encryption_config = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the cluster. + EncryptionInfo encryption_info = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Continuous backup configuration for this cluster. + ContinuousBackupConfig continuous_backup_config = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Continuous backup properties for this cluster. + ContinuousBackupInfo continuous_backup_info = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cross Region replication config specific to SECONDARY cluster. + SecondaryConfig secondary_config = 22; + + // Output only. Cross Region replication config specific to PRIMARY cluster. + PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The configuration for Private Service Connect (PSC) for the + // cluster. + PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maintenance update policy determines when to allow or deny + // updates. + MaintenanceUpdatePolicy maintenance_update_policy = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The maintenance schedule for the cluster, generated for a + // specific rollout if a maintenance window is set. + MaintenanceSchedule maintenance_schedule = 37 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Deprecated and unused. This field will be removed in the near + // future. + GeminiClusterConfig gemini_config = 36 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Subscription type of the cluster. + SubscriptionType subscription_type = 38 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Metadata for free trial clusters + TrialMetadata trial_metadata = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing" + // ``` + map tags = 41 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // 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. + string service_account_email = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for Dataplex integration. + DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; +} + +// An Instance is a computing unit that an end customer can connect to. +// It's the main unit of computing resources in AlloyDB. +message Instance { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" + plural: "instances" + singular: "instance" + style: DECLARATIVE_FRIENDLY + }; + + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + + // 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. + string machine_type = 4; + } + + // 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. + message Node { + // Output only. The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the VM e.g. + // "test-read-0601-407e52be-ms3l". + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The private IP address of the VM e.g. "10.57.0.34". + string ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // QueryInsights Instance specific configuration. + message QueryInsightsInstanceConfig { + // Record application tags for an instance. + // This flag is turned "on" by default. + optional bool record_application_tags = 2; + + // Record client address for an instance. Client address is PII information. + // This flag is turned "on" by default. + optional bool record_client_address = 3; + + // Query string length. The default value is 1024. + // Any integer between 256 and 4500 is considered valid. + uint32 query_string_length = 4; + + // 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. + optional uint32 query_plans_per_minute = 5; + } + + // Observability Instance specific configuration. + message ObservabilityInstanceConfig { + // Observability feature status for an instance. + // This flag is turned "off" by default. + optional bool enabled = 1; + + // Preserve comments in query string for an instance. + // This flag is turned "off" by default. + optional bool preserve_comments = 2; + + // 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. + optional bool track_wait_events = 3; + + // 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. + optional bool track_wait_event_types = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Query string length. The default value is 10k. + optional int32 max_query_string_length = 5; + + // Record application tags for an instance. + // This flag is turned "off" by default. + optional bool record_application_tags = 6; + + // 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. + optional int32 query_plans_per_minute = 7; + + // Track actively running queries on the instance. + // If not set, this flag is "off" by default. + optional bool track_active_queries = 8; + + // Track client address for an instance. + // If not set, default value is "off". + optional bool track_client_address = 9; + + // Whether assistive experiences are enabled for this AlloyDB instance. + optional bool assistive_experiences_enabled = 10; + } + + // Configuration for a read pool instance. + message ReadPoolConfig { + // Read capacity, i.e. number of nodes in a read pool instance. + int32 node_count = 1; + } + + // Policy to be used while updating the instance. + message UpdatePolicy { + // Specifies the available modes of update. + enum 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; + } + + // Mode for updating the instance. + Mode mode = 1; + } + + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL configuration option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for setting up a PSC interface to enable outbound + // connectivity. + message PscInterfaceConfig { + // 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. + string network_attachment_resource = 1; + } + + // Configuration for setting up PSC service automation. Consumer projects in + // the configs will be allowlisted automatically for the instance. + message PscAutoConnectionConfig { + // The consumer project to which the PSC service automation endpoint will + // be created. + string consumer_project = 1; + + // 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. + string consumer_network = 2; + + // Output only. The IP address of the PSC service automation endpoint. + string ip_address = 3 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + string status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string consumer_network_status = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // PscInstanceConfig contains PSC related configuration at an + // instance level. + message PscInstanceConfig { + // 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/` + string service_attachment_link = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Optional. List of consumer projects that are allowed to create + // PSC endpoints to service-attachments to this instance. + repeated string allowed_consumer_projects = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The DNS name of the instance for PSC connectivity. + // Name convention: ...alloydb-psc.goog + string psc_dns_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated PscInterfaceConfig psc_interface_configs = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configurations for setting up PSC service automation. + repeated PscAutoConnectionConfig psc_auto_connections = 9 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Metadata related to instance-level network configuration. + message InstanceNetworkConfig { + // AuthorizedNetwork contains metadata for an authorized network. + message AuthorizedNetwork { + // CIDR range for one authorzied network of the instance. + string cidr_range = 1 [(google.api.field_info).format = IPV4]; + } + + // Optional. A list of external network authorized to access this instance. + repeated AuthorizedNetwork authorized_external_networks = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling public ip for the instance. + bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enabling an outbound public IP address to support a database + // server sending requests out into the internet. + bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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}`. + string network = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // 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])?. + string allocated_ip_range_override = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for Managed Connection Pool (MCP). + message ConnectionPoolConfig { + // Optional. Whether to enable Managed Connection Pool (MCP). + bool enabled = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Connection Pool flags, as a list of "key": "value" pairs. + map flags = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of running poolers per instance. + int32 pooler_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Instance State + enum 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; + } + + // Type of an Instance + enum 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; + } + + // 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). + enum AvailabilityType { + // This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal available instance. + ZONAL = 1; + + // Regional (or Highly) available instance. + REGIONAL = 2; + } + + // Specifies whether an instance needs to spin up. + enum ActivationPolicy { + // The policy is not specified. + ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is running. + ALWAYS = 1; + + // The instance is not running. + NEVER = 2; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Instance. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 7; + + // Output only. The current serving state of the instance. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The type of the instance. Specified at creation time. + InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for the machines that host the underlying + // database engine. + MachineConfig machine_config = 10; + + // 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). + AvailabilityType availability_type = 11; + + // 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. + string gce_zone = 12; + + // 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. + map database_flags = 13; + + // Output only. This is set for the read-write VM of the PRIMARY instance + // only. + Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of available read-only VMs in this instance, including + // the standby for a PRIMARY instance. + repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for query insights. + QueryInsightsInstanceConfig query_insights_config = 21; + + // Configuration for observability. + ObservabilityInstanceConfig observability_config = 26; + + // Read pool instance configuration. + // This is required if the value of instanceType is READ_POOL. + ReadPoolConfig read_pool_config = 14; + + // Output only. The IP address for the Instance. + // This is the connection endpoint for an end-user application. + string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string public_ip_address = 27 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 17; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 18; + + // 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. + UpdatePolicy update_policy = 22; + + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The configuration for Private Service Connect (PSC) for the + // instance. + PscInstanceConfig psc_instance_config = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Instance-level network configuration. + InstanceNetworkConfig network_config = 29 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated and unused. This field will be removed in the near + // future. + GeminiInstanceConfig gemini_config = 33 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Output only. All outbound public IP addresses configured for the instance. + repeated string outbound_public_ip_addresses = 34 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + ActivationPolicy activation_policy = 35 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for Managed Connection Pool (MCP). + ConnectionPoolConfig connection_pool_config = 37 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Configuration parameters related to Gemini Cloud Assist. + GCAInstanceConfig gca_config = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ConnectionInfo singleton resource. +// https://google.aip.dev/156 +message ConnectionInfo { + option (google.api.resource) = { + type: "alloydb.googleapis.com/ConnectionInfo" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" + plural: "connectionInfos" + singular: "connectionInfo" + }; + + // The name of the ConnectionInfo singleton resource, e.g.: + // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo + // This field currently has no semantic meaning. + string name = 1; + + // 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. + string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string public_ip_address = 5 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // 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. + repeated string pem_certificate_chain = 3 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The unique ID of the Instance. + string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DNS name to use with PSC for the Instance. + string psc_dns_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing Backup object +message Backup { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + plural: "backups" + singular: "backup" + style: DECLARATIVE_FRIENDLY + }; + + // 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) + message QuantityBasedExpiry { + // 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). + int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The length of the quantity-based queue, specified by the + // backup's retention policy. + int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Backup State + enum 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; + } + + // Backup Type + enum 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; + } + + // 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} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-settable and human-readable display name for the Backup. + string display_name = 2; + + // 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. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Delete time stamp + google.protobuf.Timestamp delete_time = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the resource finished being created. + google.protobuf.Timestamp create_completion_time = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs + map labels = 6; + + // Output only. The current state of the backup. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backup type, which suggests the trigger for the backup. + Type type = 8; + + // User-provided description of the backup. + string description = 9; + + // Output only. The system-generated UID of the cluster which was used to + // create this resource. + string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full resource name of the backup source cluster + // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). + string cluster_name = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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. + bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + EncryptionConfig encryption_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // For Resource freshness validation (https://google.aip.dev/154) + string etag = 14; + + // Annotations to allow client tools to store small amount of arbitrary data. + // This is distinct from labels. + // https://google.aip.dev/128 + map annotations = 16; + + // Output only. The size of the backup in bytes. + int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.Timestamp expiry_time = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + QuantityBasedExpiry expiry_quantity = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Input only. Immutable. Tag keys/values directly bound to this + // resource. For example: + // ``` + // "123/environment": "production", + // "123/costCenter": "marketing" + // ``` + map tags = 25 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// 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. +message SupportedDatabaseFlag { + option (google.api.resource) = { + type: "alloydb.googleapis.com/SupportedDatabaseFlag" + pattern: "projects/{project}/locations/{location}/flags/{flag}" + plural: "supportedDatabaseFlags" + singular: "supportedDatabaseFlag" + }; + + // Restrictions on STRING type values + message StringRestrictions { + // The list of allowed values, if bounded. This field will be empty + // if there is a unbounded number of allowed values. + repeated string allowed_values = 1; + } + + // Restrictions on INTEGER type values. + message IntegerRestrictions { + // The minimum value that can be specified, if applicable. + google.protobuf.Int64Value min_value = 1; + + // The maximum value that can be specified, if applicable. + google.protobuf.Int64Value max_value = 2; + } + + // 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". + enum 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; + } + + // The scope of the flag. + enum 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; + } + + // The restrictions on the flag value per type. + oneof restrictions { + // Restriction on STRING type value. + StringRestrictions string_restrictions = 7; + + // Restriction on INTEGER type value. + IntegerRestrictions integer_restrictions = 8; + } + + // The recommended value for the flag by type, if applicable. + oneof recommended_value { + // The recommended value for a STRING flag. + string recommended_string_value = 10; + + // The recommended value for an INTEGER flag. + google.protobuf.Int64Value recommended_integer_value = 11; + } + + // 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. + string name = 1; + + // The name of the database flag, e.g. "max_allowed_packets". + // The is a possibly key for the Instance.database_flags map field. + string flag_name = 2; + + ValueType value_type = 3; + + // Whether the database flag accepts multiple values. If true, + // a comma-separated list of stringified values may be specified. + bool accepts_multiple_values = 4; + + // Major database engine versions for which this flag is supported. + repeated DatabaseVersion supported_db_versions = 5; + + // 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). + bool requires_db_restart = 6; + + // The scope of the flag. + Scope scope = 9; +} + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" + plural: "users" + singular: "user" + style: DECLARATIVE_FRIENDLY + }; + + // Enum that details the user type. + enum 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; + } + + // Output only. Name of the resource in the form of + // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. Password for the user. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. List of database roles this user has. + // The database role strings are subject to the PostgreSQL naming conventions. + repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of this user. + UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Input only. If the user already exists and it has additional roles, keep + // them granted. + bool keep_extra_roles = 6 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Message describing Database object. +message Database { + option (google.api.resource) = { + type: "alloydb.googleapis.com/Database" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}" + plural: "databases" + singular: "database" + style: DECLARATIVE_FRIENDLY + }; + + // Identifier. Name of the resource in the form of + // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. Immutable. Charset for the database. + // This field can contain any PostgreSQL supported charset name. + // Example values include "UTF8", "SQL_ASCII", etc. + string charset = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. lc_collate for the database. + // String sort order. + // Example values include "C", "POSIX", etc. + string collation = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. lc_ctype for the database. + // Character classification (What is a letter? The upper-case equivalent?). + // Example values include "C", "POSIX", etc. + string character_type = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Whether the database is a template database. + // Deprecated in favor of is_template_database. + bool is_template = 5 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Input only. Immutable. Template of the database to be used for creating a + // new database. + string database_template = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Whether the database is a template database. + optional bool is_template_database = 7 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto new file mode 100644 index 00000000000..83dce61eb98 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto @@ -0,0 +1,2305 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.alloydb.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/alloydb/v1beta/data_model.proto"; +import "google/cloud/alloydb/v1beta/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; +option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.alloydb.v1beta"; +option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; +option ruby_package = "Google::Cloud::AlloyDB::V1beta"; + +// Service describing handlers for resources +service AlloyDBAdmin { + option (google.api.default_host) = "alloydb.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Exports data from the cluster. + // Imperative only. + rpc ExportCluster(ExportClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*}:export" + body: "*" + }; + option (google.api.method_signature) = + "name,gcs_destination,database,csv_export_options,sql_export_options"; + option (google.longrunning.operation_info) = { + response_type: "ExportClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Imports data to the cluster. + // Imperative only. + rpc ImportCluster(ImportClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*}:import" + body: "*" + }; + option (google.api.method_signature) = "name,gcs_uri,database,user"; + option (google.longrunning.operation_info) = { + response_type: "ImportClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Upgrades a single Cluster. + // Imperative only. + rpc UpgradeCluster(UpgradeClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade" + body: "*" + }; + option (google.api.method_signature) = "name,version"; + option (google.longrunning.operation_info) = { + response_type: "UpgradeClusterResponse" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Promotes a SECONDARY cluster. This turns down replication + // from the PRIMARY cluster and promotes a secondary cluster + // into its own standalone cluster. + // Imperative only. + rpc PromoteCluster(PromoteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*}:promote" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc SwitchoverCluster(SwitchoverClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*}:switchover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc RestoreCluster(RestoreClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Creates a cluster of type SECONDARY in the given location using + // the primary cluster as the source. + rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new SECONDARY Instance in a given project and location. + rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // 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. + rpc BatchCreateInstances(BatchCreateInstancesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" + body: "requests" + }; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateInstancesResponse" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Forces a Failover for a highly available instance. + // Failover promotes the HA standby instance as the new primary. + // Imperative only. + rpc FailoverInstance(FailoverInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Injects fault in an instance. + // Imperative only. + rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" + body: "*" + }; + option (google.api.method_signature) = "fault_type,name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart an Instance in a cluster. + // Imperative only. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Executes a SQL statement in a database inside an AlloyDB instance. + rpc ExecuteSql(ExecuteSqlRequest) returns (ExecuteSqlResponse) { + option (google.api.http) = { + post: "/v1beta/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql" + body: "*" + }; + option (google.api.method_signature) = + "instance,database,user,sql_statement,password"; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Backup in a given project and location. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists SupportedDatabaseFlags for a given project and location. + rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) + returns (ListSupportedDatabaseFlagsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc GenerateClientCertificate(GenerateClientCertificateRequest) + returns (GenerateClientCertificateResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Get instance metadata used for a connection. + rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Users in a given project and location. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single User. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new User in a given project, location, and cluster. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user,user_id"; + } + + // Updates the parameters of a single User. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Deletes a single User. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Databases in a given project and location. + rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new Database in a given project, location, and cluster. + rpc CreateDatabase(CreateDatabaseRequest) returns (Database) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases" + body: "database" + }; + option (google.api.method_signature) = "parent,database,database_id"; + } +} + +// Message for requesting list of Clusters +message ListClustersRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Clusters +message ListClustersResponse { + // The list of Cluster + repeated Cluster clusters = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Cluster +message GetClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Optional. The view of the cluster to return. Returns all default fields if + // not set. + ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message CreateSecondaryClusterRequest { + // Required. The location of the new cluster. For the required + // format, see the comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object (the secondary cluster). + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration of the requesting object (the secondary cluster). + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Cluster +message CreateClusterRequest { + // Required. The location of the new cluster. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Cluster +message UpdateClusterRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Destination for Export. Export will be done to cloud storage. +message GcsDestination { + // 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`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Export cluster request. +message ExportClusterRequest { + // Options for exporting data in CSV format. + message CsvExportOptions { + // Required. The SELECT query used to extract the data. + string select_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string field_delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string quote_character = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string escape_character = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Options for exporting data in SQL format. + message SqlExportOptions { + // Optional. Tables to export from. + repeated string tables = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, only export the schema. + optional bool schema_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, output commands to DROP all the dumped database + // objects prior to outputting the commands for creating them. + optional bool clean_target_objects = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, use DROP ... IF EXISTS commands to check for the + // object's existence before dropping it in clean_target_objects mode. + optional bool if_exist_target_objects = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Oneof field to support other destinations in future. + oneof destination { + // Required. Option to export data to cloud storage. + GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required field to specify export file type and options. + oneof export_options { + // Options for exporting data in CSV format. Required field to be set for + // CSV file type. + CsvExportOptions csv_export_options = 4; + + // Options for exporting data in SQL format. Required field to be set for + // SQL file type. + SqlExportOptions sql_export_options = 5; + } + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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. + string database = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of export cluster rpc. +message ExportClusterResponse { + // Oneof field to support other destinations in future. + oneof destination { + // Required. Option to export data to cloud storage. + GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Import cluster request. +message ImportClusterRequest { + // Options for importing data in SQL format. + message SqlImportOptions {} + + // Options for importing data in CSV format. + message CsvImportOptions { + // Required. The database table to import CSV file into. + string table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The columns to which CSV data is imported. If not specified, + // all columns of the database table are loaded with CSV data. + repeated string columns = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string field_delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string quote_character = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string escape_character = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // oneof field to support various import formats like SQL and CSV. + oneof import_options { + // Options for importing data in SQL format. + SqlImportOptions sql_import_options = 4; + + // Options for importing data in CSV format. + CsvImportOptions csv_import_options = 7; + } + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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`. + string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string database = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string user = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of import rpc. +message ImportClusterResponse { + // Required. Size of the object downloaded from Google Cloud Storage in bytes. + int64 bytes_downloaded = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Upgrades a cluster. +message UpgradeClusterRequest { + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // Required. The version the cluster is going to be upgraded to. + DatabaseVersion version = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// UpgradeClusterResponse contains the response for upgrade cluster operation. +message UpgradeClusterResponse { + // Stage information for different stages in the upgrade process. + message StageInfo { + // The stage. + Stage stage = 1; + + // Status of the stage. + Status status = 2; + + // 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. + string logs_url = 3; + } + + // Details regarding the upgrade of instances associated with a cluster. + message InstanceUpgradeDetails { + // Normalized name of the instance. + string name = 1; + + // Upgrade status of the instance. + Status upgrade_status = 2; + + // Instance type. + Instance.InstanceType instance_type = 3; + } + + // Upgrade details of a cluster. This cluster can be primary or secondary. + message ClusterUpgradeDetails { + // Normalized name of the cluster + string name = 1; + + // Upgrade status of the cluster. + Status upgrade_status = 2; + + // Cluster type which can either be primary or secondary. + Cluster.ClusterType cluster_type = 3; + + // 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. + DatabaseVersion database_version = 4; + + // Array containing stage info associated with this cluster. + repeated StageInfo stage_info = 5; + + // Upgrade details of the instances directly associated with this cluster. + repeated InstanceUpgradeDetails instance_upgrade_details = 6; + } + + // Status of upgrade operation. + enum 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; + } + + // Stage in the upgrade. + enum 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; + } + + // Status of upgrade operation. + Status status = 1; + + // A user friendly message summarising the upgrade operation details and the + // next steps for the user if there is any. + string message = 2; + + // Array of upgrade details for the current cluster and all the secondary + // clusters associated with this cluster. + repeated ClusterUpgradeDetails cluster_upgrade_details = 3; +} + +// Message for deleting a Cluster +message DeleteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to cascade delete child instances for given cluster. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for switching over to a cluster +message SwitchoverClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for promoting a Cluster +message PromoteClusterRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Cluster.name field + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for restoring a Cluster from a backup or another cluster at a given +// point in time. +// NEXT_ID: 11 +message RestoreClusterRequest { + // Required. + // The source to import from. + oneof source { + // Backup source. + BackupSource backup_source = 4; + + // ContinuousBackup source. Continuous backup needs to be enabled in the + // source cluster for this operation to succeed. + ContinuousBackupSource continuous_backup_source = 8; + } + + // Required. The name of the parent resource. For the required format, see the + // comment on the Cluster.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Cluster" + } + ]; + + // Required. ID of the requesting object. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Instances +message ListInstancesRequest { + // 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/- + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Instances +message ListInstancesResponse { + // The list of Instance + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Instance +message GetInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // The view of the instance to return. + InstanceView view = 2; +} + +// Message for creating a Instance +message CreateInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Secondary Instance +message CreateSecondaryInstanceRequest { + // Required. The name of the parent resource. For the required format, see the + // comment on the Instance.name field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. ID of the requesting object. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// See usage below for notes. +message CreateInstanceRequests { + // Required. Primary and read replica instances to be created. This list + // should not be empty. + repeated CreateInstanceRequest create_instance_requests = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating a batch of instances under the specified cluster. +message BatchCreateInstancesRequest { + // Required. The name of the parent resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Instance" + } + ]; + + // Required. Resources being created. + CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating batches of instances in a cluster. +message BatchCreateInstancesResponse { + // Created instances. + repeated Instance instances = 1; +} + +// Message for metadata that is specific to BatchCreateInstances API. +// NEXT_ID: 3 +message BatchCreateInstancesMetadata { + // 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. + repeated string instance_targets = 1; + + // 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. + map instance_statuses = 2; +} + +// 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. +message BatchCreateInstanceStatus { + // State contains all valid instance states for the BatchCreateInstances + // operation. This is mainly used for status reporting through the LRO + // metadata. + enum 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; + } + + // 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. + State state = 1; + + // DEPRECATED - Use the error field instead. + // Error, if any error occurred and is available, during instance creation. + string error_msg = 2; + + // The RPC status of the instance creation operation. This field will be + // present if an error happened during the instance creation. + google.rpc.Status error = 4; + + Instance.InstanceType type = 3; +} + +// Message for updating a Instance +message UpdateInstanceRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Instance +message DeleteInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering failover on an Instance +message FailoverInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for triggering fault injection on an instance +message InjectFaultRequest { + // FaultType contains all valid types of faults that can be injected to an + // instance. + enum FaultType { + // The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0; + + // Stop the VM + STOP_VM = 1; + } + + // Required. The type of fault to be injected in an instance. + FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +message RestartInstanceRequest { + // Required. The name of the resource. For the required format, see the + // comment on the Instance.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation, for example, permission + // checks and any other type of validation, but does not actually execute the + // create request. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + // restart upon. Applicable only to read instances. + repeated string node_ids = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for ExecuteSql rpc. +message ExecuteSqlRequest { + // Oneof field to support other credential mechanisms in future like + // SecretManager etc. + oneof user_credential { + // Optional. The database native user’s password. + string password = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The instance where the SQL will be executed. For the required + // format, see the comment on the Instance.name field. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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. + string database = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string user = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. SQL statement to execute on database. Any valid statement is + // permitted, including DDL, DML, DQL statements. + string sql_statement = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validates the sql statement by performing + // syntax and semantic validation and doesn't execute the query. + bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execute a SQL statement response. +message ExecuteSqlResponse { + // SqlResult represents the results for the execution of sql statements. + repeated SqlResult sql_results = 1; + + // Any additional metadata information regarding the execution of the sql + // statement. + ExecuteSqlMetadata metadata = 3; +} + +// Any additional metadata information regarding the execution of the SQL +message ExecuteSqlMetadata { + // Status contains all valid Status a SQL execution can end up in. + enum 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; + } + + // 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." + string message = 1; + + // Set to true if SQL returned a result set larger than the acceptable + // response size limits and the result was truncated. + bool partial_result = 2; + + // The time duration taken to execute the sql statement. + google.protobuf.Duration sql_statement_execution_duration = 3; + + // Status of SQL execution. + Status status = 4; +} + +// Message for requesting list of Backups +message ListBackupsRequest { + // Required. Parent value for ListBackupsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Backups +message ListBackupsResponse { + // The list of Backup + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Backup +message GetBackupRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; +} + +// Message for creating a Backup +message CreateBackupRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Backup" + } + ]; + + // Required. ID of the requesting object. + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Backup +message UpdateBackupRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Backup +message DeleteBackupRequest { + // Required. Name of the resource. For the required format, see the comment on + // the Backup.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for listing the information about the supported Database flags. +message ListSupportedDatabaseFlagsRequest { + // 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. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. The scope for which supported flags are requested. If not + // specified, default is DATABASE. + SupportedDatabaseFlag.Scope scope = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing SupportedDatabaseFlags. +message ListSupportedDatabaseFlagsResponse { + // The list of SupportedDatabaseFlags. + repeated SupportedDatabaseFlag supported_database_flags = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for requests to generate a client certificate signed by the Cluster +// CA. +message GenerateClientCertificateRequest { + // Required. The name of the parent resource. The required format is: + // * projects/{project}/locations/{location}/clusters/{cluster} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pem-encoded X.509 certificate signing request (CSR). It is + // recommended to use public_key instead. + string pem_csr = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // 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. + google.protobuf.Duration cert_duration = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The public key from the client. + string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message returned by a GenerateClientCertificate operation. +message GenerateClientCertificateResponse { + // Output only. The pem-encoded, signed X.509 certificate. + string pem_certificate = 1 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated string pem_certificate_chain = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The pem-encoded cluster ca X.509 certificate. + string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetConnectionInfo. +message GetConnectionInfoRequest { + // Required. The name of the parent resource. The required format is: + // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "alloydb.googleapis.com/Instance" + } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Request specific metadata, if any. + oneof request_specific { + // Output only. BatchCreateInstances related metadata. + BatchCreateInstancesMetadata batch_create_instances_metadata = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. PromoteClusterStatus related metadata. + PromoteClusterStatus promote_cluster_status = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. UpgradeClusterStatus related metadata. + UpgradeClusterStatus upgrade_cluster_status = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for current status of the database during Promote Cluster operation. +message PromoteClusterStatus { + // State contains all valid states of the database during promote cluster + // operation. This is used for status reporting through the LRO metadata. + enum 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; + } + + // 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 + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for current status of the Major Version Upgrade operation. +message UpgradeClusterStatus { + // Status of an upgrade stage. + message StageStatus { + // Timing information for the stage execution. + message StageSchedule { + // When the stage is expected to start. Set only if the stage has not + // started yet. + google.protobuf.Timestamp estimated_start_time = 1; + + // Actual start time of the stage. Set only if the stage has started. + google.protobuf.Timestamp actual_start_time = 2; + + // When the stage is expected to end. Set only if the stage has not + // completed yet. + google.protobuf.Timestamp estimated_end_time = 3; + + // Actual end time of the stage. Set only if the stage has completed. + google.protobuf.Timestamp actual_end_time = 4; + } + + // Stage specific status information, if any. + oneof stage_specific_status { + // Read pool instances upgrade metadata. + ReadPoolInstancesUpgradeStageStatus read_pool_instances_upgrade = 11; + } + + // Upgrade stage. + UpgradeClusterResponse.Stage stage = 1; + + // State of this stage. + UpgradeClusterResponse.Status state = 2; + + // Output only. Timing information for the stage execution. + StageSchedule schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Read pool instances upgrade specific status. + message ReadPoolInstancesUpgradeStageStatus { + // Upgrade stats for read pool instances. + message Stats { + // Number of read pool instances for which upgrade has not started. + int32 not_started = 1; + + // Number of read pool instances undergoing upgrade. + int32 ongoing = 2; + + // Number of read pool instances successfully upgraded. + int32 success = 3; + + // Number of read pool instances which failed to upgrade. + int32 failed = 4; + } + + // Read pool instances upgrade statistics. + Stats upgrade_stats = 1; + } + + // Cluster Major Version Upgrade state. + UpgradeClusterResponse.Status state = 1; + + // Whether the operation is cancellable. + bool cancellable = 2; + + // Source database major version. + DatabaseVersion source_version = 3; + + // Target database major version. + DatabaseVersion target_version = 4; + + // Status of all upgrade stages. + repeated StageStatus stages = 5; +} + +// Message for requesting list of Users +message ListUsersRequest { + // Required. Parent value for ListUsersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing Users +message ListUsersResponse { + // The list of User + repeated User users = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a User +message GetUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; +} + +// Message for creating a User +message CreateUserRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/User" + } + ]; + + // Required. ID of the requesting object. + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + User user = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a User +message UpdateUserRequest { + // 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. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + User user = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allow missing fields in the update mask. + bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a User +message DeleteUserRequest { + // Required. The name of the resource. For the required format, see the + // comment on the User.name field. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } + ]; + + // 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). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the backend validates the request, but doesn't actually + // execute it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for ListDatabases request. +message ListDatabasesRequest { + // Required. Parent value for ListDatabasesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Database" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + // This field is currently not supported, its value will be ignored if passed. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for ListDatabases response. +message ListDatabasesResponse { + // The list of databases. + repeated Database databases = 1; + + // A token identifying the next page of results the server should return. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message for CreateDatabase request. +message CreateDatabaseRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "alloydb.googleapis.com/Database" + } + ]; + + // Required. ID of the requesting object. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Database database = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts new file mode 100644 index 00000000000..28c6c475c4e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts @@ -0,0 +1,54745 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace alloydb. */ + namespace alloydb { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a CloudSQLBackupRunSource. */ + interface ICloudSQLBackupRunSource { + + /** CloudSQLBackupRunSource project */ + project?: (string|null); + + /** CloudSQLBackupRunSource instanceId */ + instanceId?: (string|null); + + /** CloudSQLBackupRunSource backupRunId */ + backupRunId?: (number|Long|string|null); + } + + /** Represents a CloudSQLBackupRunSource. */ + class CloudSQLBackupRunSource implements ICloudSQLBackupRunSource { + + /** + * Constructs a new CloudSQLBackupRunSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICloudSQLBackupRunSource); + + /** CloudSQLBackupRunSource project. */ + public project: string; + + /** CloudSQLBackupRunSource instanceId. */ + public instanceId: string; + + /** CloudSQLBackupRunSource backupRunId. */ + public backupRunId: (number|Long|string); + + /** + * Creates a new CloudSQLBackupRunSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSQLBackupRunSource instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICloudSQLBackupRunSource): google.cloud.alloydb.v1.CloudSQLBackupRunSource; + + /** + * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. + * @param message CloudSQLBackupRunSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. + * @param message CloudSQLBackupRunSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CloudSQLBackupRunSource; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CloudSQLBackupRunSource; + + /** + * Verifies a CloudSQLBackupRunSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSQLBackupRunSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CloudSQLBackupRunSource; + + /** + * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. + * @param message CloudSQLBackupRunSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CloudSQLBackupRunSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSQLBackupRunSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSQLBackupRunSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AlloyDBCSQLAdmin */ + class AlloyDBCSQLAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBCSQLAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBCSQLAdmin; + + /** + * Calls RestoreFromCloudSQL. + * @param request RestoreFromCloudSQLRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreFromCloudSQL(request: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, callback: google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback): void; + + /** + * Calls RestoreFromCloudSQL. + * @param request RestoreFromCloudSQLRequest message or plain object + * @returns Promise + */ + public restoreFromCloudSQL(request: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest): Promise; + } + + namespace AlloyDBCSQLAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBCSQLAdmin|restoreFromCloudSQL}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreFromCloudSQLCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a RestoreFromCloudSQLRequest. */ + interface IRestoreFromCloudSQLRequest { + + /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource */ + cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); + + /** RestoreFromCloudSQLRequest parent */ + parent?: (string|null); + + /** RestoreFromCloudSQLRequest clusterId */ + clusterId?: (string|null); + + /** RestoreFromCloudSQLRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + } + + /** Represents a RestoreFromCloudSQLRequest. */ + class RestoreFromCloudSQLRequest implements IRestoreFromCloudSQLRequest { + + /** + * Constructs a new RestoreFromCloudSQLRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest); + + /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource. */ + public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); + + /** RestoreFromCloudSQLRequest parent. */ + public parent: string; + + /** RestoreFromCloudSQLRequest clusterId. */ + public clusterId: string; + + /** RestoreFromCloudSQLRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** RestoreFromCloudSQLRequest source. */ + public source?: "cloudsqlBackupRunSource"; + + /** + * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreFromCloudSQLRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. + * @param message RestoreFromCloudSQLRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. + * @param message RestoreFromCloudSQLRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; + + /** + * Verifies a RestoreFromCloudSQLRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreFromCloudSQLRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; + + /** + * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. + * @param message RestoreFromCloudSQLRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.RestoreFromCloudSQLRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreFromCloudSQLRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreFromCloudSQLRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InstanceView enum. */ + enum InstanceView { + INSTANCE_VIEW_UNSPECIFIED = 0, + INSTANCE_VIEW_BASIC = 1, + INSTANCE_VIEW_FULL = 2 + } + + /** ClusterView enum. */ + enum ClusterView { + CLUSTER_VIEW_UNSPECIFIED = 0, + CLUSTER_VIEW_BASIC = 1, + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + } + + /** DatabaseVersion enum. */ + enum DatabaseVersion { + DATABASE_VERSION_UNSPECIFIED = 0, + POSTGRES_13 = 1, + POSTGRES_14 = 2, + POSTGRES_15 = 3, + POSTGRES_16 = 4, + POSTGRES_17 = 5 + } + + /** SubscriptionType enum. */ + enum SubscriptionType { + SUBSCRIPTION_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + TRIAL = 2 + } + + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword user */ + user?: (string|null); + + /** UserPassword password */ + password?: (string|null); + } + + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { + + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUserPassword); + + /** UserPassword user. */ + public user: string; + + /** UserPassword password. */ + public password: string; + + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUserPassword): google.cloud.alloydb.v1.UserPassword; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UserPassword; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UserPassword; + + /** + * Verifies a UserPassword message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UserPassword; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MigrationSource. */ + interface IMigrationSource { + + /** MigrationSource hostPort */ + hostPort?: (string|null); + + /** MigrationSource referenceId */ + referenceId?: (string|null); + + /** MigrationSource sourceType */ + sourceType?: (google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|null); + } + + /** Represents a MigrationSource. */ + class MigrationSource implements IMigrationSource { + + /** + * Constructs a new MigrationSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IMigrationSource); + + /** MigrationSource hostPort. */ + public hostPort: string; + + /** MigrationSource referenceId. */ + public referenceId: string; + + /** MigrationSource sourceType. */ + public sourceType: (google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1.MigrationSource.MigrationSourceType); + + /** + * Creates a new MigrationSource instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationSource instance + */ + public static create(properties?: google.cloud.alloydb.v1.IMigrationSource): google.cloud.alloydb.v1.MigrationSource; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MigrationSource; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MigrationSource; + + /** + * Verifies a MigrationSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MigrationSource; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @param message MigrationSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationSource { + + /** MigrationSourceType enum. */ + enum MigrationSourceType { + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, + DMS = 1 + } + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.IEncryptionConfig): google.cloud.alloydb.v1.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.cloud.alloydb.v1.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1.EncryptionInfo.Type|null); + + /** EncryptionInfo kmsKeyVersions */ + kmsKeyVersions?: (string[]|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.cloud.alloydb.v1.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1.EncryptionInfo.Type); + + /** EncryptionInfo kmsKeyVersions. */ + public kmsKeyVersions: string[]; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1.IEncryptionInfo): google.cloud.alloydb.v1.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig sslMode */ + sslMode?: (google.cloud.alloydb.v1.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1.SslConfig.SslMode|null); + + /** SslConfig caSource */ + caSource?: (google.cloud.alloydb.v1.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1.SslConfig.CaSource|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISslConfig); + + /** SslConfig sslMode. */ + public sslMode: (google.cloud.alloydb.v1.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1.SslConfig.SslMode); + + /** SslConfig caSource. */ + public caSource: (google.cloud.alloydb.v1.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1.SslConfig.CaSource); + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISslConfig): google.cloud.alloydb.v1.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SslConfig; + + /** + * Verifies a SslConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** SslMode enum. */ + enum SslMode { + SSL_MODE_UNSPECIFIED = 0, + SSL_MODE_ALLOW = 1, + SSL_MODE_REQUIRE = 2, + SSL_MODE_VERIFY_CA = 3, + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, + ENCRYPTED_ONLY = 5 + } + + /** CaSource enum. */ + enum CaSource { + CA_SOURCE_UNSPECIFIED = 0, + CA_SOURCE_MANAGED = 1 + } + } + + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { + + /** AutomatedBackupPolicy weeklySchedule */ + weeklySchedule?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention */ + timeBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention */ + quantityBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled */ + enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow */ + backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location */ + location?: (string|null); + + /** AutomatedBackupPolicy labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IAutomatedBackupPolicy); + + /** AutomatedBackupPolicy weeklySchedule. */ + public weeklySchedule?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention. */ + public timeBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention. */ + public quantityBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled. */ + public enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow. */ + public backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location. */ + public location: string; + + /** AutomatedBackupPolicy labels. */ + public labels: { [k: string]: string }; + + /** AutomatedBackupPolicy schedule. */ + public schedule?: "weeklySchedule"; + + /** AutomatedBackupPolicy retention. */ + public retention?: ("timeBasedRetention"|"quantityBasedRetention"); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedBackupPolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1.IAutomatedBackupPolicy): google.cloud.alloydb.v1.AutomatedBackupPolicy; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy; + + /** + * Verifies an AutomatedBackupPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedBackupPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutomatedBackupPolicy { + + /** Properties of a WeeklySchedule. */ + interface IWeeklySchedule { + + /** WeeklySchedule startTimes */ + startTimes?: (google.type.ITimeOfDay[]|null); + + /** WeeklySchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + } + + /** Represents a WeeklySchedule. */ + class WeeklySchedule implements IWeeklySchedule { + + /** + * Constructs a new WeeklySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule); + + /** WeeklySchedule startTimes. */ + public startTimes: google.type.ITimeOfDay[]; + + /** WeeklySchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklySchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Verifies a WeeklySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @param message WeeklySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeeklySchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeBasedRetention. */ + interface ITimeBasedRetention { + + /** TimeBasedRetention retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a TimeBasedRetention. */ + class TimeBasedRetention implements ITimeBasedRetention { + + /** + * Constructs a new TimeBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention); + + /** TimeBasedRetention retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Verifies a TimeBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @param message TimeBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuantityBasedRetention. */ + interface IQuantityBasedRetention { + + /** QuantityBasedRetention count */ + count?: (number|null); + } + + /** Represents a QuantityBasedRetention. */ + class QuantityBasedRetention implements IQuantityBasedRetention { + + /** + * Constructs a new QuantityBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention); + + /** QuantityBasedRetention count. */ + public count: number; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Verifies a QuantityBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @param message QuantityBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ContinuousBackupConfig. */ + interface IContinuousBackupConfig { + + /** ContinuousBackupConfig enabled */ + enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays */ + recoveryWindowDays?: (number|null); + + /** ContinuousBackupConfig encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + } + + /** Represents a ContinuousBackupConfig. */ + class ContinuousBackupConfig implements IContinuousBackupConfig { + + /** + * Constructs a new ContinuousBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupConfig); + + /** ContinuousBackupConfig enabled. */ + public enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays. */ + public recoveryWindowDays: number; + + /** ContinuousBackupConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupConfig): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Verifies a ContinuousBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupConfig; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @param message ContinuousBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupInfo. */ + interface IContinuousBackupInfo { + + /** ContinuousBackupInfo encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime */ + enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule */ + schedule?: (google.type.DayOfWeek[]|null); + + /** ContinuousBackupInfo earliestRestorableTime */ + earliestRestorableTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupInfo. */ + class ContinuousBackupInfo implements IContinuousBackupInfo { + + /** + * Constructs a new ContinuousBackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupInfo); + + /** ContinuousBackupInfo encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime. */ + public enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule. */ + public schedule: google.type.DayOfWeek[]; + + /** ContinuousBackupInfo earliestRestorableTime. */ + public earliestRestorableTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupInfo): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Verifies a ContinuousBackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupInfo; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @param message ContinuousBackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupSource. */ + interface IBackupSource { + + /** BackupSource backupUid */ + backupUid?: (string|null); + + /** BackupSource backupName */ + backupName?: (string|null); + } + + /** Represents a BackupSource. */ + class BackupSource implements IBackupSource { + + /** + * Constructs a new BackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IBackupSource); + + /** BackupSource backupUid. */ + public backupUid: string; + + /** BackupSource backupName. */ + public backupName: string; + + /** + * Creates a new BackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1.IBackupSource): google.cloud.alloydb.v1.BackupSource; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BackupSource; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BackupSource; + + /** + * Verifies a BackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BackupSource; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @param message BackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupSource. */ + interface IContinuousBackupSource { + + /** ContinuousBackupSource cluster */ + cluster?: (string|null); + + /** ContinuousBackupSource pointInTime */ + pointInTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupSource. */ + class ContinuousBackupSource implements IContinuousBackupSource { + + /** + * Constructs a new ContinuousBackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupSource); + + /** ContinuousBackupSource cluster. */ + public cluster: string; + + /** ContinuousBackupSource pointInTime. */ + public pointInTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupSource): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Verifies a ContinuousBackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupSource; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @param message ContinuousBackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenanceUpdatePolicy. */ + interface IMaintenanceUpdatePolicy { + + /** MaintenanceUpdatePolicy maintenanceWindows */ + maintenanceWindows?: (google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); + + /** MaintenanceUpdatePolicy denyMaintenancePeriods */ + denyMaintenancePeriods?: (google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]|null); + } + + /** Represents a MaintenanceUpdatePolicy. */ + class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy); + + /** MaintenanceUpdatePolicy maintenanceWindows. */ + public maintenanceWindows: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow[]; + + /** MaintenanceUpdatePolicy denyMaintenancePeriods. */ + public denyMaintenancePeriods: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceUpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceUpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @param message MaintenanceUpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MaintenanceUpdatePolicy { + + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { + + /** MaintenanceWindow day */ + day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** MaintenanceWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { + + /** + * Constructs a new MaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow); + + /** MaintenanceWindow day. */ + public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** MaintenanceWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceWindow instance + */ + public static create(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Verifies a MaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DenyMaintenancePeriod. */ + interface IDenyMaintenancePeriod { + + /** DenyMaintenancePeriod startDate */ + startDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod endDate */ + endDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod time */ + time?: (google.type.ITimeOfDay|null); + } + + /** Represents a DenyMaintenancePeriod. */ + class DenyMaintenancePeriod implements IDenyMaintenancePeriod { + + /** + * Constructs a new DenyMaintenancePeriod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod); + + /** DenyMaintenancePeriod startDate. */ + public startDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod endDate. */ + public endDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod time. */ + public time?: (google.type.ITimeOfDay|null); + + /** + * Creates a new DenyMaintenancePeriod instance using the specified properties. + * @param [properties] Properties to set + * @returns DenyMaintenancePeriod instance + */ + public static create(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @param message DenyMaintenancePeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @param message DenyMaintenancePeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Verifies a DenyMaintenancePeriod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DenyMaintenancePeriod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. + * @param message DenyMaintenancePeriod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DenyMaintenancePeriod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DenyMaintenancePeriod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { + + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MaintenanceSchedule. */ + class MaintenanceSchedule implements IMaintenanceSchedule { + + /** + * Constructs a new MaintenanceSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IMaintenanceSchedule); + + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1.IMaintenanceSchedule): google.cloud.alloydb.v1.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceSchedule; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceSchedule; + + /** + * Verifies a MaintenanceSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceSchedule; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @param message MaintenanceSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1.IMigrationSource|null); + + /** Cluster cloudsqlBackupRunSource */ + cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); + + /** Cluster name */ + name?: (string|null); + + /** Cluster displayName */ + displayName?: (string|null); + + /** Cluster uid */ + uid?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster state */ + state?: (google.cloud.alloydb.v1.Cluster.State|keyof typeof google.cloud.alloydb.v1.Cluster.State|null); + + /** Cluster clusterType */ + clusterType?: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType|null); + + /** Cluster databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); + + /** Cluster network */ + network?: (string|null); + + /** Cluster etag */ + etag?: (string|null); + + /** Cluster annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Cluster reconciling */ + reconciling?: (boolean|null); + + /** Cluster initialUser */ + initialUser?: (google.cloud.alloydb.v1.IUserPassword|null); + + /** Cluster automatedBackupPolicy */ + automatedBackupPolicy?: (google.cloud.alloydb.v1.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig */ + sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + + /** Cluster encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** Cluster encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** Cluster continuousBackupConfig */ + continuousBackupConfig?: (google.cloud.alloydb.v1.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo */ + continuousBackupInfo?: (google.cloud.alloydb.v1.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig */ + secondaryConfig?: (google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig */ + primaryConfig?: (google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null); + + /** Cluster satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Cluster pscConfig */ + pscConfig?: (google.cloud.alloydb.v1.Cluster.IPscConfig|null); + + /** Cluster maintenanceUpdatePolicy */ + maintenanceUpdatePolicy?: (google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.alloydb.v1.IMaintenanceSchedule|null); + + /** Cluster subscriptionType */ + subscriptionType?: (google.cloud.alloydb.v1.SubscriptionType|keyof typeof google.cloud.alloydb.v1.SubscriptionType|null); + + /** Cluster trialMetadata */ + trialMetadata?: (google.cloud.alloydb.v1.Cluster.ITrialMetadata|null); + + /** Cluster tags */ + tags?: ({ [k: string]: string }|null); + + /** Cluster dataplexConfig */ + dataplexConfig?: (google.cloud.alloydb.v1.Cluster.IDataplexConfig|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICluster); + + /** Cluster backupSource. */ + public backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** Cluster migrationSource. */ + public migrationSource?: (google.cloud.alloydb.v1.IMigrationSource|null); + + /** Cluster cloudsqlBackupRunSource. */ + public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); + + /** Cluster name. */ + public name: string; + + /** Cluster displayName. */ + public displayName: string; + + /** Cluster uid. */ + public uid: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster state. */ + public state: (google.cloud.alloydb.v1.Cluster.State|keyof typeof google.cloud.alloydb.v1.Cluster.State); + + /** Cluster clusterType. */ + public clusterType: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType); + + /** Cluster databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); + + /** Cluster network. */ + public network: string; + + /** Cluster etag. */ + public etag: string; + + /** Cluster annotations. */ + public annotations: { [k: string]: string }; + + /** Cluster reconciling. */ + public reconciling: boolean; + + /** Cluster initialUser. */ + public initialUser?: (google.cloud.alloydb.v1.IUserPassword|null); + + /** Cluster automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.cloud.alloydb.v1.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + + /** Cluster encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** Cluster encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** Cluster continuousBackupConfig. */ + public continuousBackupConfig?: (google.cloud.alloydb.v1.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo. */ + public continuousBackupInfo?: (google.cloud.alloydb.v1.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig. */ + public secondaryConfig?: (google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig. */ + public primaryConfig?: (google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null); + + /** Cluster satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Cluster pscConfig. */ + public pscConfig?: (google.cloud.alloydb.v1.Cluster.IPscConfig|null); + + /** Cluster maintenanceUpdatePolicy. */ + public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.alloydb.v1.IMaintenanceSchedule|null); + + /** Cluster subscriptionType. */ + public subscriptionType: (google.cloud.alloydb.v1.SubscriptionType|keyof typeof google.cloud.alloydb.v1.SubscriptionType); + + /** Cluster trialMetadata. */ + public trialMetadata?: (google.cloud.alloydb.v1.Cluster.ITrialMetadata|null); + + /** Cluster tags. */ + public tags: { [k: string]: string }; + + /** Cluster dataplexConfig. */ + public dataplexConfig?: (google.cloud.alloydb.v1.Cluster.IDataplexConfig|null); + + /** Cluster source. */ + public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICluster): google.cloud.alloydb.v1.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecondaryConfig. */ + interface ISecondaryConfig { + + /** SecondaryConfig primaryClusterName */ + primaryClusterName?: (string|null); + } + + /** Represents a SecondaryConfig. */ + class SecondaryConfig implements ISecondaryConfig { + + /** + * Constructs a new SecondaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.ISecondaryConfig); + + /** SecondaryConfig primaryClusterName. */ + public primaryClusterName: string; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecondaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.ISecondaryConfig): google.cloud.alloydb.v1.Cluster.SecondaryConfig; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.SecondaryConfig; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.SecondaryConfig; + + /** + * Verifies a SecondaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecondaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.SecondaryConfig; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @param message SecondaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecondaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecondaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrimaryConfig. */ + interface IPrimaryConfig { + + /** PrimaryConfig secondaryClusterNames */ + secondaryClusterNames?: (string[]|null); + } + + /** Represents a PrimaryConfig. */ + class PrimaryConfig implements IPrimaryConfig { + + /** + * Constructs a new PrimaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.IPrimaryConfig); + + /** PrimaryConfig secondaryClusterNames. */ + public secondaryClusterNames: string[]; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.IPrimaryConfig): google.cloud.alloydb.v1.Cluster.PrimaryConfig; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.PrimaryConfig; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.PrimaryConfig; + + /** + * Verifies a PrimaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.PrimaryConfig; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @param message PrimaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrimaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrimaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscConfig. */ + interface IPscConfig { + + /** PscConfig pscEnabled */ + pscEnabled?: (boolean|null); + + /** PscConfig serviceOwnedProjectNumber */ + serviceOwnedProjectNumber?: (number|Long|string|null); + } + + /** Represents a PscConfig. */ + class PscConfig implements IPscConfig { + + /** + * Constructs a new PscConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.IPscConfig); + + /** PscConfig pscEnabled. */ + public pscEnabled: boolean; + + /** PscConfig serviceOwnedProjectNumber. */ + public serviceOwnedProjectNumber: (number|Long|string); + + /** + * Creates a new PscConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.IPscConfig): google.cloud.alloydb.v1.Cluster.PscConfig; + + /** + * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. + * @param message PscConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. + * @param message PscConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.PscConfig; + + /** + * Decodes a PscConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.PscConfig; + + /** + * Verifies a PscConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.PscConfig; + + /** + * Creates a plain object from a PscConfig message. Also converts values to other types if specified. + * @param message PscConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.PscConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrialMetadata. */ + interface ITrialMetadata { + + /** TrialMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata upgradeTime */ + upgradeTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata graceEndTime */ + graceEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TrialMetadata. */ + class TrialMetadata implements ITrialMetadata { + + /** + * Constructs a new TrialMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.ITrialMetadata); + + /** TrialMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata upgradeTime. */ + public upgradeTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata graceEndTime. */ + public graceEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TrialMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.ITrialMetadata): google.cloud.alloydb.v1.Cluster.TrialMetadata; + + /** + * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. + * @param message TrialMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. + * @param message TrialMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.TrialMetadata; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.TrialMetadata; + + /** + * Verifies a TrialMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.TrialMetadata; + + /** + * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. + * @param message TrialMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.TrialMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataplexConfig. */ + interface IDataplexConfig { + + /** DataplexConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a DataplexConfig. */ + class DataplexConfig implements IDataplexConfig { + + /** + * Constructs a new DataplexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.IDataplexConfig); + + /** DataplexConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataplexConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.IDataplexConfig): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Verifies a DataplexConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataplexConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @param message DataplexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataplexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataplexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + EMPTY = 3, + CREATING = 4, + DELETING = 5, + FAILED = 6, + BOOTSTRAPPING = 7, + MAINTENANCE = 8, + PROMOTING = 9 + } + + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + SECONDARY = 2 + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance uid */ + uid?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance state */ + state?: (google.cloud.alloydb.v1.Instance.State|keyof typeof google.cloud.alloydb.v1.Instance.State|null); + + /** Instance instanceType */ + instanceType?: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType|null); + + /** Instance machineConfig */ + machineConfig?: (google.cloud.alloydb.v1.Instance.IMachineConfig|null); + + /** Instance availabilityType */ + availabilityType?: (google.cloud.alloydb.v1.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1.Instance.AvailabilityType|null); + + /** Instance gceZone */ + gceZone?: (string|null); + + /** Instance databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** Instance writableNode */ + writableNode?: (google.cloud.alloydb.v1.Instance.INode|null); + + /** Instance nodes */ + nodes?: (google.cloud.alloydb.v1.Instance.INode[]|null); + + /** Instance queryInsightsConfig */ + queryInsightsConfig?: (google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance observabilityConfig */ + observabilityConfig?: (google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null); + + /** Instance readPoolConfig */ + readPoolConfig?: (google.cloud.alloydb.v1.Instance.IReadPoolConfig|null); + + /** Instance ipAddress */ + ipAddress?: (string|null); + + /** Instance publicIpAddress */ + publicIpAddress?: (string|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance pscInstanceConfig */ + pscInstanceConfig?: (google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null); + + /** Instance networkConfig */ + networkConfig?: (google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null); + + /** Instance outboundPublicIpAddresses */ + outboundPublicIpAddresses?: (string[]|null); + + /** Instance activationPolicy */ + activationPolicy?: (google.cloud.alloydb.v1.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1.Instance.ActivationPolicy|null); + + /** Instance connectionPoolConfig */ + connectionPoolConfig?: (google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance uid. */ + public uid: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance state. */ + public state: (google.cloud.alloydb.v1.Instance.State|keyof typeof google.cloud.alloydb.v1.Instance.State); + + /** Instance instanceType. */ + public instanceType: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType); + + /** Instance machineConfig. */ + public machineConfig?: (google.cloud.alloydb.v1.Instance.IMachineConfig|null); + + /** Instance availabilityType. */ + public availabilityType: (google.cloud.alloydb.v1.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1.Instance.AvailabilityType); + + /** Instance gceZone. */ + public gceZone: string; + + /** Instance databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** Instance writableNode. */ + public writableNode?: (google.cloud.alloydb.v1.Instance.INode|null); + + /** Instance nodes. */ + public nodes: google.cloud.alloydb.v1.Instance.INode[]; + + /** Instance queryInsightsConfig. */ + public queryInsightsConfig?: (google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance observabilityConfig. */ + public observabilityConfig?: (google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null); + + /** Instance readPoolConfig. */ + public readPoolConfig?: (google.cloud.alloydb.v1.Instance.IReadPoolConfig|null); + + /** Instance ipAddress. */ + public ipAddress: string; + + /** Instance publicIpAddress. */ + public publicIpAddress: string; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); + + /** Instance satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Instance pscInstanceConfig. */ + public pscInstanceConfig?: (google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null); + + /** Instance networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null); + + /** Instance outboundPublicIpAddresses. */ + public outboundPublicIpAddresses: string[]; + + /** Instance activationPolicy. */ + public activationPolicy: (google.cloud.alloydb.v1.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1.Instance.ActivationPolicy); + + /** Instance connectionPoolConfig. */ + public connectionPoolConfig?: (google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.alloydb.v1.IInstance): google.cloud.alloydb.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Properties of a MachineConfig. */ + interface IMachineConfig { + + /** MachineConfig cpuCount */ + cpuCount?: (number|null); + + /** MachineConfig machineType */ + machineType?: (string|null); + } + + /** Represents a MachineConfig. */ + class MachineConfig implements IMachineConfig { + + /** + * Constructs a new MachineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IMachineConfig); + + /** MachineConfig cpuCount. */ + public cpuCount: number; + + /** MachineConfig machineType. */ + public machineType: string; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IMachineConfig): google.cloud.alloydb.v1.Instance.MachineConfig; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.MachineConfig; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.MachineConfig; + + /** + * Verifies a MachineConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.MachineConfig; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @param message MachineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Node. */ + interface INode { + + /** Node zoneId */ + zoneId?: (string|null); + + /** Node id */ + id?: (string|null); + + /** Node ip */ + ip?: (string|null); + + /** Node state */ + state?: (string|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.INode); + + /** Node zoneId. */ + public zoneId: string; + + /** Node id. */ + public id: string; + + /** Node ip. */ + public ip: string; + + /** Node state. */ + public state: string; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.INode): google.cloud.alloydb.v1.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryInsightsInstanceConfig. */ + interface IQueryInsightsInstanceConfig { + + /** QueryInsightsInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); + + /** QueryInsightsInstanceConfig recordClientAddress */ + recordClientAddress?: (boolean|null); + + /** QueryInsightsInstanceConfig queryStringLength */ + queryStringLength?: (number|null); + + /** QueryInsightsInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + } + + /** Represents a QueryInsightsInstanceConfig. */ + class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig); + + /** QueryInsightsInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); + + /** QueryInsightsInstanceConfig recordClientAddress. */ + public recordClientAddress?: (boolean|null); + + /** QueryInsightsInstanceConfig queryStringLength. */ + public queryStringLength: number; + + /** QueryInsightsInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInsightsInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInsightsInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @param message QueryInsightsInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObservabilityInstanceConfig. */ + interface IObservabilityInstanceConfig { + + /** ObservabilityInstanceConfig enabled */ + enabled?: (boolean|null); + + /** ObservabilityInstanceConfig preserveComments */ + preserveComments?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEvents */ + trackWaitEvents?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEventTypes */ + trackWaitEventTypes?: (boolean|null); + + /** ObservabilityInstanceConfig maxQueryStringLength */ + maxQueryStringLength?: (number|null); + + /** ObservabilityInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); + + /** ObservabilityInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + + /** ObservabilityInstanceConfig trackActiveQueries */ + trackActiveQueries?: (boolean|null); + } + + /** Represents an ObservabilityInstanceConfig. */ + class ObservabilityInstanceConfig implements IObservabilityInstanceConfig { + + /** + * Constructs a new ObservabilityInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig); + + /** ObservabilityInstanceConfig enabled. */ + public enabled?: (boolean|null); + + /** ObservabilityInstanceConfig preserveComments. */ + public preserveComments?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEvents. */ + public trackWaitEvents?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEventTypes. */ + public trackWaitEventTypes?: (boolean|null); + + /** ObservabilityInstanceConfig maxQueryStringLength. */ + public maxQueryStringLength?: (number|null); + + /** ObservabilityInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); + + /** ObservabilityInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); + + /** ObservabilityInstanceConfig trackActiveQueries. */ + public trackActiveQueries?: (boolean|null); + + /** + * Creates a new ObservabilityInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObservabilityInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; + + /** + * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @param message ObservabilityInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @param message ObservabilityInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; + + /** + * Verifies an ObservabilityInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObservabilityInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; + + /** + * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. + * @param message ObservabilityInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObservabilityInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObservabilityInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadPoolConfig. */ + interface IReadPoolConfig { + + /** ReadPoolConfig nodeCount */ + nodeCount?: (number|null); + } + + /** Represents a ReadPoolConfig. */ + class ReadPoolConfig implements IReadPoolConfig { + + /** + * Constructs a new ReadPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IReadPoolConfig); + + /** ReadPoolConfig nodeCount. */ + public nodeCount: number; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IReadPoolConfig): google.cloud.alloydb.v1.Instance.ReadPoolConfig; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ReadPoolConfig; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ReadPoolConfig; + + /** + * Verifies a ReadPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ReadPoolConfig; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @param message ReadPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscInterfaceConfig. */ + interface IPscInterfaceConfig { + + /** PscInterfaceConfig networkAttachmentResource */ + networkAttachmentResource?: (string|null); + } + + /** Represents a PscInterfaceConfig. */ + class PscInterfaceConfig implements IPscInterfaceConfig { + + /** + * Constructs a new PscInterfaceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig); + + /** PscInterfaceConfig networkAttachmentResource. */ + public networkAttachmentResource: string; + + /** + * Creates a new PscInterfaceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscInterfaceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; + + /** + * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. + * @param message PscInterfaceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. + * @param message PscInterfaceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; + + /** + * Verifies a PscInterfaceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscInterfaceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; + + /** + * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. + * @param message PscInterfaceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.PscInterfaceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscInterfaceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscInterfaceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscAutoConnectionConfig. */ + interface IPscAutoConnectionConfig { + + /** PscAutoConnectionConfig consumerProject */ + consumerProject?: (string|null); + + /** PscAutoConnectionConfig consumerNetwork */ + consumerNetwork?: (string|null); + + /** PscAutoConnectionConfig ipAddress */ + ipAddress?: (string|null); + + /** PscAutoConnectionConfig status */ + status?: (string|null); + + /** PscAutoConnectionConfig consumerNetworkStatus */ + consumerNetworkStatus?: (string|null); + } + + /** Represents a PscAutoConnectionConfig. */ + class PscAutoConnectionConfig implements IPscAutoConnectionConfig { + + /** + * Constructs a new PscAutoConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig); + + /** PscAutoConnectionConfig consumerProject. */ + public consumerProject: string; + + /** PscAutoConnectionConfig consumerNetwork. */ + public consumerNetwork: string; + + /** PscAutoConnectionConfig ipAddress. */ + public ipAddress: string; + + /** PscAutoConnectionConfig status. */ + public status: string; + + /** PscAutoConnectionConfig consumerNetworkStatus. */ + public consumerNetworkStatus: string; + + /** + * Creates a new PscAutoConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscAutoConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; + + /** + * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @param message PscAutoConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @param message PscAutoConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; + + /** + * Verifies a PscAutoConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscAutoConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; + + /** + * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. + * @param message PscAutoConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscAutoConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscAutoConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscInstanceConfig. */ + interface IPscInstanceConfig { + + /** PscInstanceConfig serviceAttachmentLink */ + serviceAttachmentLink?: (string|null); + + /** PscInstanceConfig allowedConsumerProjects */ + allowedConsumerProjects?: (string[]|null); + + /** PscInstanceConfig pscDnsName */ + pscDnsName?: (string|null); + + /** PscInstanceConfig pscInterfaceConfigs */ + pscInterfaceConfigs?: (google.cloud.alloydb.v1.Instance.IPscInterfaceConfig[]|null); + + /** PscInstanceConfig pscAutoConnections */ + pscAutoConnections?: (google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig[]|null); + } + + /** Represents a PscInstanceConfig. */ + class PscInstanceConfig implements IPscInstanceConfig { + + /** + * Constructs a new PscInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IPscInstanceConfig); + + /** PscInstanceConfig serviceAttachmentLink. */ + public serviceAttachmentLink: string; + + /** PscInstanceConfig allowedConsumerProjects. */ + public allowedConsumerProjects: string[]; + + /** PscInstanceConfig pscDnsName. */ + public pscDnsName: string; + + /** PscInstanceConfig pscInterfaceConfigs. */ + public pscInterfaceConfigs: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig[]; + + /** PscInstanceConfig pscAutoConnections. */ + public pscAutoConnections: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig[]; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IPscInstanceConfig): google.cloud.alloydb.v1.Instance.PscInstanceConfig; + + /** + * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. + * @param message PscInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. + * @param message PscInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.PscInstanceConfig; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.PscInstanceConfig; + + /** + * Verifies a PscInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.PscInstanceConfig; + + /** + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. + * @param message PscInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.PscInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceNetworkConfig. */ + interface IInstanceNetworkConfig { + + /** InstanceNetworkConfig authorizedExternalNetworks */ + authorizedExternalNetworks?: (google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]|null); + + /** InstanceNetworkConfig enablePublicIp */ + enablePublicIp?: (boolean|null); + + /** InstanceNetworkConfig enableOutboundPublicIp */ + enableOutboundPublicIp?: (boolean|null); + + /** InstanceNetworkConfig network */ + network?: (string|null); + + /** InstanceNetworkConfig allocatedIpRangeOverride */ + allocatedIpRangeOverride?: (string|null); + } + + /** Represents an InstanceNetworkConfig. */ + class InstanceNetworkConfig implements IInstanceNetworkConfig { + + /** + * Constructs a new InstanceNetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig); + + /** InstanceNetworkConfig authorizedExternalNetworks. */ + public authorizedExternalNetworks: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]; + + /** InstanceNetworkConfig enablePublicIp. */ + public enablePublicIp: boolean; + + /** InstanceNetworkConfig enableOutboundPublicIp. */ + public enableOutboundPublicIp: boolean; + + /** InstanceNetworkConfig network. */ + public network: string; + + /** InstanceNetworkConfig allocatedIpRangeOverride. */ + public allocatedIpRangeOverride: string; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceNetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; + + /** + * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. + * @param message InstanceNetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. + * @param message InstanceNetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; + + /** + * Verifies an InstanceNetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceNetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; + + /** + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. + * @param message InstanceNetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceNetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceNetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceNetworkConfig { + + /** Properties of an AuthorizedNetwork. */ + interface IAuthorizedNetwork { + + /** AuthorizedNetwork cidrRange */ + cidrRange?: (string|null); + } + + /** Represents an AuthorizedNetwork. */ + class AuthorizedNetwork implements IAuthorizedNetwork { + + /** + * Constructs a new AuthorizedNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork); + + /** AuthorizedNetwork cidrRange. */ + public cidrRange: string; + + /** + * Creates a new AuthorizedNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedNetwork instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @param message AuthorizedNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @param message AuthorizedNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Verifies an AuthorizedNetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. + * @param message AuthorizedNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ConnectionPoolConfig. */ + interface IConnectionPoolConfig { + + /** ConnectionPoolConfig enabled */ + enabled?: (boolean|null); + + /** ConnectionPoolConfig flags */ + flags?: ({ [k: string]: string }|null); + + /** ConnectionPoolConfig poolerCount */ + poolerCount?: (number|null); + } + + /** Represents a ConnectionPoolConfig. */ + class ConnectionPoolConfig implements IConnectionPoolConfig { + + /** + * Constructs a new ConnectionPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig); + + /** ConnectionPoolConfig enabled. */ + public enabled: boolean; + + /** ConnectionPoolConfig flags. */ + public flags: { [k: string]: string }; + + /** ConnectionPoolConfig poolerCount. */ + public poolerCount: number; + + /** + * Creates a new ConnectionPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; + + /** + * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. + * @param message ConnectionPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. + * @param message ConnectionPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; + + /** + * Verifies a ConnectionPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; + + /** + * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. + * @param message ConnectionPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.ConnectionPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + CREATING = 3, + DELETING = 4, + MAINTENANCE = 5, + FAILED = 6, + BOOTSTRAPPING = 8, + PROMOTING = 9 + } + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + READ_POOL = 2, + SECONDARY = 3 + } + + /** AvailabilityType enum. */ + enum AvailabilityType { + AVAILABILITY_TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2 + } + + /** ActivationPolicy enum. */ + enum ActivationPolicy { + ACTIVATION_POLICY_UNSPECIFIED = 0, + ALWAYS = 1, + NEVER = 2 + } + } + + /** Properties of a ConnectionInfo. */ + interface IConnectionInfo { + + /** ConnectionInfo name */ + name?: (string|null); + + /** ConnectionInfo ipAddress */ + ipAddress?: (string|null); + + /** ConnectionInfo publicIpAddress */ + publicIpAddress?: (string|null); + + /** ConnectionInfo instanceUid */ + instanceUid?: (string|null); + } + + /** Represents a ConnectionInfo. */ + class ConnectionInfo implements IConnectionInfo { + + /** + * Constructs a new ConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IConnectionInfo); + + /** ConnectionInfo name. */ + public name: string; + + /** ConnectionInfo ipAddress. */ + public ipAddress: string; + + /** ConnectionInfo publicIpAddress. */ + public publicIpAddress: string; + + /** ConnectionInfo instanceUid. */ + public instanceUid: string; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1.IConnectionInfo): google.cloud.alloydb.v1.ConnectionInfo; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ConnectionInfo; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ConnectionInfo; + + /** + * Verifies a ConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ConnectionInfo; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @param message ConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup displayName */ + displayName?: (string|null); + + /** Backup uid */ + uid?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup createCompletionTime */ + createCompletionTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup state */ + state?: (google.cloud.alloydb.v1.Backup.State|keyof typeof google.cloud.alloydb.v1.Backup.State|null); + + /** Backup type */ + type?: (google.cloud.alloydb.v1.Backup.Type|keyof typeof google.cloud.alloydb.v1.Backup.Type|null); + + /** Backup description */ + description?: (string|null); + + /** Backup clusterUid */ + clusterUid?: (string|null); + + /** Backup clusterName */ + clusterName?: (string|null); + + /** Backup reconciling */ + reconciling?: (boolean|null); + + /** Backup encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity */ + expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + + /** Backup tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup displayName. */ + public displayName: string; + + /** Backup uid. */ + public uid: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup createCompletionTime. */ + public createCompletionTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup state. */ + public state: (google.cloud.alloydb.v1.Backup.State|keyof typeof google.cloud.alloydb.v1.Backup.State); + + /** Backup type. */ + public type: (google.cloud.alloydb.v1.Backup.Type|keyof typeof google.cloud.alloydb.v1.Backup.Type); + + /** Backup description. */ + public description: string; + + /** Backup clusterUid. */ + public clusterUid: string; + + /** Backup clusterName. */ + public clusterName: string; + + /** Backup reconciling. */ + public reconciling: boolean; + + /** Backup encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); + + /** Backup etag. */ + public etag: string; + + /** Backup annotations. */ + public annotations: { [k: string]: string }; + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity. */ + public expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); + + /** Backup satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + + /** Backup tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.alloydb.v1.IBackup): google.cloud.alloydb.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** Properties of a QuantityBasedExpiry. */ + interface IQuantityBasedExpiry { + + /** QuantityBasedExpiry retentionCount */ + retentionCount?: (number|null); + + /** QuantityBasedExpiry totalRetentionCount */ + totalRetentionCount?: (number|null); + } + + /** Represents a QuantityBasedExpiry. */ + class QuantityBasedExpiry implements IQuantityBasedExpiry { + + /** + * Constructs a new QuantityBasedExpiry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry); + + /** QuantityBasedExpiry retentionCount. */ + public retentionCount: number; + + /** QuantityBasedExpiry totalRetentionCount. */ + public totalRetentionCount: number; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedExpiry instance + */ + public static create(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Verifies a QuantityBasedExpiry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedExpiry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @param message QuantityBasedExpiry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + CREATING = 2, + FAILED = 3, + DELETING = 4 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ON_DEMAND = 1, + AUTOMATED = 2, + CONTINUOUS = 3 + } + } + + /** Properties of a SupportedDatabaseFlag. */ + interface ISupportedDatabaseFlag { + + /** SupportedDatabaseFlag stringRestrictions */ + stringRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions */ + integerRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag recommendedStringValue */ + recommendedStringValue?: (string|null); + + /** SupportedDatabaseFlag recommendedIntegerValue */ + recommendedIntegerValue?: (google.protobuf.IInt64Value|null); + + /** SupportedDatabaseFlag name */ + name?: (string|null); + + /** SupportedDatabaseFlag flagName */ + flagName?: (string|null); + + /** SupportedDatabaseFlag valueType */ + valueType?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|null); + + /** SupportedDatabaseFlag acceptsMultipleValues */ + acceptsMultipleValues?: (boolean|null); + + /** SupportedDatabaseFlag supportedDbVersions */ + supportedDbVersions?: (google.cloud.alloydb.v1.DatabaseVersion[]|null); + + /** SupportedDatabaseFlag requiresDbRestart */ + requiresDbRestart?: (boolean|null); + + /** SupportedDatabaseFlag scope */ + scope?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null); + } + + /** Represents a SupportedDatabaseFlag. */ + class SupportedDatabaseFlag implements ISupportedDatabaseFlag { + + /** + * Constructs a new SupportedDatabaseFlag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISupportedDatabaseFlag); + + /** SupportedDatabaseFlag stringRestrictions. */ + public stringRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions. */ + public integerRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag recommendedStringValue. */ + public recommendedStringValue?: (string|null); + + /** SupportedDatabaseFlag recommendedIntegerValue. */ + public recommendedIntegerValue?: (google.protobuf.IInt64Value|null); + + /** SupportedDatabaseFlag name. */ + public name: string; + + /** SupportedDatabaseFlag flagName. */ + public flagName: string; + + /** SupportedDatabaseFlag valueType. */ + public valueType: (google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType); + + /** SupportedDatabaseFlag acceptsMultipleValues. */ + public acceptsMultipleValues: boolean; + + /** SupportedDatabaseFlag supportedDbVersions. */ + public supportedDbVersions: google.cloud.alloydb.v1.DatabaseVersion[]; + + /** SupportedDatabaseFlag requiresDbRestart. */ + public requiresDbRestart: boolean; + + /** SupportedDatabaseFlag scope. */ + public scope: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope); + + /** SupportedDatabaseFlag restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** SupportedDatabaseFlag recommendedValue. */ + public recommendedValue?: ("recommendedStringValue"|"recommendedIntegerValue"); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedDatabaseFlag instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISupportedDatabaseFlag): google.cloud.alloydb.v1.SupportedDatabaseFlag; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SupportedDatabaseFlag; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SupportedDatabaseFlag; + + /** + * Verifies a SupportedDatabaseFlag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedDatabaseFlag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SupportedDatabaseFlag; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @param message SupportedDatabaseFlag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SupportedDatabaseFlag { + + /** Properties of a StringRestrictions. */ + interface IStringRestrictions { + + /** StringRestrictions allowedValues */ + allowedValues?: (string[]|null); + } + + /** Represents a StringRestrictions. */ + class StringRestrictions implements IStringRestrictions { + + /** + * Constructs a new StringRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions); + + /** StringRestrictions allowedValues. */ + public allowedValues: string[]; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns StringRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; + + /** + * Verifies a StringRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @param message StringRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntegerRestrictions. */ + interface IIntegerRestrictions { + + /** IntegerRestrictions minValue */ + minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue */ + maxValue?: (google.protobuf.IInt64Value|null); + } + + /** Represents an IntegerRestrictions. */ + class IntegerRestrictions implements IIntegerRestrictions { + + /** + * Constructs a new IntegerRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions); + + /** IntegerRestrictions minValue. */ + public minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue. */ + public maxValue?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Verifies an IntegerRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @param message IntegerRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + FLOAT = 3, + NONE = 4 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + DATABASE = 1, + CONNECTION_POOL = 2 + } + } + + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User password */ + password?: (string|null); + + /** User databaseRoles */ + databaseRoles?: (string[]|null); + + /** User userType */ + userType?: (google.cloud.alloydb.v1.User.UserType|keyof typeof google.cloud.alloydb.v1.User.UserType|null); + + /** User keepExtraRoles */ + keepExtraRoles?: (boolean|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUser); + + /** User name. */ + public name: string; + + /** User password. */ + public password: string; + + /** User databaseRoles. */ + public databaseRoles: string[]; + + /** User userType. */ + public userType: (google.cloud.alloydb.v1.User.UserType|keyof typeof google.cloud.alloydb.v1.User.UserType); + + /** User keepExtraRoles. */ + public keepExtraRoles: boolean; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUser): google.cloud.alloydb.v1.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** UserType enum. */ + enum UserType { + USER_TYPE_UNSPECIFIED = 0, + ALLOYDB_BUILT_IN = 1, + ALLOYDB_IAM_USER = 2 + } + } + + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database charset */ + charset?: (string|null); + + /** Database collation */ + collation?: (string|null); + + /** Database characterType */ + characterType?: (string|null); + + /** Database databaseTemplate */ + databaseTemplate?: (string|null); + + /** Database isTemplateDatabase */ + isTemplateDatabase?: (boolean|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IDatabase); + + /** Database name. */ + public name: string; + + /** Database charset. */ + public charset: string; + + /** Database collation. */ + public collation: string; + + /** Database characterType. */ + public characterType: string; + + /** Database databaseTemplate. */ + public databaseTemplate: string; + + /** Database isTemplateDatabase. */ + public isTemplateDatabase?: (boolean|null); + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.cloud.alloydb.v1.IDatabase): google.cloud.alloydb.v1.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AlloyDBAdmin */ + class AlloyDBAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.alloydb.v1.IListClustersRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.alloydb.v1.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.alloydb.v1.IGetClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.alloydb.v1.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.alloydb.v1.ICreateClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.alloydb.v1.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.alloydb.v1.IUpdateClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.alloydb.v1.IUpdateClusterRequest): Promise; + + /** + * Calls ExportCluster. + * @param request ExportClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportCluster(request: google.cloud.alloydb.v1.IExportClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ExportClusterCallback): void; + + /** + * Calls ExportCluster. + * @param request ExportClusterRequest message or plain object + * @returns Promise + */ + public exportCluster(request: google.cloud.alloydb.v1.IExportClusterRequest): Promise; + + /** + * Calls ImportCluster. + * @param request ImportClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importCluster(request: google.cloud.alloydb.v1.IImportClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ImportClusterCallback): void; + + /** + * Calls ImportCluster. + * @param request ImportClusterRequest message or plain object + * @returns Promise + */ + public importCluster(request: google.cloud.alloydb.v1.IImportClusterRequest): Promise; + + /** + * Calls UpgradeCluster. + * @param request UpgradeClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public upgradeCluster(request: google.cloud.alloydb.v1.IUpgradeClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeClusterCallback): void; + + /** + * Calls UpgradeCluster. + * @param request UpgradeClusterRequest message or plain object + * @returns Promise + */ + public upgradeCluster(request: google.cloud.alloydb.v1.IUpgradeClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.alloydb.v1.IDeleteClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.alloydb.v1.IDeleteClusterRequest): Promise; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteCluster(request: google.cloud.alloydb.v1.IPromoteClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.PromoteClusterCallback): void; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @returns Promise + */ + public promoteCluster(request: google.cloud.alloydb.v1.IPromoteClusterRequest): Promise; + + /** + * Calls SwitchoverCluster. + * @param request SwitchoverClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public switchoverCluster(request: google.cloud.alloydb.v1.ISwitchoverClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverClusterCallback): void; + + /** + * Calls SwitchoverCluster. + * @param request SwitchoverClusterRequest message or plain object + * @returns Promise + */ + public switchoverCluster(request: google.cloud.alloydb.v1.ISwitchoverClusterRequest): Promise; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreCluster(request: google.cloud.alloydb.v1.IRestoreClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.RestoreClusterCallback): void; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @returns Promise + */ + public restoreCluster(request: google.cloud.alloydb.v1.IRestoreClusterRequest): Promise; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @returns Promise + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.alloydb.v1.IListInstancesRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.alloydb.v1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.alloydb.v1.IGetInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.alloydb.v1.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.alloydb.v1.ICreateInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.alloydb.v1.ICreateInstanceRequest): Promise; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @returns Promise + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest): Promise; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateInstances(request: google.cloud.alloydb.v1.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstancesCallback): void; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @returns Promise + */ + public batchCreateInstances(request: google.cloud.alloydb.v1.IBatchCreateInstancesRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.alloydb.v1.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.alloydb.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.alloydb.v1.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.alloydb.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public failoverInstance(request: google.cloud.alloydb.v1.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstanceCallback): void; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @returns Promise + */ + public failoverInstance(request: google.cloud.alloydb.v1.IFailoverInstanceRequest): Promise; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public injectFault(request: google.cloud.alloydb.v1.IInjectFaultRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.InjectFaultCallback): void; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @returns Promise + */ + public injectFault(request: google.cloud.alloydb.v1.IInjectFaultRequest): Promise; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.alloydb.v1.IRestartInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstanceCallback): void; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.alloydb.v1.IRestartInstanceRequest): Promise; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteSqlResponse + */ + public executeSql(request: google.cloud.alloydb.v1.IExecuteSqlRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSqlCallback): void; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeSql(request: google.cloud.alloydb.v1.IExecuteSqlRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.alloydb.v1.IListBackupsRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.alloydb.v1.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.alloydb.v1.IGetBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.alloydb.v1.IGetBackupRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.alloydb.v1.ICreateBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.alloydb.v1.ICreateBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.alloydb.v1.IUpdateBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.alloydb.v1.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.alloydb.v1.IDeleteBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.alloydb.v1.IDeleteBackupRequest): Promise; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @returns Promise + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest): Promise; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + */ + public generateClientCertificate(request: google.cloud.alloydb.v1.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificateCallback): void; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @returns Promise + */ + public generateClientCertificate(request: google.cloud.alloydb.v1.IGenerateClientCertificateRequest): Promise; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionInfo + */ + public getConnectionInfo(request: google.cloud.alloydb.v1.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfoCallback): void; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @returns Promise + */ + public getConnectionInfo(request: google.cloud.alloydb.v1.IGetConnectionInfoRequest): Promise; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse + */ + public listUsers(request: google.cloud.alloydb.v1.IListUsersRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListUsersCallback): void; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise + */ + public listUsers(request: google.cloud.alloydb.v1.IListUsersRequest): Promise; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public getUser(request: google.cloud.alloydb.v1.IGetUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetUserCallback): void; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise + */ + public getUser(request: google.cloud.alloydb.v1.IGetUserRequest): Promise; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public createUser(request: google.cloud.alloydb.v1.ICreateUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateUserCallback): void; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise + */ + public createUser(request: google.cloud.alloydb.v1.ICreateUserRequest): Promise; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public updateUser(request: google.cloud.alloydb.v1.IUpdateUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUserCallback): void; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise + */ + public updateUser(request: google.cloud.alloydb.v1.IUpdateUserRequest): Promise; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUser(request: google.cloud.alloydb.v1.IDeleteUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUserCallback): void; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.cloud.alloydb.v1.IDeleteUserRequest): Promise; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse + */ + public listDatabases(request: google.cloud.alloydb.v1.IListDatabasesRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabasesCallback): void; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @returns Promise + */ + public listDatabases(request: google.cloud.alloydb.v1.IListDatabasesRequest): Promise; + } + + namespace AlloyDBAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|exportCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|importCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|upgradeCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpgradeClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|promoteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|switchoverCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type SwitchoverClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|failoverInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|injectFault}. + * @param error Error, if any + * @param [response] Operation + */ + type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|executeSql}. + * @param error Error, if any + * @param [response] ExecuteSqlResponse + */ + type ExecuteSqlCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ExecuteSqlResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @param error Error, if any + * @param [response] ListSupportedDatabaseFlagsResponse + */ + type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|generateClientCertificate}. + * @param error Error, if any + * @param [response] GenerateClientCertificateResponse + */ + type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.GenerateClientCertificateResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getConnectionInfo}. + * @param error Error, if any + * @param [response] ConnectionInfo + */ + type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ConnectionInfo) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse + */ + type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListUsersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. + * @param error Error, if any + * @param [response] User + */ + type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. + * @param error Error, if any + * @param [response] User + */ + type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateUser}. + * @param error Error, if any + * @param [response] User + */ + type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteUser}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listDatabases}. + * @param error Error, if any + * @param [response] ListDatabasesResponse + */ + type ListDatabasesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListDatabasesResponse) => void; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListClustersRequest): google.cloud.alloydb.v1.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.alloydb.v1.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.alloydb.v1.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListClustersResponse): google.cloud.alloydb.v1.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + + /** GetClusterRequest view */ + view?: (google.cloud.alloydb.v1.ClusterView|keyof typeof google.cloud.alloydb.v1.ClusterView|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** GetClusterRequest view. */ + public view: (google.cloud.alloydb.v1.ClusterView|keyof typeof google.cloud.alloydb.v1.ClusterView); + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGetClusterRequest): google.cloud.alloydb.v1.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryClusterRequest. */ + interface ICreateSecondaryClusterRequest { + + /** CreateSecondaryClusterRequest parent */ + parent?: (string|null); + + /** CreateSecondaryClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateSecondaryClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** CreateSecondaryClusterRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryClusterRequest. */ + class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest); + + /** CreateSecondaryClusterRequest parent. */ + public parent: string; + + /** CreateSecondaryClusterRequest clusterId. */ + public clusterId: string; + + /** CreateSecondaryClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** CreateSecondaryClusterRequest requestId. */ + public requestId: string; + + /** CreateSecondaryClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateClusterRequest): google.cloud.alloydb.v1.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + + /** UpdateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateClusterRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** UpdateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateClusterRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpdateClusterRequest): google.cloud.alloydb.v1.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGcsDestination): google.cloud.alloydb.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportClusterRequest. */ + interface IExportClusterRequest { + + /** ExportClusterRequest gcsDestination */ + gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); + + /** ExportClusterRequest csvExportOptions */ + csvExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null); + + /** ExportClusterRequest sqlExportOptions */ + sqlExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null); + + /** ExportClusterRequest name */ + name?: (string|null); + + /** ExportClusterRequest database */ + database?: (string|null); + } + + /** Represents an ExportClusterRequest. */ + class ExportClusterRequest implements IExportClusterRequest { + + /** + * Constructs a new ExportClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IExportClusterRequest); + + /** ExportClusterRequest gcsDestination. */ + public gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); + + /** ExportClusterRequest csvExportOptions. */ + public csvExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null); + + /** ExportClusterRequest sqlExportOptions. */ + public sqlExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null); + + /** ExportClusterRequest name. */ + public name: string; + + /** ExportClusterRequest database. */ + public database: string; + + /** ExportClusterRequest destination. */ + public destination?: "gcsDestination"; + + /** ExportClusterRequest exportOptions. */ + public exportOptions?: ("csvExportOptions"|"sqlExportOptions"); + + /** + * Creates a new ExportClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IExportClusterRequest): google.cloud.alloydb.v1.ExportClusterRequest; + + /** + * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. + * @param message ExportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. + * @param message ExportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterRequest; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterRequest; + + /** + * Verifies an ExportClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterRequest; + + /** + * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. + * @param message ExportClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportClusterRequest { + + /** Properties of a CsvExportOptions. */ + interface ICsvExportOptions { + + /** CsvExportOptions selectQuery */ + selectQuery?: (string|null); + + /** CsvExportOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvExportOptions quoteCharacter */ + quoteCharacter?: (string|null); + + /** CsvExportOptions escapeCharacter */ + escapeCharacter?: (string|null); + } + + /** Represents a CsvExportOptions. */ + class CsvExportOptions implements ICsvExportOptions { + + /** + * Constructs a new CsvExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions); + + /** CsvExportOptions selectQuery. */ + public selectQuery: string; + + /** CsvExportOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvExportOptions quoteCharacter. */ + public quoteCharacter: string; + + /** CsvExportOptions escapeCharacter. */ + public escapeCharacter: string; + + /** + * Creates a new CsvExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvExportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; + + /** + * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @param message CsvExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @param message CsvExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; + + /** + * Verifies a CsvExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; + + /** + * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. + * @param message CsvExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlExportOptions. */ + interface ISqlExportOptions { + + /** SqlExportOptions tables */ + tables?: (string[]|null); + + /** SqlExportOptions schemaOnly */ + schemaOnly?: (boolean|null); + + /** SqlExportOptions cleanTargetObjects */ + cleanTargetObjects?: (boolean|null); + + /** SqlExportOptions ifExistTargetObjects */ + ifExistTargetObjects?: (boolean|null); + } + + /** Represents a SqlExportOptions. */ + class SqlExportOptions implements ISqlExportOptions { + + /** + * Constructs a new SqlExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions); + + /** SqlExportOptions tables. */ + public tables: string[]; + + /** SqlExportOptions schemaOnly. */ + public schemaOnly?: (boolean|null); + + /** SqlExportOptions cleanTargetObjects. */ + public cleanTargetObjects?: (boolean|null); + + /** SqlExportOptions ifExistTargetObjects. */ + public ifExistTargetObjects?: (boolean|null); + + /** + * Creates a new SqlExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlExportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; + + /** + * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @param message SqlExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @param message SqlExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; + + /** + * Verifies a SqlExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; + + /** + * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. + * @param message SqlExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportClusterResponse. */ + interface IExportClusterResponse { + + /** ExportClusterResponse gcsDestination */ + gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); + } + + /** Represents an ExportClusterResponse. */ + class ExportClusterResponse implements IExportClusterResponse { + + /** + * Constructs a new ExportClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IExportClusterResponse); + + /** ExportClusterResponse gcsDestination. */ + public gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); + + /** ExportClusterResponse destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new ExportClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IExportClusterResponse): google.cloud.alloydb.v1.ExportClusterResponse; + + /** + * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. + * @param message ExportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. + * @param message ExportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterResponse; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterResponse; + + /** + * Verifies an ExportClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterResponse; + + /** + * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. + * @param message ExportClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportClusterRequest. */ + interface IImportClusterRequest { + + /** ImportClusterRequest sqlImportOptions */ + sqlImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null); + + /** ImportClusterRequest csvImportOptions */ + csvImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null); + + /** ImportClusterRequest name */ + name?: (string|null); + + /** ImportClusterRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportClusterRequest database */ + database?: (string|null); + + /** ImportClusterRequest user */ + user?: (string|null); + } + + /** Represents an ImportClusterRequest. */ + class ImportClusterRequest implements IImportClusterRequest { + + /** + * Constructs a new ImportClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IImportClusterRequest); + + /** ImportClusterRequest sqlImportOptions. */ + public sqlImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null); + + /** ImportClusterRequest csvImportOptions. */ + public csvImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null); + + /** ImportClusterRequest name. */ + public name: string; + + /** ImportClusterRequest gcsUri. */ + public gcsUri: string; + + /** ImportClusterRequest database. */ + public database: string; + + /** ImportClusterRequest user. */ + public user: string; + + /** ImportClusterRequest importOptions. */ + public importOptions?: ("sqlImportOptions"|"csvImportOptions"); + + /** + * Creates a new ImportClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IImportClusterRequest): google.cloud.alloydb.v1.ImportClusterRequest; + + /** + * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. + * @param message ImportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. + * @param message ImportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterRequest; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterRequest; + + /** + * Verifies an ImportClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterRequest; + + /** + * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. + * @param message ImportClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ImportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportClusterRequest { + + /** Properties of a SqlImportOptions. */ + interface ISqlImportOptions { + } + + /** Represents a SqlImportOptions. */ + class SqlImportOptions implements ISqlImportOptions { + + /** + * Constructs a new SqlImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions); + + /** + * Creates a new SqlImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlImportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; + + /** + * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @param message SqlImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @param message SqlImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; + + /** + * Verifies a SqlImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; + + /** + * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. + * @param message SqlImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CsvImportOptions. */ + interface ICsvImportOptions { + + /** CsvImportOptions table */ + table?: (string|null); + + /** CsvImportOptions columns */ + columns?: (string[]|null); + + /** CsvImportOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvImportOptions quoteCharacter */ + quoteCharacter?: (string|null); + + /** CsvImportOptions escapeCharacter */ + escapeCharacter?: (string|null); + } + + /** Represents a CsvImportOptions. */ + class CsvImportOptions implements ICsvImportOptions { + + /** + * Constructs a new CsvImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions); + + /** CsvImportOptions table. */ + public table: string; + + /** CsvImportOptions columns. */ + public columns: string[]; + + /** CsvImportOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvImportOptions quoteCharacter. */ + public quoteCharacter: string; + + /** CsvImportOptions escapeCharacter. */ + public escapeCharacter: string; + + /** + * Creates a new CsvImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvImportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; + + /** + * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @param message CsvImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @param message CsvImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; + + /** + * Verifies a CsvImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; + + /** + * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. + * @param message CsvImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportClusterResponse. */ + interface IImportClusterResponse { + + /** ImportClusterResponse bytesDownloaded */ + bytesDownloaded?: (number|Long|string|null); + } + + /** Represents an ImportClusterResponse. */ + class ImportClusterResponse implements IImportClusterResponse { + + /** + * Constructs a new ImportClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IImportClusterResponse); + + /** ImportClusterResponse bytesDownloaded. */ + public bytesDownloaded: (number|Long|string); + + /** + * Creates a new ImportClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IImportClusterResponse): google.cloud.alloydb.v1.ImportClusterResponse; + + /** + * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. + * @param message ImportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. + * @param message ImportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterResponse; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterResponse; + + /** + * Verifies an ImportClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterResponse; + + /** + * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. + * @param message ImportClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ImportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterRequest. */ + interface IUpgradeClusterRequest { + + /** UpgradeClusterRequest name */ + name?: (string|null); + + /** UpgradeClusterRequest version */ + version?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + + /** UpgradeClusterRequest requestId */ + requestId?: (string|null); + + /** UpgradeClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpgradeClusterRequest etag */ + etag?: (string|null); + } + + /** Represents an UpgradeClusterRequest. */ + class UpgradeClusterRequest implements IUpgradeClusterRequest { + + /** + * Constructs a new UpgradeClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpgradeClusterRequest); + + /** UpgradeClusterRequest name. */ + public name: string; + + /** UpgradeClusterRequest version. */ + public version: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + + /** UpgradeClusterRequest requestId. */ + public requestId: string; + + /** UpgradeClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpgradeClusterRequest etag. */ + public etag: string; + + /** + * Creates a new UpgradeClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpgradeClusterRequest): google.cloud.alloydb.v1.UpgradeClusterRequest; + + /** + * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. + * @param message UpgradeClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. + * @param message UpgradeClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterRequest; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterRequest; + + /** + * Verifies an UpgradeClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterRequest; + + /** + * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. + * @param message UpgradeClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterResponse. */ + interface IUpgradeClusterResponse { + + /** UpgradeClusterResponse status */ + status?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); + + /** UpgradeClusterResponse message */ + message?: (string|null); + + /** UpgradeClusterResponse clusterUpgradeDetails */ + clusterUpgradeDetails?: (google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails[]|null); + } + + /** Represents an UpgradeClusterResponse. */ + class UpgradeClusterResponse implements IUpgradeClusterResponse { + + /** + * Constructs a new UpgradeClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpgradeClusterResponse); + + /** UpgradeClusterResponse status. */ + public status: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); + + /** UpgradeClusterResponse message. */ + public message: string; + + /** UpgradeClusterResponse clusterUpgradeDetails. */ + public clusterUpgradeDetails: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails[]; + + /** + * Creates a new UpgradeClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpgradeClusterResponse): google.cloud.alloydb.v1.UpgradeClusterResponse; + + /** + * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. + * @param message UpgradeClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. + * @param message UpgradeClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse; + + /** + * Verifies an UpgradeClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse; + + /** + * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. + * @param message UpgradeClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeClusterResponse { + + /** Properties of a StageInfo. */ + interface IStageInfo { + + /** StageInfo stage */ + stage?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null); + + /** StageInfo status */ + status?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); + + /** StageInfo logsUrl */ + logsUrl?: (string|null); + } + + /** Represents a StageInfo. */ + class StageInfo implements IStageInfo { + + /** + * Constructs a new StageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo); + + /** StageInfo stage. */ + public stage: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage); + + /** StageInfo status. */ + public status: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); + + /** StageInfo logsUrl. */ + public logsUrl: string; + + /** + * Creates a new StageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StageInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; + + /** + * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @param message StageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @param message StageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; + + /** + * Decodes a StageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; + + /** + * Verifies a StageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; + + /** + * Creates a plain object from a StageInfo message. Also converts values to other types if specified. + * @param message StageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceUpgradeDetails. */ + interface IInstanceUpgradeDetails { + + /** InstanceUpgradeDetails name */ + name?: (string|null); + + /** InstanceUpgradeDetails upgradeStatus */ + upgradeStatus?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); + + /** InstanceUpgradeDetails instanceType */ + instanceType?: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType|null); + } + + /** Represents an InstanceUpgradeDetails. */ + class InstanceUpgradeDetails implements IInstanceUpgradeDetails { + + /** + * Constructs a new InstanceUpgradeDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails); + + /** InstanceUpgradeDetails name. */ + public name: string; + + /** InstanceUpgradeDetails upgradeStatus. */ + public upgradeStatus: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); + + /** InstanceUpgradeDetails instanceType. */ + public instanceType: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType); + + /** + * Creates a new InstanceUpgradeDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceUpgradeDetails instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @param message InstanceUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @param message InstanceUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Verifies an InstanceUpgradeDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceUpgradeDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. + * @param message InstanceUpgradeDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceUpgradeDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceUpgradeDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterUpgradeDetails. */ + interface IClusterUpgradeDetails { + + /** ClusterUpgradeDetails name */ + name?: (string|null); + + /** ClusterUpgradeDetails upgradeStatus */ + upgradeStatus?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); + + /** ClusterUpgradeDetails clusterType */ + clusterType?: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType|null); + + /** ClusterUpgradeDetails databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + + /** ClusterUpgradeDetails stageInfo */ + stageInfo?: (google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo[]|null); + + /** ClusterUpgradeDetails instanceUpgradeDetails */ + instanceUpgradeDetails?: (google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails[]|null); + } + + /** Represents a ClusterUpgradeDetails. */ + class ClusterUpgradeDetails implements IClusterUpgradeDetails { + + /** + * Constructs a new ClusterUpgradeDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails); + + /** ClusterUpgradeDetails name. */ + public name: string; + + /** ClusterUpgradeDetails upgradeStatus. */ + public upgradeStatus: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); + + /** ClusterUpgradeDetails clusterType. */ + public clusterType: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType); + + /** ClusterUpgradeDetails databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + + /** ClusterUpgradeDetails stageInfo. */ + public stageInfo: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo[]; + + /** ClusterUpgradeDetails instanceUpgradeDetails. */ + public instanceUpgradeDetails: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails[]; + + /** + * Creates a new ClusterUpgradeDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterUpgradeDetails instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @param message ClusterUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @param message ClusterUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Verifies a ClusterUpgradeDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterUpgradeDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. + * @param message ClusterUpgradeDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterUpgradeDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterUpgradeDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + NOT_STARTED = 4, + IN_PROGRESS = 5, + SUCCESS = 1, + FAILED = 2, + PARTIAL_SUCCESS = 3, + CANCEL_IN_PROGRESS = 6, + CANCELLED = 7 + } + + /** Stage enum. */ + enum Stage { + STAGE_UNSPECIFIED = 0, + ALLOYDB_PRECHECK = 1, + PG_UPGRADE_CHECK = 2, + PREPARE_FOR_UPGRADE = 5, + PRIMARY_INSTANCE_UPGRADE = 3, + READ_POOL_INSTANCES_UPGRADE = 4, + ROLLBACK = 6, + CLEANUP = 7 + } + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + + /** DeleteClusterRequest etag */ + etag?: (string|null); + + /** DeleteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteClusterRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** DeleteClusterRequest etag. */ + public etag: string; + + /** DeleteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteClusterRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IDeleteClusterRequest): google.cloud.alloydb.v1.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SwitchoverClusterRequest. */ + interface ISwitchoverClusterRequest { + + /** SwitchoverClusterRequest name */ + name?: (string|null); + + /** SwitchoverClusterRequest requestId */ + requestId?: (string|null); + + /** SwitchoverClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a SwitchoverClusterRequest. */ + class SwitchoverClusterRequest implements ISwitchoverClusterRequest { + + /** + * Constructs a new SwitchoverClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISwitchoverClusterRequest); + + /** SwitchoverClusterRequest name. */ + public name: string; + + /** SwitchoverClusterRequest requestId. */ + public requestId: string; + + /** SwitchoverClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new SwitchoverClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SwitchoverClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISwitchoverClusterRequest): google.cloud.alloydb.v1.SwitchoverClusterRequest; + + /** + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. + * @param message SwitchoverClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. + * @param message SwitchoverClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SwitchoverClusterRequest; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SwitchoverClusterRequest; + + /** + * Verifies a SwitchoverClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwitchoverClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SwitchoverClusterRequest; + + /** + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. + * @param message SwitchoverClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SwitchoverClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwitchoverClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SwitchoverClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteClusterRequest. */ + interface IPromoteClusterRequest { + + /** PromoteClusterRequest name */ + name?: (string|null); + + /** PromoteClusterRequest requestId */ + requestId?: (string|null); + + /** PromoteClusterRequest etag */ + etag?: (string|null); + + /** PromoteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a PromoteClusterRequest. */ + class PromoteClusterRequest implements IPromoteClusterRequest { + + /** + * Constructs a new PromoteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IPromoteClusterRequest); + + /** PromoteClusterRequest name. */ + public name: string; + + /** PromoteClusterRequest requestId. */ + public requestId: string; + + /** PromoteClusterRequest etag. */ + public etag: string; + + /** PromoteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IPromoteClusterRequest): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Verifies a PromoteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.PromoteClusterRequest; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @param message PromoteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreClusterRequest. */ + interface IRestoreClusterRequest { + + /** RestoreClusterRequest backupSource */ + backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource */ + continuousBackupSource?: (google.cloud.alloydb.v1.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent */ + parent?: (string|null); + + /** RestoreClusterRequest clusterId */ + clusterId?: (string|null); + + /** RestoreClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** RestoreClusterRequest requestId */ + requestId?: (string|null); + + /** RestoreClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestoreClusterRequest. */ + class RestoreClusterRequest implements IRestoreClusterRequest { + + /** + * Constructs a new RestoreClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IRestoreClusterRequest); + + /** RestoreClusterRequest backupSource. */ + public backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource. */ + public continuousBackupSource?: (google.cloud.alloydb.v1.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent. */ + public parent: string; + + /** RestoreClusterRequest clusterId. */ + public clusterId: string; + + /** RestoreClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1.ICluster|null); + + /** RestoreClusterRequest requestId. */ + public requestId: string; + + /** RestoreClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** RestoreClusterRequest source. */ + public source?: ("backupSource"|"continuousBackupSource"); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IRestoreClusterRequest): google.cloud.alloydb.v1.RestoreClusterRequest; + + /** + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestoreClusterRequest; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.RestoreClusterRequest; + + /** + * Verifies a RestoreClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.RestoreClusterRequest; + + /** + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @param message RestoreClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListInstancesRequest): google.cloud.alloydb.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListInstancesResponse): google.cloud.alloydb.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + + /** GetInstanceRequest view */ + view?: (google.cloud.alloydb.v1.InstanceView|keyof typeof google.cloud.alloydb.v1.InstanceView|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** GetInstanceRequest view. */ + public view: (google.cloud.alloydb.v1.InstanceView|keyof typeof google.cloud.alloydb.v1.InstanceView); + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGetInstanceRequest): google.cloud.alloydb.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** CreateInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** CreateInstanceRequest requestId. */ + public requestId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateInstanceRequest): google.cloud.alloydb.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryInstanceRequest. */ + interface ICreateSecondaryInstanceRequest { + + /** CreateSecondaryInstanceRequest parent */ + parent?: (string|null); + + /** CreateSecondaryInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateSecondaryInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryInstanceRequest. */ + class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest); + + /** CreateSecondaryInstanceRequest parent. */ + public parent: string; + + /** CreateSecondaryInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateSecondaryInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId. */ + public requestId: string; + + /** CreateSecondaryInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequests. */ + interface ICreateInstanceRequests { + + /** CreateInstanceRequests createInstanceRequests */ + createInstanceRequests?: (google.cloud.alloydb.v1.ICreateInstanceRequest[]|null); + } + + /** Represents a CreateInstanceRequests. */ + class CreateInstanceRequests implements ICreateInstanceRequests { + + /** + * Constructs a new CreateInstanceRequests. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateInstanceRequests); + + /** CreateInstanceRequests createInstanceRequests. */ + public createInstanceRequests: google.cloud.alloydb.v1.ICreateInstanceRequest[]; + + /** + * Creates a new CreateInstanceRequests instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequests instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateInstanceRequests): google.cloud.alloydb.v1.CreateInstanceRequests; + + /** + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateInstanceRequests; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateInstanceRequests; + + /** + * Verifies a CreateInstanceRequests message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequests + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateInstanceRequests; + + /** + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @param message CreateInstanceRequests + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequests to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequests + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesRequest. */ + interface IBatchCreateInstancesRequest { + + /** BatchCreateInstancesRequest parent */ + parent?: (string|null); + + /** BatchCreateInstancesRequest requests */ + requests?: (google.cloud.alloydb.v1.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a BatchCreateInstancesRequest. */ + class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { + + /** + * Constructs a new BatchCreateInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesRequest); + + /** BatchCreateInstancesRequest parent. */ + public parent: string; + + /** BatchCreateInstancesRequest requests. */ + public requests?: (google.cloud.alloydb.v1.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId. */ + public requestId: string; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesRequest): google.cloud.alloydb.v1.BatchCreateInstancesRequest; + + /** + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstancesRequest; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstancesRequest; + + /** + * Verifies a BatchCreateInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstancesRequest; + + /** + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @param message BatchCreateInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesResponse. */ + interface IBatchCreateInstancesResponse { + + /** BatchCreateInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1.IInstance[]|null); + } + + /** Represents a BatchCreateInstancesResponse. */ + class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { + + /** + * Constructs a new BatchCreateInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesResponse); + + /** BatchCreateInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1.IInstance[]; + + /** + * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesResponse): google.cloud.alloydb.v1.BatchCreateInstancesResponse; + + /** + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstancesResponse; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstancesResponse; + + /** + * Verifies a BatchCreateInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstancesResponse; + + /** + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @param message BatchCreateInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesMetadata. */ + interface IBatchCreateInstancesMetadata { + + /** BatchCreateInstancesMetadata instanceTargets */ + instanceTargets?: (string[]|null); + + /** BatchCreateInstancesMetadata instanceStatuses */ + instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1.IBatchCreateInstanceStatus }|null); + } + + /** Represents a BatchCreateInstancesMetadata. */ + class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { + + /** + * Constructs a new BatchCreateInstancesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata); + + /** BatchCreateInstancesMetadata instanceTargets. */ + public instanceTargets: string[]; + + /** BatchCreateInstancesMetadata instanceStatuses. */ + public instanceStatuses: { [k: string]: google.cloud.alloydb.v1.IBatchCreateInstanceStatus }; + + /** + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; + + /** + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; + + /** + * Verifies a BatchCreateInstancesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; + + /** + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @param message BatchCreateInstancesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstanceStatus. */ + interface IBatchCreateInstanceStatus { + + /** BatchCreateInstanceStatus state */ + state?: (google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|null); + + /** BatchCreateInstanceStatus errorMsg */ + errorMsg?: (string|null); + + /** BatchCreateInstanceStatus error */ + error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type */ + type?: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType|null); + } + + /** Represents a BatchCreateInstanceStatus. */ + class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { + + /** + * Constructs a new BatchCreateInstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstanceStatus); + + /** BatchCreateInstanceStatus state. */ + public state: (google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1.BatchCreateInstanceStatus.State); + + /** BatchCreateInstanceStatus errorMsg. */ + public errorMsg: string; + + /** BatchCreateInstanceStatus error. */ + public error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type. */ + public type: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType); + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstanceStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstanceStatus): google.cloud.alloydb.v1.BatchCreateInstanceStatus; + + /** + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstanceStatus; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstanceStatus; + + /** + * Verifies a BatchCreateInstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstanceStatus; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @param message BatchCreateInstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchCreateInstanceStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING_CREATE = 1, + READY = 2, + CREATING = 3, + DELETING = 4, + FAILED = 5, + ROLLED_BACK = 6 + } + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** UpdateInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateInstanceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1.IInstance|null); + + /** UpdateInstanceRequest requestId. */ + public requestId: string; + + /** UpdateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateInstanceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpdateInstanceRequest): google.cloud.alloydb.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest requestId */ + requestId?: (string|null); + + /** DeleteInstanceRequest etag */ + etag?: (string|null); + + /** DeleteInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest requestId. */ + public requestId: string; + + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** DeleteInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IDeleteInstanceRequest): google.cloud.alloydb.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FailoverInstanceRequest. */ + interface IFailoverInstanceRequest { + + /** FailoverInstanceRequest name */ + name?: (string|null); + + /** FailoverInstanceRequest requestId */ + requestId?: (string|null); + + /** FailoverInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a FailoverInstanceRequest. */ + class FailoverInstanceRequest implements IFailoverInstanceRequest { + + /** + * Constructs a new FailoverInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IFailoverInstanceRequest); + + /** FailoverInstanceRequest name. */ + public name: string; + + /** FailoverInstanceRequest requestId. */ + public requestId: string; + + /** FailoverInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FailoverInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IFailoverInstanceRequest): google.cloud.alloydb.v1.FailoverInstanceRequest; + + /** + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.FailoverInstanceRequest; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.FailoverInstanceRequest; + + /** + * Verifies a FailoverInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FailoverInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.FailoverInstanceRequest; + + /** + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @param message FailoverInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FailoverInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FailoverInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InjectFaultRequest. */ + interface IInjectFaultRequest { + + /** InjectFaultRequest faultType */ + faultType?: (google.cloud.alloydb.v1.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1.InjectFaultRequest.FaultType|null); + + /** InjectFaultRequest name */ + name?: (string|null); + + /** InjectFaultRequest requestId */ + requestId?: (string|null); + + /** InjectFaultRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an InjectFaultRequest. */ + class InjectFaultRequest implements IInjectFaultRequest { + + /** + * Constructs a new InjectFaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IInjectFaultRequest); + + /** InjectFaultRequest faultType. */ + public faultType: (google.cloud.alloydb.v1.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1.InjectFaultRequest.FaultType); + + /** InjectFaultRequest name. */ + public name: string; + + /** InjectFaultRequest requestId. */ + public requestId: string; + + /** InjectFaultRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InjectFaultRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IInjectFaultRequest): google.cloud.alloydb.v1.InjectFaultRequest; + + /** + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.InjectFaultRequest; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.InjectFaultRequest; + + /** + * Verifies an InjectFaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InjectFaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.InjectFaultRequest; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @param message InjectFaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InjectFaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InjectFaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InjectFaultRequest { + + /** FaultType enum. */ + enum FaultType { + FAULT_TYPE_UNSPECIFIED = 0, + STOP_VM = 1 + } + } + + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + + /** RestartInstanceRequest requestId */ + requestId?: (string|null); + + /** RestartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** RestartInstanceRequest nodeIds */ + nodeIds?: (string[]|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { + + /** + * Constructs a new RestartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest); + + /** RestartInstanceRequest name. */ + public name: string; + + /** RestartInstanceRequest requestId. */ + public requestId: string; + + /** RestartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** RestartInstanceRequest nodeIds. */ + public nodeIds: string[]; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest): google.cloud.alloydb.v1.RestartInstanceRequest; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestartInstanceRequest; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.RestartInstanceRequest; + + /** + * Verifies a RestartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.RestartInstanceRequest; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlRequest. */ + interface IExecuteSqlRequest { + + /** ExecuteSqlRequest password */ + password?: (string|null); + + /** ExecuteSqlRequest instance */ + instance?: (string|null); + + /** ExecuteSqlRequest database */ + database?: (string|null); + + /** ExecuteSqlRequest user */ + user?: (string|null); + + /** ExecuteSqlRequest sqlStatement */ + sqlStatement?: (string|null); + + /** ExecuteSqlRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an ExecuteSqlRequest. */ + class ExecuteSqlRequest implements IExecuteSqlRequest { + + /** + * Constructs a new ExecuteSqlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IExecuteSqlRequest); + + /** ExecuteSqlRequest password. */ + public password?: (string|null); + + /** ExecuteSqlRequest instance. */ + public instance: string; + + /** ExecuteSqlRequest database. */ + public database: string; + + /** ExecuteSqlRequest user. */ + public user: string; + + /** ExecuteSqlRequest sqlStatement. */ + public sqlStatement: string; + + /** ExecuteSqlRequest validateOnly. */ + public validateOnly: boolean; + + /** ExecuteSqlRequest userCredential. */ + public userCredential?: "password"; + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IExecuteSqlRequest): google.cloud.alloydb.v1.ExecuteSqlRequest; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExecuteSqlRequest; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExecuteSqlRequest; + + /** + * Verifies an ExecuteSqlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExecuteSqlRequest; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @param message ExecuteSqlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlResponse. */ + interface IExecuteSqlResponse { + + /** ExecuteSqlResponse sqlResults */ + sqlResults?: (google.cloud.alloydb.v1.ISqlResult[]|null); + + /** ExecuteSqlResponse metadata */ + metadata?: (google.cloud.alloydb.v1.IExecuteSqlMetadata|null); + } + + /** Represents an ExecuteSqlResponse. */ + class ExecuteSqlResponse implements IExecuteSqlResponse { + + /** + * Constructs a new ExecuteSqlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IExecuteSqlResponse); + + /** ExecuteSqlResponse sqlResults. */ + public sqlResults: google.cloud.alloydb.v1.ISqlResult[]; + + /** ExecuteSqlResponse metadata. */ + public metadata?: (google.cloud.alloydb.v1.IExecuteSqlMetadata|null); + + /** + * Creates a new ExecuteSqlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IExecuteSqlResponse): google.cloud.alloydb.v1.ExecuteSqlResponse; + + /** + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. + * @param message ExecuteSqlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. + * @param message ExecuteSqlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExecuteSqlResponse; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExecuteSqlResponse; + + /** + * Verifies an ExecuteSqlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExecuteSqlResponse; + + /** + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. + * @param message ExecuteSqlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExecuteSqlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlMetadata. */ + interface IExecuteSqlMetadata { + + /** ExecuteSqlMetadata message */ + message?: (string|null); + + /** ExecuteSqlMetadata partialResult */ + partialResult?: (boolean|null); + + /** ExecuteSqlMetadata sqlStatementExecutionDuration */ + sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); + + /** ExecuteSqlMetadata status */ + status?: (google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|null); + } + + /** Represents an ExecuteSqlMetadata. */ + class ExecuteSqlMetadata implements IExecuteSqlMetadata { + + /** + * Constructs a new ExecuteSqlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IExecuteSqlMetadata); + + /** ExecuteSqlMetadata message. */ + public message: string; + + /** ExecuteSqlMetadata partialResult. */ + public partialResult: boolean; + + /** ExecuteSqlMetadata sqlStatementExecutionDuration. */ + public sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); + + /** ExecuteSqlMetadata status. */ + public status: (google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1.ExecuteSqlMetadata.Status); + + /** + * Creates a new ExecuteSqlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1.IExecuteSqlMetadata): google.cloud.alloydb.v1.ExecuteSqlMetadata; + + /** + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. + * @param message ExecuteSqlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. + * @param message ExecuteSqlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExecuteSqlMetadata; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExecuteSqlMetadata; + + /** + * Verifies an ExecuteSqlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExecuteSqlMetadata; + + /** + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. + * @param message ExecuteSqlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ExecuteSqlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteSqlMetadata { + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + OK = 1, + PARTIAL = 2, + ERROR = 3 + } + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListBackupsRequest): google.cloud.alloydb.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.alloydb.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.alloydb.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListBackupsResponse): google.cloud.alloydb.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGetBackupRequest): google.cloud.alloydb.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1.IBackup|null); + + /** CreateBackupRequest requestId */ + requestId?: (string|null); + + /** CreateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1.IBackup|null); + + /** CreateBackupRequest requestId. */ + public requestId: string; + + /** CreateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateBackupRequest): google.cloud.alloydb.v1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1.IBackup|null); + + /** UpdateBackupRequest requestId */ + requestId?: (string|null); + + /** UpdateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1.IBackup|null); + + /** UpdateBackupRequest requestId. */ + public requestId: string; + + /** UpdateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpdateBackupRequest): google.cloud.alloydb.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** DeleteBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IDeleteBackupRequest): google.cloud.alloydb.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSupportedDatabaseFlagsRequest. */ + interface IListSupportedDatabaseFlagsRequest { + + /** ListSupportedDatabaseFlagsRequest parent */ + parent?: (string|null); + + /** ListSupportedDatabaseFlagsRequest pageSize */ + pageSize?: (number|null); + + /** ListSupportedDatabaseFlagsRequest pageToken */ + pageToken?: (string|null); + + /** ListSupportedDatabaseFlagsRequest scope */ + scope?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null); + } + + /** Represents a ListSupportedDatabaseFlagsRequest. */ + class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { + + /** + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest); + + /** ListSupportedDatabaseFlagsRequest parent. */ + public parent: string; + + /** ListSupportedDatabaseFlagsRequest pageSize. */ + public pageSize: number; + + /** ListSupportedDatabaseFlagsRequest pageToken. */ + public pageToken: string; + + /** ListSupportedDatabaseFlagsRequest scope. */ + public scope: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope); + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSupportedDatabaseFlagsRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; + + /** + * Verifies a ListSupportedDatabaseFlagsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSupportedDatabaseFlagsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSupportedDatabaseFlagsResponse. */ + interface IListSupportedDatabaseFlagsResponse { + + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ + supportedDatabaseFlags?: (google.cloud.alloydb.v1.ISupportedDatabaseFlag[]|null); + + /** ListSupportedDatabaseFlagsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSupportedDatabaseFlagsResponse. */ + class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { + + /** + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse); + + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ + public supportedDatabaseFlags: google.cloud.alloydb.v1.ISupportedDatabaseFlag[]; + + /** ListSupportedDatabaseFlagsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSupportedDatabaseFlagsResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; + + /** + * Verifies a ListSupportedDatabaseFlagsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSupportedDatabaseFlagsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateClientCertificateRequest. */ + interface IGenerateClientCertificateRequest { + + /** GenerateClientCertificateRequest parent */ + parent?: (string|null); + + /** GenerateClientCertificateRequest requestId */ + requestId?: (string|null); + + /** GenerateClientCertificateRequest certDuration */ + certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey */ + publicKey?: (string|null); + + /** GenerateClientCertificateRequest useMetadataExchange */ + useMetadataExchange?: (boolean|null); + } + + /** Represents a GenerateClientCertificateRequest. */ + class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { + + /** + * Constructs a new GenerateClientCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateRequest); + + /** GenerateClientCertificateRequest parent. */ + public parent: string; + + /** GenerateClientCertificateRequest requestId. */ + public requestId: string; + + /** GenerateClientCertificateRequest certDuration. */ + public certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey. */ + public publicKey: string; + + /** GenerateClientCertificateRequest useMetadataExchange. */ + public useMetadataExchange: boolean; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateClientCertificateRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateRequest): google.cloud.alloydb.v1.GenerateClientCertificateRequest; + + /** + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GenerateClientCertificateRequest; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GenerateClientCertificateRequest; + + /** + * Verifies a GenerateClientCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateClientCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GenerateClientCertificateRequest; + + /** + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @param message GenerateClientCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateClientCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateClientCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateClientCertificateResponse. */ + interface IGenerateClientCertificateResponse { + + /** GenerateClientCertificateResponse pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** GenerateClientCertificateResponse caCert */ + caCert?: (string|null); + } + + /** Represents a GenerateClientCertificateResponse. */ + class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { + + /** + * Constructs a new GenerateClientCertificateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateResponse); + + /** GenerateClientCertificateResponse pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** GenerateClientCertificateResponse caCert. */ + public caCert: string; + + /** + * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateClientCertificateResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateResponse): google.cloud.alloydb.v1.GenerateClientCertificateResponse; + + /** + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GenerateClientCertificateResponse; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GenerateClientCertificateResponse; + + /** + * Verifies a GenerateClientCertificateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateClientCertificateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GenerateClientCertificateResponse; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @param message GenerateClientCertificateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionInfoRequest. */ + interface IGetConnectionInfoRequest { + + /** GetConnectionInfoRequest parent */ + parent?: (string|null); + + /** GetConnectionInfoRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetConnectionInfoRequest. */ + class GetConnectionInfoRequest implements IGetConnectionInfoRequest { + + /** + * Constructs a new GetConnectionInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGetConnectionInfoRequest); + + /** GetConnectionInfoRequest parent. */ + public parent: string; + + /** GetConnectionInfoRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionInfoRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGetConnectionInfoRequest): google.cloud.alloydb.v1.GetConnectionInfoRequest; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetConnectionInfoRequest; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetConnectionInfoRequest; + + /** + * Verifies a GetConnectionInfoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionInfoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetConnectionInfoRequest; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @param message GetConnectionInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata batchCreateInstancesMetadata */ + batchCreateInstancesMetadata?: (google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null); + + /** OperationMetadata upgradeClusterStatus */ + upgradeClusterStatus?: (google.cloud.alloydb.v1.IUpgradeClusterStatus|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IOperationMetadata); + + /** OperationMetadata batchCreateInstancesMetadata. */ + public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null); + + /** OperationMetadata upgradeClusterStatus. */ + public upgradeClusterStatus?: (google.cloud.alloydb.v1.IUpgradeClusterStatus|null); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata requestSpecific. */ + public requestSpecific?: ("batchCreateInstancesMetadata"|"upgradeClusterStatus"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1.IOperationMetadata): google.cloud.alloydb.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterStatus. */ + interface IUpgradeClusterStatus { + + /** UpgradeClusterStatus state */ + state?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); + + /** UpgradeClusterStatus cancellable */ + cancellable?: (boolean|null); + + /** UpgradeClusterStatus sourceVersion */ + sourceVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + + /** UpgradeClusterStatus targetVersion */ + targetVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + + /** UpgradeClusterStatus stages */ + stages?: (google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus[]|null); + } + + /** Represents an UpgradeClusterStatus. */ + class UpgradeClusterStatus implements IUpgradeClusterStatus { + + /** + * Constructs a new UpgradeClusterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpgradeClusterStatus); + + /** UpgradeClusterStatus state. */ + public state: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); + + /** UpgradeClusterStatus cancellable. */ + public cancellable: boolean; + + /** UpgradeClusterStatus sourceVersion. */ + public sourceVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + + /** UpgradeClusterStatus targetVersion. */ + public targetVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + + /** UpgradeClusterStatus stages. */ + public stages: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus[]; + + /** + * Creates a new UpgradeClusterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpgradeClusterStatus): google.cloud.alloydb.v1.UpgradeClusterStatus; + + /** + * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. + * @param message UpgradeClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. + * @param message UpgradeClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus; + + /** + * Verifies an UpgradeClusterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus; + + /** + * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. + * @param message UpgradeClusterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeClusterStatus { + + /** Properties of a StageStatus. */ + interface IStageStatus { + + /** StageStatus readPoolInstancesUpgrade */ + readPoolInstancesUpgrade?: (google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); + + /** StageStatus stage */ + stage?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null); + + /** StageStatus state */ + state?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); + + /** StageStatus schedule */ + schedule?: (google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null); + } + + /** Represents a StageStatus. */ + class StageStatus implements IStageStatus { + + /** + * Constructs a new StageStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus); + + /** StageStatus readPoolInstancesUpgrade. */ + public readPoolInstancesUpgrade?: (google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); + + /** StageStatus stage. */ + public stage: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage); + + /** StageStatus state. */ + public state: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); + + /** StageStatus schedule. */ + public schedule?: (google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null); + + /** StageStatus stageSpecificStatus. */ + public stageSpecificStatus?: "readPoolInstancesUpgrade"; + + /** + * Creates a new StageStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns StageStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; + + /** + * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @param message StageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @param message StageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; + + /** + * Decodes a StageStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; + + /** + * Verifies a StageStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; + + /** + * Creates a plain object from a StageStatus message. Also converts values to other types if specified. + * @param message StageStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StageStatus { + + /** Properties of a StageSchedule. */ + interface IStageSchedule { + + /** StageSchedule estimatedStartTime */ + estimatedStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualStartTime */ + actualStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule estimatedEndTime */ + estimatedEndTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualEndTime */ + actualEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StageSchedule. */ + class StageSchedule implements IStageSchedule { + + /** + * Constructs a new StageSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule); + + /** StageSchedule estimatedStartTime. */ + public estimatedStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualStartTime. */ + public actualStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule estimatedEndTime. */ + public estimatedEndTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualEndTime. */ + public actualEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StageSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns StageSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @param message StageSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @param message StageSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Decodes a StageSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Verifies a StageSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. + * @param message StageSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadPoolInstancesUpgradeStageStatus. */ + interface IReadPoolInstancesUpgradeStageStatus { + + /** ReadPoolInstancesUpgradeStageStatus upgradeStats */ + upgradeStats?: (google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); + } + + /** Represents a ReadPoolInstancesUpgradeStageStatus. */ + class ReadPoolInstancesUpgradeStageStatus implements IReadPoolInstancesUpgradeStageStatus { + + /** + * Constructs a new ReadPoolInstancesUpgradeStageStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus); + + /** ReadPoolInstancesUpgradeStageStatus upgradeStats. */ + public upgradeStats?: (google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); + + /** + * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolInstancesUpgradeStageStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Verifies a ReadPoolInstancesUpgradeStageStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolInstancesUpgradeStageStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. + * @param message ReadPoolInstancesUpgradeStageStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolInstancesUpgradeStageStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadPoolInstancesUpgradeStageStatus { + + /** Properties of a Stats. */ + interface IStats { + + /** Stats notStarted */ + notStarted?: (number|null); + + /** Stats ongoing */ + ongoing?: (number|null); + + /** Stats success */ + success?: (number|null); + + /** Stats failed */ + failed?: (number|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats); + + /** Stats notStarted. */ + public notStarted: number; + + /** Stats ongoing. */ + public ongoing: number; + + /** Stats success. */ + public success: number; + + /** Stats failed. */ + public failed: number; + + /** + * Creates a new Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Stats instance + */ + public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Verifies a Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { + + /** ListUsersRequest parent */ + parent?: (string|null); + + /** ListUsersRequest pageSize */ + pageSize?: (number|null); + + /** ListUsersRequest pageToken */ + pageToken?: (string|null); + + /** ListUsersRequest filter */ + filter?: (string|null); + + /** ListUsersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { + + /** + * Constructs a new ListUsersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListUsersRequest); + + /** ListUsersRequest parent. */ + public parent: string; + + /** ListUsersRequest pageSize. */ + public pageSize: number; + + /** ListUsersRequest pageToken. */ + public pageToken: string; + + /** ListUsersRequest filter. */ + public filter: string; + + /** ListUsersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListUsersRequest): google.cloud.alloydb.v1.ListUsersRequest; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListUsersRequest; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListUsersRequest; + + /** + * Verifies a ListUsersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListUsersRequest; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { + + /** ListUsersResponse users */ + users?: (google.cloud.alloydb.v1.IUser[]|null); + + /** ListUsersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUsersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { + + /** + * Constructs a new ListUsersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListUsersResponse); + + /** ListUsersResponse users. */ + public users: google.cloud.alloydb.v1.IUser[]; + + /** ListUsersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUsersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListUsersResponse): google.cloud.alloydb.v1.ListUsersResponse; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListUsersResponse; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListUsersResponse; + + /** + * Verifies a ListUsersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListUsersResponse; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { + + /** GetUserRequest name */ + name?: (string|null); + } + + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { + + /** + * Constructs a new GetUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IGetUserRequest); + + /** GetUserRequest name. */ + public name: string; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IGetUserRequest): google.cloud.alloydb.v1.GetUserRequest; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetUserRequest; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetUserRequest; + + /** + * Verifies a GetUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetUserRequest; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { + + /** CreateUserRequest parent */ + parent?: (string|null); + + /** CreateUserRequest userId */ + userId?: (string|null); + + /** CreateUserRequest user */ + user?: (google.cloud.alloydb.v1.IUser|null); + + /** CreateUserRequest requestId */ + requestId?: (string|null); + + /** CreateUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { + + /** + * Constructs a new CreateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ICreateUserRequest); + + /** CreateUserRequest parent. */ + public parent: string; + + /** CreateUserRequest userId. */ + public userId: string; + + /** CreateUserRequest user. */ + public user?: (google.cloud.alloydb.v1.IUser|null); + + /** CreateUserRequest requestId. */ + public requestId: string; + + /** CreateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.ICreateUserRequest): google.cloud.alloydb.v1.CreateUserRequest; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateUserRequest; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateUserRequest; + + /** + * Verifies a CreateUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateUserRequest; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { + + /** UpdateUserRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserRequest user */ + user?: (google.cloud.alloydb.v1.IUser|null); + + /** UpdateUserRequest requestId */ + requestId?: (string|null); + + /** UpdateUserRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateUserRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { + + /** + * Constructs a new UpdateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IUpdateUserRequest); + + /** UpdateUserRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserRequest user. */ + public user?: (google.cloud.alloydb.v1.IUser|null); + + /** UpdateUserRequest requestId. */ + public requestId: string; + + /** UpdateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateUserRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IUpdateUserRequest): google.cloud.alloydb.v1.UpdateUserRequest; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateUserRequest; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateUserRequest; + + /** + * Verifies an UpdateUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateUserRequest; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { + + /** DeleteUserRequest name */ + name?: (string|null); + + /** DeleteUserRequest requestId */ + requestId?: (string|null); + + /** DeleteUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { + + /** + * Constructs a new DeleteUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IDeleteUserRequest); + + /** DeleteUserRequest name. */ + public name: string; + + /** DeleteUserRequest requestId. */ + public requestId: string; + + /** DeleteUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IDeleteUserRequest): google.cloud.alloydb.v1.DeleteUserRequest; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteUserRequest; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteUserRequest; + + /** + * Verifies a DeleteUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteUserRequest; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesRequest. */ + interface IListDatabasesRequest { + + /** ListDatabasesRequest parent */ + parent?: (string|null); + + /** ListDatabasesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabasesRequest pageToken */ + pageToken?: (string|null); + + /** ListDatabasesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListDatabasesRequest. */ + class ListDatabasesRequest implements IListDatabasesRequest { + + /** + * Constructs a new ListDatabasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListDatabasesRequest); + + /** ListDatabasesRequest parent. */ + public parent: string; + + /** ListDatabasesRequest pageSize. */ + public pageSize: number; + + /** ListDatabasesRequest pageToken. */ + public pageToken: string; + + /** ListDatabasesRequest filter. */ + public filter: string; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListDatabasesRequest): google.cloud.alloydb.v1.ListDatabasesRequest; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListDatabasesRequest; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListDatabasesRequest; + + /** + * Verifies a ListDatabasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListDatabasesRequest; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @param message ListDatabasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesResponse. */ + interface IListDatabasesResponse { + + /** ListDatabasesResponse databases */ + databases?: (google.cloud.alloydb.v1.IDatabase[]|null); + + /** ListDatabasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabasesResponse. */ + class ListDatabasesResponse implements IListDatabasesResponse { + + /** + * Constructs a new ListDatabasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.IListDatabasesResponse); + + /** ListDatabasesResponse databases. */ + public databases: google.cloud.alloydb.v1.IDatabase[]; + + /** ListDatabasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1.IListDatabasesResponse): google.cloud.alloydb.v1.ListDatabasesResponse; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListDatabasesResponse; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListDatabasesResponse; + + /** + * Verifies a ListDatabasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListDatabasesResponse; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @param message ListDatabasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResult. */ + interface ISqlResult { + + /** SqlResult columns */ + columns?: (google.cloud.alloydb.v1.ISqlResultColumn[]|null); + + /** SqlResult rows */ + rows?: (google.cloud.alloydb.v1.ISqlResultRow[]|null); + } + + /** Represents a SqlResult. */ + class SqlResult implements ISqlResult { + + /** + * Constructs a new SqlResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISqlResult); + + /** SqlResult columns. */ + public columns: google.cloud.alloydb.v1.ISqlResultColumn[]; + + /** SqlResult rows. */ + public rows: google.cloud.alloydb.v1.ISqlResultRow[]; + + /** + * Creates a new SqlResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResult instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISqlResult): google.cloud.alloydb.v1.SqlResult; + + /** + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. + * @param message SqlResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. + * @param message SqlResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResult; + + /** + * Decodes a SqlResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResult; + + /** + * Verifies a SqlResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResult; + + /** + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. + * @param message SqlResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SqlResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultColumn. */ + interface ISqlResultColumn { + + /** SqlResultColumn name */ + name?: (string|null); + + /** SqlResultColumn type */ + type?: (string|null); + } + + /** Represents a SqlResultColumn. */ + class SqlResultColumn implements ISqlResultColumn { + + /** + * Constructs a new SqlResultColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISqlResultColumn); + + /** SqlResultColumn name. */ + public name: string; + + /** SqlResultColumn type. */ + public type: string; + + /** + * Creates a new SqlResultColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultColumn instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISqlResultColumn): google.cloud.alloydb.v1.SqlResultColumn; + + /** + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. + * @param message SqlResultColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. + * @param message SqlResultColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResultColumn; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResultColumn; + + /** + * Verifies a SqlResultColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResultColumn; + + /** + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. + * @param message SqlResultColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SqlResultColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultRow. */ + interface ISqlResultRow { + + /** SqlResultRow values */ + values?: (google.cloud.alloydb.v1.ISqlResultValue[]|null); + } + + /** Represents a SqlResultRow. */ + class SqlResultRow implements ISqlResultRow { + + /** + * Constructs a new SqlResultRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISqlResultRow); + + /** SqlResultRow values. */ + public values: google.cloud.alloydb.v1.ISqlResultValue[]; + + /** + * Creates a new SqlResultRow instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultRow instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISqlResultRow): google.cloud.alloydb.v1.SqlResultRow; + + /** + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. + * @param message SqlResultRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. + * @param message SqlResultRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResultRow; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResultRow; + + /** + * Verifies a SqlResultRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResultRow; + + /** + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. + * @param message SqlResultRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SqlResultRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultValue. */ + interface ISqlResultValue { + + /** SqlResultValue value */ + value?: (string|null); + + /** SqlResultValue nullValue */ + nullValue?: (boolean|null); + } + + /** Represents a SqlResultValue. */ + class SqlResultValue implements ISqlResultValue { + + /** + * Constructs a new SqlResultValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.ISqlResultValue); + + /** SqlResultValue value. */ + public value?: (string|null); + + /** SqlResultValue nullValue. */ + public nullValue?: (boolean|null); + + /** + * Creates a new SqlResultValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultValue instance + */ + public static create(properties?: google.cloud.alloydb.v1.ISqlResultValue): google.cloud.alloydb.v1.SqlResultValue; + + /** + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. + * @param message SqlResultValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. + * @param message SqlResultValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResultValue; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResultValue; + + /** + * Verifies a SqlResultValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResultValue; + + /** + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. + * @param message SqlResultValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.SqlResultValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Properties of a CloudSQLBackupRunSource. */ + interface ICloudSQLBackupRunSource { + + /** CloudSQLBackupRunSource project */ + project?: (string|null); + + /** CloudSQLBackupRunSource instanceId */ + instanceId?: (string|null); + + /** CloudSQLBackupRunSource backupRunId */ + backupRunId?: (number|Long|string|null); + } + + /** Represents a CloudSQLBackupRunSource. */ + class CloudSQLBackupRunSource implements ICloudSQLBackupRunSource { + + /** + * Constructs a new CloudSQLBackupRunSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource); + + /** CloudSQLBackupRunSource project. */ + public project: string; + + /** CloudSQLBackupRunSource instanceId. */ + public instanceId: string; + + /** CloudSQLBackupRunSource backupRunId. */ + public backupRunId: (number|Long|string); + + /** + * Creates a new CloudSQLBackupRunSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSQLBackupRunSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; + + /** + * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. + * @param message CloudSQLBackupRunSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. + * @param message CloudSQLBackupRunSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; + + /** + * Verifies a CloudSQLBackupRunSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSQLBackupRunSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; + + /** + * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. + * @param message CloudSQLBackupRunSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSQLBackupRunSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSQLBackupRunSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AlloyDBCSQLAdmin */ + class AlloyDBCSQLAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBCSQLAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBCSQLAdmin; + + /** + * Calls RestoreFromCloudSQL. + * @param request RestoreFromCloudSQLRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreFromCloudSQL(request: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback): void; + + /** + * Calls RestoreFromCloudSQL. + * @param request RestoreFromCloudSQLRequest message or plain object + * @returns Promise + */ + public restoreFromCloudSQL(request: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest): Promise; + } + + namespace AlloyDBCSQLAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin|restoreFromCloudSQL}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreFromCloudSQLCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a RestoreFromCloudSQLRequest. */ + interface IRestoreFromCloudSQLRequest { + + /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource */ + cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); + + /** RestoreFromCloudSQLRequest parent */ + parent?: (string|null); + + /** RestoreFromCloudSQLRequest clusterId */ + clusterId?: (string|null); + + /** RestoreFromCloudSQLRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + } + + /** Represents a RestoreFromCloudSQLRequest. */ + class RestoreFromCloudSQLRequest implements IRestoreFromCloudSQLRequest { + + /** + * Constructs a new RestoreFromCloudSQLRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest); + + /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource. */ + public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); + + /** RestoreFromCloudSQLRequest parent. */ + public parent: string; + + /** RestoreFromCloudSQLRequest clusterId. */ + public clusterId: string; + + /** RestoreFromCloudSQLRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** RestoreFromCloudSQLRequest source. */ + public source?: "cloudsqlBackupRunSource"; + + /** + * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreFromCloudSQLRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. + * @param message RestoreFromCloudSQLRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. + * @param message RestoreFromCloudSQLRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; + + /** + * Verifies a RestoreFromCloudSQLRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreFromCloudSQLRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; + + /** + * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. + * @param message RestoreFromCloudSQLRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreFromCloudSQLRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreFromCloudSQLRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InstanceView enum. */ + enum InstanceView { + INSTANCE_VIEW_UNSPECIFIED = 0, + INSTANCE_VIEW_BASIC = 1, + INSTANCE_VIEW_FULL = 2 + } + + /** ClusterView enum. */ + enum ClusterView { + CLUSTER_VIEW_UNSPECIFIED = 0, + CLUSTER_VIEW_BASIC = 1, + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + } + + /** DatabaseVersion enum. */ + enum DatabaseVersion { + DATABASE_VERSION_UNSPECIFIED = 0, + POSTGRES_13 = 1, + POSTGRES_14 = 2, + POSTGRES_15 = 3, + POSTGRES_16 = 4, + POSTGRES_17 = 5, + POSTGRES_18 = 6 + } + + /** SubscriptionType enum. */ + enum SubscriptionType { + SUBSCRIPTION_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + TRIAL = 2 + } + + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword user */ + user?: (string|null); + + /** UserPassword password */ + password?: (string|null); + } + + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { + + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUserPassword); + + /** UserPassword user. */ + public user: string; + + /** UserPassword password. */ + public password: string; + + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUserPassword): google.cloud.alloydb.v1alpha.UserPassword; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UserPassword; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UserPassword; + + /** + * Verifies a UserPassword message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UserPassword; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MigrationSource. */ + interface IMigrationSource { + + /** MigrationSource hostPort */ + hostPort?: (string|null); + + /** MigrationSource referenceId */ + referenceId?: (string|null); + + /** MigrationSource sourceType */ + sourceType?: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null); + } + + /** Represents a MigrationSource. */ + class MigrationSource implements IMigrationSource { + + /** + * Constructs a new MigrationSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IMigrationSource); + + /** MigrationSource hostPort. */ + public hostPort: string; + + /** MigrationSource referenceId. */ + public referenceId: string; + + /** MigrationSource sourceType. */ + public sourceType: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType); + + /** + * Creates a new MigrationSource instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IMigrationSource): google.cloud.alloydb.v1alpha.MigrationSource; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MigrationSource; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MigrationSource; + + /** + * Verifies a MigrationSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MigrationSource; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @param message MigrationSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationSource { + + /** MigrationSourceType enum. */ + enum MigrationSourceType { + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, + DMS = 1 + } + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig): google.cloud.alloydb.v1alpha.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null); + + /** EncryptionInfo kmsKeyVersions */ + kmsKeyVersions?: (string[]|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type); + + /** EncryptionInfo kmsKeyVersions. */ + public kmsKeyVersions: string[]; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo): google.cloud.alloydb.v1alpha.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig sslMode */ + sslMode?: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode|null); + + /** SslConfig caSource */ + caSource?: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISslConfig); + + /** SslConfig sslMode. */ + public sslMode: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode); + + /** SslConfig caSource. */ + public caSource: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource); + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISslConfig): google.cloud.alloydb.v1alpha.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SslConfig; + + /** + * Verifies a SslConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** SslMode enum. */ + enum SslMode { + SSL_MODE_UNSPECIFIED = 0, + SSL_MODE_ALLOW = 1, + SSL_MODE_REQUIRE = 2, + SSL_MODE_VERIFY_CA = 3, + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, + ENCRYPTED_ONLY = 5 + } + + /** CaSource enum. */ + enum CaSource { + CA_SOURCE_UNSPECIFIED = 0, + CA_SOURCE_MANAGED = 1 + } + } + + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { + + /** AutomatedBackupPolicy weeklySchedule */ + weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention */ + timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention */ + quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled */ + enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow */ + backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location */ + location?: (string|null); + + /** AutomatedBackupPolicy labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy); + + /** AutomatedBackupPolicy weeklySchedule. */ + public weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention. */ + public timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention. */ + public quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled. */ + public enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow. */ + public backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location. */ + public location: string; + + /** AutomatedBackupPolicy labels. */ + public labels: { [k: string]: string }; + + /** AutomatedBackupPolicy schedule. */ + public schedule?: "weeklySchedule"; + + /** AutomatedBackupPolicy retention. */ + public retention?: ("timeBasedRetention"|"quantityBasedRetention"); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedBackupPolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + + /** + * Verifies an AutomatedBackupPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedBackupPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutomatedBackupPolicy { + + /** Properties of a WeeklySchedule. */ + interface IWeeklySchedule { + + /** WeeklySchedule startTimes */ + startTimes?: (google.type.ITimeOfDay[]|null); + + /** WeeklySchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + } + + /** Represents a WeeklySchedule. */ + class WeeklySchedule implements IWeeklySchedule { + + /** + * Constructs a new WeeklySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule); + + /** WeeklySchedule startTimes. */ + public startTimes: google.type.ITimeOfDay[]; + + /** WeeklySchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklySchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Verifies a WeeklySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @param message WeeklySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeeklySchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeBasedRetention. */ + interface ITimeBasedRetention { + + /** TimeBasedRetention retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a TimeBasedRetention. */ + class TimeBasedRetention implements ITimeBasedRetention { + + /** + * Constructs a new TimeBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention); + + /** TimeBasedRetention retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Verifies a TimeBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @param message TimeBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuantityBasedRetention. */ + interface IQuantityBasedRetention { + + /** QuantityBasedRetention count */ + count?: (number|null); + } + + /** Represents a QuantityBasedRetention. */ + class QuantityBasedRetention implements IQuantityBasedRetention { + + /** + * Constructs a new QuantityBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention); + + /** QuantityBasedRetention count. */ + public count: number; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Verifies a QuantityBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @param message QuantityBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ContinuousBackupConfig. */ + interface IContinuousBackupConfig { + + /** ContinuousBackupConfig enabled */ + enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays */ + recoveryWindowDays?: (number|null); + + /** ContinuousBackupConfig encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + } + + /** Represents a ContinuousBackupConfig. */ + class ContinuousBackupConfig implements IContinuousBackupConfig { + + /** + * Constructs a new ContinuousBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig); + + /** ContinuousBackupConfig enabled. */ + public enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays. */ + public recoveryWindowDays: number; + + /** ContinuousBackupConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + + /** + * Verifies a ContinuousBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @param message ContinuousBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupInfo. */ + interface IContinuousBackupInfo { + + /** ContinuousBackupInfo encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime */ + enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule */ + schedule?: (google.type.DayOfWeek[]|null); + + /** ContinuousBackupInfo earliestRestorableTime */ + earliestRestorableTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupInfo. */ + class ContinuousBackupInfo implements IContinuousBackupInfo { + + /** + * Constructs a new ContinuousBackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo); + + /** ContinuousBackupInfo encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime. */ + public enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule. */ + public schedule: google.type.DayOfWeek[]; + + /** ContinuousBackupInfo earliestRestorableTime. */ + public earliestRestorableTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + + /** + * Verifies a ContinuousBackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @param message ContinuousBackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupSource. */ + interface IBackupSource { + + /** BackupSource backupUid */ + backupUid?: (string|null); + + /** BackupSource backupName */ + backupName?: (string|null); + } + + /** Represents a BackupSource. */ + class BackupSource implements IBackupSource { + + /** + * Constructs a new BackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBackupSource); + + /** BackupSource backupUid. */ + public backupUid: string; + + /** BackupSource backupName. */ + public backupName: string; + + /** + * Creates a new BackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBackupSource): google.cloud.alloydb.v1alpha.BackupSource; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BackupSource; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BackupSource; + + /** + * Verifies a BackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BackupSource; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @param message BackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupSource. */ + interface IContinuousBackupSource { + + /** ContinuousBackupSource cluster */ + cluster?: (string|null); + + /** ContinuousBackupSource pointInTime */ + pointInTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupSource. */ + class ContinuousBackupSource implements IContinuousBackupSource { + + /** + * Constructs a new ContinuousBackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource); + + /** ContinuousBackupSource cluster. */ + public cluster: string; + + /** ContinuousBackupSource pointInTime. */ + public pointInTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + + /** + * Verifies a ContinuousBackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupSource; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @param message ContinuousBackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenanceUpdatePolicy. */ + interface IMaintenanceUpdatePolicy { + + /** MaintenanceUpdatePolicy maintenanceWindows */ + maintenanceWindows?: (google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); + + /** MaintenanceUpdatePolicy denyMaintenancePeriods */ + denyMaintenancePeriods?: (google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]|null); + } + + /** Represents a MaintenanceUpdatePolicy. */ + class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy); + + /** MaintenanceUpdatePolicy maintenanceWindows. */ + public maintenanceWindows: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow[]; + + /** MaintenanceUpdatePolicy denyMaintenancePeriods. */ + public denyMaintenancePeriods: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceUpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceUpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @param message MaintenanceUpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MaintenanceUpdatePolicy { + + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { + + /** MaintenanceWindow day */ + day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** MaintenanceWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { + + /** + * Constructs a new MaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow); + + /** MaintenanceWindow day. */ + public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** MaintenanceWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceWindow instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Verifies a MaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DenyMaintenancePeriod. */ + interface IDenyMaintenancePeriod { + + /** DenyMaintenancePeriod startDate */ + startDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod endDate */ + endDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod time */ + time?: (google.type.ITimeOfDay|null); + } + + /** Represents a DenyMaintenancePeriod. */ + class DenyMaintenancePeriod implements IDenyMaintenancePeriod { + + /** + * Constructs a new DenyMaintenancePeriod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod); + + /** DenyMaintenancePeriod startDate. */ + public startDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod endDate. */ + public endDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod time. */ + public time?: (google.type.ITimeOfDay|null); + + /** + * Creates a new DenyMaintenancePeriod instance using the specified properties. + * @param [properties] Properties to set + * @returns DenyMaintenancePeriod instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @param message DenyMaintenancePeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @param message DenyMaintenancePeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Verifies a DenyMaintenancePeriod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DenyMaintenancePeriod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. + * @param message DenyMaintenancePeriod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DenyMaintenancePeriod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DenyMaintenancePeriod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { + + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MaintenanceSchedule. */ + class MaintenanceSchedule implements IMaintenanceSchedule { + + /** + * Constructs a new MaintenanceSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IMaintenanceSchedule); + + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IMaintenanceSchedule): google.cloud.alloydb.v1alpha.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceSchedule; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceSchedule; + + /** + * Verifies a MaintenanceSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceSchedule; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @param message MaintenanceSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); + + /** Cluster cloudsqlBackupRunSource */ + cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); + + /** Cluster name */ + name?: (string|null); + + /** Cluster displayName */ + displayName?: (string|null); + + /** Cluster uid */ + uid?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster state */ + state?: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State|null); + + /** Cluster clusterType */ + clusterType?: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType|null); + + /** Cluster databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null); + + /** Cluster network */ + network?: (string|null); + + /** Cluster etag */ + etag?: (string|null); + + /** Cluster annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Cluster reconciling */ + reconciling?: (boolean|null); + + /** Cluster initialUser */ + initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); + + /** Cluster automatedBackupPolicy */ + automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig */ + sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + + /** Cluster encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** Cluster encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** Cluster continuousBackupConfig */ + continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo */ + continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig */ + secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig */ + primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); + + /** Cluster satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** Cluster satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Cluster pscConfig */ + pscConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null); + + /** Cluster maintenanceUpdatePolicy */ + maintenanceUpdatePolicy?: (google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null); + + /** Cluster geminiConfig */ + geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null); + + /** Cluster subscriptionType */ + subscriptionType?: (google.cloud.alloydb.v1alpha.SubscriptionType|keyof typeof google.cloud.alloydb.v1alpha.SubscriptionType|null); + + /** Cluster trialMetadata */ + trialMetadata?: (google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null); + + /** Cluster tags */ + tags?: ({ [k: string]: string }|null); + + /** Cluster serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** Cluster dataplexConfig */ + dataplexConfig?: (google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICluster); + + /** Cluster backupSource. */ + public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** Cluster migrationSource. */ + public migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); + + /** Cluster cloudsqlBackupRunSource. */ + public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); + + /** Cluster name. */ + public name: string; + + /** Cluster displayName. */ + public displayName: string; + + /** Cluster uid. */ + public uid: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster state. */ + public state: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State); + + /** Cluster clusterType. */ + public clusterType: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType); + + /** Cluster databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null); + + /** Cluster network. */ + public network: string; + + /** Cluster etag. */ + public etag: string; + + /** Cluster annotations. */ + public annotations: { [k: string]: string }; + + /** Cluster reconciling. */ + public reconciling: boolean; + + /** Cluster initialUser. */ + public initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); + + /** Cluster automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + + /** Cluster encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** Cluster encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** Cluster continuousBackupConfig. */ + public continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo. */ + public continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig. */ + public secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig. */ + public primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); + + /** Cluster satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** Cluster satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Cluster pscConfig. */ + public pscConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null); + + /** Cluster maintenanceUpdatePolicy. */ + public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null); + + /** Cluster geminiConfig. */ + public geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null); + + /** Cluster subscriptionType. */ + public subscriptionType: (google.cloud.alloydb.v1alpha.SubscriptionType|keyof typeof google.cloud.alloydb.v1alpha.SubscriptionType); + + /** Cluster trialMetadata. */ + public trialMetadata?: (google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null); + + /** Cluster tags. */ + public tags: { [k: string]: string }; + + /** Cluster serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** Cluster dataplexConfig. */ + public dataplexConfig?: (google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null); + + /** Cluster source. */ + public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICluster): google.cloud.alloydb.v1alpha.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecondaryConfig. */ + interface ISecondaryConfig { + + /** SecondaryConfig primaryClusterName */ + primaryClusterName?: (string|null); + } + + /** Represents a SecondaryConfig. */ + class SecondaryConfig implements ISecondaryConfig { + + /** + * Constructs a new SecondaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig); + + /** SecondaryConfig primaryClusterName. */ + public primaryClusterName: string; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecondaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + + /** + * Verifies a SecondaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecondaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @param message SecondaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecondaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecondaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrimaryConfig. */ + interface IPrimaryConfig { + + /** PrimaryConfig secondaryClusterNames */ + secondaryClusterNames?: (string[]|null); + } + + /** Represents a PrimaryConfig. */ + class PrimaryConfig implements IPrimaryConfig { + + /** + * Constructs a new PrimaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig); + + /** PrimaryConfig secondaryClusterNames. */ + public secondaryClusterNames: string[]; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + + /** + * Verifies a PrimaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @param message PrimaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrimaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrimaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscConfig. */ + interface IPscConfig { + + /** PscConfig pscEnabled */ + pscEnabled?: (boolean|null); + + /** PscConfig serviceOwnedProjectNumber */ + serviceOwnedProjectNumber?: (number|Long|string|null); + } + + /** Represents a PscConfig. */ + class PscConfig implements IPscConfig { + + /** + * Constructs a new PscConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IPscConfig); + + /** PscConfig pscEnabled. */ + public pscEnabled: boolean; + + /** PscConfig serviceOwnedProjectNumber. */ + public serviceOwnedProjectNumber: (number|Long|string); + + /** + * Creates a new PscConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IPscConfig): google.cloud.alloydb.v1alpha.Cluster.PscConfig; + + /** + * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. + * @param message PscConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. + * @param message PscConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.PscConfig; + + /** + * Decodes a PscConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.PscConfig; + + /** + * Verifies a PscConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.PscConfig; + + /** + * Creates a plain object from a PscConfig message. Also converts values to other types if specified. + * @param message PscConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.PscConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrialMetadata. */ + interface ITrialMetadata { + + /** TrialMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata upgradeTime */ + upgradeTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata graceEndTime */ + graceEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TrialMetadata. */ + class TrialMetadata implements ITrialMetadata { + + /** + * Constructs a new TrialMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata); + + /** TrialMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata upgradeTime. */ + public upgradeTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata graceEndTime. */ + public graceEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TrialMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; + + /** + * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. + * @param message TrialMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. + * @param message TrialMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; + + /** + * Verifies a TrialMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; + + /** + * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. + * @param message TrialMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.TrialMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataplexConfig. */ + interface IDataplexConfig { + + /** DataplexConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a DataplexConfig. */ + class DataplexConfig implements IDataplexConfig { + + /** + * Constructs a new DataplexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig); + + /** DataplexConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataplexConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Verifies a DataplexConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataplexConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @param message DataplexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataplexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataplexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + EMPTY = 3, + CREATING = 4, + DELETING = 5, + FAILED = 6, + BOOTSTRAPPING = 7, + MAINTENANCE = 8, + PROMOTING = 9 + } + + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + SECONDARY = 2 + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance uid */ + uid?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance state */ + state?: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State|null); + + /** Instance instanceType */ + instanceType?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); + + /** Instance machineConfig */ + machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); + + /** Instance availabilityType */ + availabilityType?: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null); + + /** Instance gceZone */ + gceZone?: (string|null); + + /** Instance databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** Instance writableNode */ + writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); + + /** Instance nodes */ + nodes?: (google.cloud.alloydb.v1alpha.Instance.INode[]|null); + + /** Instance queryInsightsConfig */ + queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance observabilityConfig */ + observabilityConfig?: (google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null); + + /** Instance readPoolConfig */ + readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); + + /** Instance ipAddress */ + ipAddress?: (string|null); + + /** Instance publicIpAddress */ + publicIpAddress?: (string|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance updatePolicy */ + updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); + + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null); + + /** Instance satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance pscInstanceConfig */ + pscInstanceConfig?: (google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null); + + /** Instance networkConfig */ + networkConfig?: (google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null); + + /** Instance geminiConfig */ + geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null); + + /** Instance outboundPublicIpAddresses */ + outboundPublicIpAddresses?: (string[]|null); + + /** Instance activationPolicy */ + activationPolicy?: (google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|null); + + /** Instance connectionPoolConfig */ + connectionPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null); + + /** Instance gcaConfig */ + gcaConfig?: (google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance uid. */ + public uid: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance state. */ + public state: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State); + + /** Instance instanceType. */ + public instanceType: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); + + /** Instance machineConfig. */ + public machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); + + /** Instance availabilityType. */ + public availabilityType: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType); + + /** Instance gceZone. */ + public gceZone: string; + + /** Instance databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** Instance writableNode. */ + public writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); + + /** Instance nodes. */ + public nodes: google.cloud.alloydb.v1alpha.Instance.INode[]; + + /** Instance queryInsightsConfig. */ + public queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance observabilityConfig. */ + public observabilityConfig?: (google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null); + + /** Instance readPoolConfig. */ + public readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); + + /** Instance ipAddress. */ + public ipAddress: string; + + /** Instance publicIpAddress. */ + public publicIpAddress: string; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance updatePolicy. */ + public updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); + + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null); + + /** Instance satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** Instance satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Instance pscInstanceConfig. */ + public pscInstanceConfig?: (google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null); + + /** Instance networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null); + + /** Instance geminiConfig. */ + public geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null); + + /** Instance outboundPublicIpAddresses. */ + public outboundPublicIpAddresses: string[]; + + /** Instance activationPolicy. */ + public activationPolicy: (google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1alpha.Instance.ActivationPolicy); + + /** Instance connectionPoolConfig. */ + public connectionPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null); + + /** Instance gcaConfig. */ + public gcaConfig?: (google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IInstance): google.cloud.alloydb.v1alpha.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Properties of a MachineConfig. */ + interface IMachineConfig { + + /** MachineConfig cpuCount */ + cpuCount?: (number|null); + + /** MachineConfig machineType */ + machineType?: (string|null); + } + + /** Represents a MachineConfig. */ + class MachineConfig implements IMachineConfig { + + /** + * Constructs a new MachineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig); + + /** MachineConfig cpuCount. */ + public cpuCount: number; + + /** MachineConfig machineType. */ + public machineType: string; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + + /** + * Verifies a MachineConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.MachineConfig; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @param message MachineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Node. */ + interface INode { + + /** Node zoneId */ + zoneId?: (string|null); + + /** Node id */ + id?: (string|null); + + /** Node ip */ + ip?: (string|null); + + /** Node state */ + state?: (string|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.INode); + + /** Node zoneId. */ + public zoneId: string; + + /** Node id. */ + public id: string; + + /** Node ip. */ + public ip: string; + + /** Node state. */ + public state: string; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.INode): google.cloud.alloydb.v1alpha.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryInsightsInstanceConfig. */ + interface IQueryInsightsInstanceConfig { + + /** QueryInsightsInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); + + /** QueryInsightsInstanceConfig recordClientAddress */ + recordClientAddress?: (boolean|null); + + /** QueryInsightsInstanceConfig queryStringLength */ + queryStringLength?: (number|null); + + /** QueryInsightsInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + } + + /** Represents a QueryInsightsInstanceConfig. */ + class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig); + + /** QueryInsightsInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); + + /** QueryInsightsInstanceConfig recordClientAddress. */ + public recordClientAddress?: (boolean|null); + + /** QueryInsightsInstanceConfig queryStringLength. */ + public queryStringLength: number; + + /** QueryInsightsInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInsightsInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInsightsInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @param message QueryInsightsInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObservabilityInstanceConfig. */ + interface IObservabilityInstanceConfig { + + /** ObservabilityInstanceConfig enabled */ + enabled?: (boolean|null); + + /** ObservabilityInstanceConfig preserveComments */ + preserveComments?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEvents */ + trackWaitEvents?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEventTypes */ + trackWaitEventTypes?: (boolean|null); + + /** ObservabilityInstanceConfig maxQueryStringLength */ + maxQueryStringLength?: (number|null); + + /** ObservabilityInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); + + /** ObservabilityInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + + /** ObservabilityInstanceConfig trackActiveQueries */ + trackActiveQueries?: (boolean|null); + + /** ObservabilityInstanceConfig trackClientAddress */ + trackClientAddress?: (boolean|null); + + /** ObservabilityInstanceConfig assistiveExperiencesEnabled */ + assistiveExperiencesEnabled?: (boolean|null); + } + + /** Represents an ObservabilityInstanceConfig. */ + class ObservabilityInstanceConfig implements IObservabilityInstanceConfig { + + /** + * Constructs a new ObservabilityInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig); + + /** ObservabilityInstanceConfig enabled. */ + public enabled?: (boolean|null); + + /** ObservabilityInstanceConfig preserveComments. */ + public preserveComments?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEvents. */ + public trackWaitEvents?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEventTypes. */ + public trackWaitEventTypes?: (boolean|null); + + /** ObservabilityInstanceConfig maxQueryStringLength. */ + public maxQueryStringLength?: (number|null); + + /** ObservabilityInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); + + /** ObservabilityInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); + + /** ObservabilityInstanceConfig trackActiveQueries. */ + public trackActiveQueries?: (boolean|null); + + /** ObservabilityInstanceConfig trackClientAddress. */ + public trackClientAddress?: (boolean|null); + + /** ObservabilityInstanceConfig assistiveExperiencesEnabled. */ + public assistiveExperiencesEnabled?: (boolean|null); + + /** + * Creates a new ObservabilityInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObservabilityInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; + + /** + * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @param message ObservabilityInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @param message ObservabilityInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; + + /** + * Verifies an ObservabilityInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObservabilityInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; + + /** + * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. + * @param message ObservabilityInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObservabilityInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObservabilityInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadPoolConfig. */ + interface IReadPoolConfig { + + /** ReadPoolConfig nodeCount */ + nodeCount?: (number|null); + } + + /** Represents a ReadPoolConfig. */ + class ReadPoolConfig implements IReadPoolConfig { + + /** + * Constructs a new ReadPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig); + + /** ReadPoolConfig nodeCount. */ + public nodeCount: number; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Verifies a ReadPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @param message ReadPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePolicy. */ + interface IUpdatePolicy { + + /** UpdatePolicy mode */ + mode?: (google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|null); + } + + /** Represents an UpdatePolicy. */ + class UpdatePolicy implements IUpdatePolicy { + + /** + * Constructs a new UpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy); + + /** UpdatePolicy mode. */ + public mode: (google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode); + + /** + * Creates a new UpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Verifies an UpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; + + /** + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @param message UpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.UpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpdatePolicy { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DEFAULT = 1, + FORCE_APPLY = 2 + } + } + + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscInterfaceConfig. */ + interface IPscInterfaceConfig { + + /** PscInterfaceConfig networkAttachmentResource */ + networkAttachmentResource?: (string|null); + } + + /** Represents a PscInterfaceConfig. */ + class PscInterfaceConfig implements IPscInterfaceConfig { + + /** + * Constructs a new PscInterfaceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig); + + /** PscInterfaceConfig networkAttachmentResource. */ + public networkAttachmentResource: string; + + /** + * Creates a new PscInterfaceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscInterfaceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; + + /** + * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. + * @param message PscInterfaceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. + * @param message PscInterfaceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; + + /** + * Verifies a PscInterfaceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscInterfaceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; + + /** + * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. + * @param message PscInterfaceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscInterfaceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscInterfaceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscAutoConnectionConfig. */ + interface IPscAutoConnectionConfig { + + /** PscAutoConnectionConfig consumerProject */ + consumerProject?: (string|null); + + /** PscAutoConnectionConfig consumerNetwork */ + consumerNetwork?: (string|null); + + /** PscAutoConnectionConfig ipAddress */ + ipAddress?: (string|null); + + /** PscAutoConnectionConfig status */ + status?: (string|null); + + /** PscAutoConnectionConfig consumerNetworkStatus */ + consumerNetworkStatus?: (string|null); + } + + /** Represents a PscAutoConnectionConfig. */ + class PscAutoConnectionConfig implements IPscAutoConnectionConfig { + + /** + * Constructs a new PscAutoConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig); + + /** PscAutoConnectionConfig consumerProject. */ + public consumerProject: string; + + /** PscAutoConnectionConfig consumerNetwork. */ + public consumerNetwork: string; + + /** PscAutoConnectionConfig ipAddress. */ + public ipAddress: string; + + /** PscAutoConnectionConfig status. */ + public status: string; + + /** PscAutoConnectionConfig consumerNetworkStatus. */ + public consumerNetworkStatus: string; + + /** + * Creates a new PscAutoConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscAutoConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; + + /** + * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @param message PscAutoConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @param message PscAutoConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; + + /** + * Verifies a PscAutoConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscAutoConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; + + /** + * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. + * @param message PscAutoConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscAutoConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscAutoConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscInstanceConfig. */ + interface IPscInstanceConfig { + + /** PscInstanceConfig serviceAttachmentLink */ + serviceAttachmentLink?: (string|null); + + /** PscInstanceConfig allowedConsumerProjects */ + allowedConsumerProjects?: (string[]|null); + + /** PscInstanceConfig pscDnsName */ + pscDnsName?: (string|null); + + /** PscInstanceConfig pscInterfaceConfigs */ + pscInterfaceConfigs?: (google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]|null); + + /** PscInstanceConfig pscAutoConnections */ + pscAutoConnections?: (google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig[]|null); + } + + /** Represents a PscInstanceConfig. */ + class PscInstanceConfig implements IPscInstanceConfig { + + /** + * Constructs a new PscInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig); + + /** PscInstanceConfig serviceAttachmentLink. */ + public serviceAttachmentLink: string; + + /** PscInstanceConfig allowedConsumerProjects. */ + public allowedConsumerProjects: string[]; + + /** PscInstanceConfig pscDnsName. */ + public pscDnsName: string; + + /** PscInstanceConfig pscInterfaceConfigs. */ + public pscInterfaceConfigs: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]; + + /** PscInstanceConfig pscAutoConnections. */ + public pscAutoConnections: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig[]; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; + + /** + * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. + * @param message PscInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. + * @param message PscInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; + + /** + * Verifies a PscInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; + + /** + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. + * @param message PscInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceNetworkConfig. */ + interface IInstanceNetworkConfig { + + /** InstanceNetworkConfig authorizedExternalNetworks */ + authorizedExternalNetworks?: (google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]|null); + + /** InstanceNetworkConfig enablePublicIp */ + enablePublicIp?: (boolean|null); + + /** InstanceNetworkConfig enableOutboundPublicIp */ + enableOutboundPublicIp?: (boolean|null); + + /** InstanceNetworkConfig network */ + network?: (string|null); + + /** InstanceNetworkConfig allocatedIpRangeOverride */ + allocatedIpRangeOverride?: (string|null); + } + + /** Represents an InstanceNetworkConfig. */ + class InstanceNetworkConfig implements IInstanceNetworkConfig { + + /** + * Constructs a new InstanceNetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig); + + /** InstanceNetworkConfig authorizedExternalNetworks. */ + public authorizedExternalNetworks: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]; + + /** InstanceNetworkConfig enablePublicIp. */ + public enablePublicIp: boolean; + + /** InstanceNetworkConfig enableOutboundPublicIp. */ + public enableOutboundPublicIp: boolean; + + /** InstanceNetworkConfig network. */ + public network: string; + + /** InstanceNetworkConfig allocatedIpRangeOverride. */ + public allocatedIpRangeOverride: string; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceNetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; + + /** + * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. + * @param message InstanceNetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. + * @param message InstanceNetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; + + /** + * Verifies an InstanceNetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceNetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; + + /** + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. + * @param message InstanceNetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceNetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceNetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceNetworkConfig { + + /** Properties of an AuthorizedNetwork. */ + interface IAuthorizedNetwork { + + /** AuthorizedNetwork cidrRange */ + cidrRange?: (string|null); + } + + /** Represents an AuthorizedNetwork. */ + class AuthorizedNetwork implements IAuthorizedNetwork { + + /** + * Constructs a new AuthorizedNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork); + + /** AuthorizedNetwork cidrRange. */ + public cidrRange: string; + + /** + * Creates a new AuthorizedNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedNetwork instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @param message AuthorizedNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @param message AuthorizedNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Verifies an AuthorizedNetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. + * @param message AuthorizedNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ConnectionPoolConfig. */ + interface IConnectionPoolConfig { + + /** ConnectionPoolConfig enabled */ + enabled?: (boolean|null); + + /** ConnectionPoolConfig flags */ + flags?: ({ [k: string]: string }|null); + + /** ConnectionPoolConfig poolerCount */ + poolerCount?: (number|null); + } + + /** Represents a ConnectionPoolConfig. */ + class ConnectionPoolConfig implements IConnectionPoolConfig { + + /** + * Constructs a new ConnectionPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig); + + /** ConnectionPoolConfig enabled. */ + public enabled: boolean; + + /** ConnectionPoolConfig flags. */ + public flags: { [k: string]: string }; + + /** ConnectionPoolConfig poolerCount. */ + public poolerCount: number; + + /** + * Creates a new ConnectionPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; + + /** + * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. + * @param message ConnectionPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. + * @param message ConnectionPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; + + /** + * Verifies a ConnectionPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; + + /** + * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. + * @param message ConnectionPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + CREATING = 3, + DELETING = 4, + MAINTENANCE = 5, + FAILED = 6, + BOOTSTRAPPING = 8, + PROMOTING = 9 + } + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + READ_POOL = 2, + SECONDARY = 3 + } + + /** AvailabilityType enum. */ + enum AvailabilityType { + AVAILABILITY_TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2 + } + + /** ActivationPolicy enum. */ + enum ActivationPolicy { + ACTIVATION_POLICY_UNSPECIFIED = 0, + ALWAYS = 1, + NEVER = 2 + } + } + + /** Properties of a ConnectionInfo. */ + interface IConnectionInfo { + + /** ConnectionInfo name */ + name?: (string|null); + + /** ConnectionInfo ipAddress */ + ipAddress?: (string|null); + + /** ConnectionInfo publicIpAddress */ + publicIpAddress?: (string|null); + + /** ConnectionInfo pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** ConnectionInfo instanceUid */ + instanceUid?: (string|null); + + /** ConnectionInfo pscDnsName */ + pscDnsName?: (string|null); + } + + /** Represents a ConnectionInfo. */ + class ConnectionInfo implements IConnectionInfo { + + /** + * Constructs a new ConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo); + + /** ConnectionInfo name. */ + public name: string; + + /** ConnectionInfo ipAddress. */ + public ipAddress: string; + + /** ConnectionInfo publicIpAddress. */ + public publicIpAddress: string; + + /** ConnectionInfo pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** ConnectionInfo instanceUid. */ + public instanceUid: string; + + /** ConnectionInfo pscDnsName. */ + public pscDnsName: string; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Verifies a ConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ConnectionInfo; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @param message ConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup displayName */ + displayName?: (string|null); + + /** Backup uid */ + uid?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup createCompletionTime */ + createCompletionTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup state */ + state?: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State|null); + + /** Backup type */ + type?: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type|null); + + /** Backup description */ + description?: (string|null); + + /** Backup clusterUid */ + clusterUid?: (string|null); + + /** Backup clusterName */ + clusterName?: (string|null); + + /** Backup reconciling */ + reconciling?: (boolean|null); + + /** Backup encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity */ + expiryQuantity?: (google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null); + + /** Backup satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + + /** Backup tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup displayName. */ + public displayName: string; + + /** Backup uid. */ + public uid: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup createCompletionTime. */ + public createCompletionTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup state. */ + public state: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State); + + /** Backup type. */ + public type: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type); + + /** Backup description. */ + public description: string; + + /** Backup clusterUid. */ + public clusterUid: string; + + /** Backup clusterName. */ + public clusterName: string; + + /** Backup reconciling. */ + public reconciling: boolean; + + /** Backup encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); + + /** Backup etag. */ + public etag: string; + + /** Backup annotations. */ + public annotations: { [k: string]: string }; + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity. */ + public expiryQuantity?: (google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null); + + /** Backup satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** Backup satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + + /** Backup tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBackup): google.cloud.alloydb.v1alpha.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** Properties of a QuantityBasedExpiry. */ + interface IQuantityBasedExpiry { + + /** QuantityBasedExpiry retentionCount */ + retentionCount?: (number|null); + + /** QuantityBasedExpiry totalRetentionCount */ + totalRetentionCount?: (number|null); + } + + /** Represents a QuantityBasedExpiry. */ + class QuantityBasedExpiry implements IQuantityBasedExpiry { + + /** + * Constructs a new QuantityBasedExpiry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry); + + /** QuantityBasedExpiry retentionCount. */ + public retentionCount: number; + + /** QuantityBasedExpiry totalRetentionCount. */ + public totalRetentionCount: number; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedExpiry instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; + + /** + * Verifies a QuantityBasedExpiry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedExpiry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @param message QuantityBasedExpiry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + CREATING = 2, + FAILED = 3, + DELETING = 4 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ON_DEMAND = 1, + AUTOMATED = 2, + CONTINUOUS = 3 + } + } + + /** Properties of a SupportedDatabaseFlag. */ + interface ISupportedDatabaseFlag { + + /** SupportedDatabaseFlag stringRestrictions */ + stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions */ + integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag recommendedStringValue */ + recommendedStringValue?: (string|null); + + /** SupportedDatabaseFlag recommendedIntegerValue */ + recommendedIntegerValue?: (google.protobuf.IInt64Value|null); + + /** SupportedDatabaseFlag name */ + name?: (string|null); + + /** SupportedDatabaseFlag flagName */ + flagName?: (string|null); + + /** SupportedDatabaseFlag valueType */ + valueType?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null); + + /** SupportedDatabaseFlag acceptsMultipleValues */ + acceptsMultipleValues?: (boolean|null); + + /** SupportedDatabaseFlag supportedDbVersions */ + supportedDbVersions?: (google.cloud.alloydb.v1alpha.DatabaseVersion[]|null); + + /** SupportedDatabaseFlag requiresDbRestart */ + requiresDbRestart?: (boolean|null); + + /** SupportedDatabaseFlag scope */ + scope?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null); + } + + /** Represents a SupportedDatabaseFlag. */ + class SupportedDatabaseFlag implements ISupportedDatabaseFlag { + + /** + * Constructs a new SupportedDatabaseFlag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag); + + /** SupportedDatabaseFlag stringRestrictions. */ + public stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions. */ + public integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag recommendedStringValue. */ + public recommendedStringValue?: (string|null); + + /** SupportedDatabaseFlag recommendedIntegerValue. */ + public recommendedIntegerValue?: (google.protobuf.IInt64Value|null); + + /** SupportedDatabaseFlag name. */ + public name: string; + + /** SupportedDatabaseFlag flagName. */ + public flagName: string; + + /** SupportedDatabaseFlag valueType. */ + public valueType: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType); + + /** SupportedDatabaseFlag acceptsMultipleValues. */ + public acceptsMultipleValues: boolean; + + /** SupportedDatabaseFlag supportedDbVersions. */ + public supportedDbVersions: google.cloud.alloydb.v1alpha.DatabaseVersion[]; + + /** SupportedDatabaseFlag requiresDbRestart. */ + public requiresDbRestart: boolean; + + /** SupportedDatabaseFlag scope. */ + public scope: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope); + + /** SupportedDatabaseFlag restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** SupportedDatabaseFlag recommendedValue. */ + public recommendedValue?: ("recommendedStringValue"|"recommendedIntegerValue"); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedDatabaseFlag instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Verifies a SupportedDatabaseFlag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedDatabaseFlag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @param message SupportedDatabaseFlag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SupportedDatabaseFlag { + + /** Properties of a StringRestrictions. */ + interface IStringRestrictions { + + /** StringRestrictions allowedValues */ + allowedValues?: (string[]|null); + } + + /** Represents a StringRestrictions. */ + class StringRestrictions implements IStringRestrictions { + + /** + * Constructs a new StringRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions); + + /** StringRestrictions allowedValues. */ + public allowedValues: string[]; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns StringRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Verifies a StringRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @param message StringRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntegerRestrictions. */ + interface IIntegerRestrictions { + + /** IntegerRestrictions minValue */ + minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue */ + maxValue?: (google.protobuf.IInt64Value|null); + } + + /** Represents an IntegerRestrictions. */ + class IntegerRestrictions implements IIntegerRestrictions { + + /** + * Constructs a new IntegerRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions); + + /** IntegerRestrictions minValue. */ + public minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue. */ + public maxValue?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Verifies an IntegerRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @param message IntegerRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + FLOAT = 3, + NONE = 4 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + DATABASE = 1, + CONNECTION_POOL = 2 + } + } + + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User password */ + password?: (string|null); + + /** User databaseRoles */ + databaseRoles?: (string[]|null); + + /** User userType */ + userType?: (google.cloud.alloydb.v1alpha.User.UserType|keyof typeof google.cloud.alloydb.v1alpha.User.UserType|null); + + /** User keepExtraRoles */ + keepExtraRoles?: (boolean|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUser); + + /** User name. */ + public name: string; + + /** User password. */ + public password: string; + + /** User databaseRoles. */ + public databaseRoles: string[]; + + /** User userType. */ + public userType: (google.cloud.alloydb.v1alpha.User.UserType|keyof typeof google.cloud.alloydb.v1alpha.User.UserType); + + /** User keepExtraRoles. */ + public keepExtraRoles: boolean; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUser): google.cloud.alloydb.v1alpha.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** UserType enum. */ + enum UserType { + USER_TYPE_UNSPECIFIED = 0, + ALLOYDB_BUILT_IN = 1, + ALLOYDB_IAM_USER = 2 + } + } + + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database charset */ + charset?: (string|null); + + /** Database collation */ + collation?: (string|null); + + /** Database characterType */ + characterType?: (string|null); + + /** Database isTemplate */ + isTemplate?: (boolean|null); + + /** Database databaseTemplate */ + databaseTemplate?: (string|null); + + /** Database isTemplateDatabase */ + isTemplateDatabase?: (boolean|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDatabase); + + /** Database name. */ + public name: string; + + /** Database charset. */ + public charset: string; + + /** Database collation. */ + public collation: string; + + /** Database characterType. */ + public characterType: string; + + /** Database isTemplate. */ + public isTemplate: boolean; + + /** Database databaseTemplate. */ + public databaseTemplate: string; + + /** Database isTemplateDatabase. */ + public isTemplateDatabase?: (boolean|null); + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDatabase): google.cloud.alloydb.v1alpha.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** GCAEntitlementType enum. */ + enum GCAEntitlementType { + GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0, + GCA_STANDARD = 1 + } + + /** Properties of a GeminiClusterConfig. */ + interface IGeminiClusterConfig { + + /** GeminiClusterConfig entitled */ + entitled?: (boolean|null); + } + + /** Represents a GeminiClusterConfig. */ + class GeminiClusterConfig implements IGeminiClusterConfig { + + /** + * Constructs a new GeminiClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGeminiClusterConfig); + + /** GeminiClusterConfig entitled. */ + public entitled: boolean; + + /** + * Creates a new GeminiClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GeminiClusterConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGeminiClusterConfig): google.cloud.alloydb.v1alpha.GeminiClusterConfig; + + /** + * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. + * @param message GeminiClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. + * @param message GeminiClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GeminiClusterConfig; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GeminiClusterConfig; + + /** + * Verifies a GeminiClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeminiClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GeminiClusterConfig; + + /** + * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. + * @param message GeminiClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GeminiClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeminiClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeminiClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeminiInstanceConfig. */ + interface IGeminiInstanceConfig { + + /** GeminiInstanceConfig entitled */ + entitled?: (boolean|null); + } + + /** Represents a GeminiInstanceConfig. */ + class GeminiInstanceConfig implements IGeminiInstanceConfig { + + /** + * Constructs a new GeminiInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig); + + /** GeminiInstanceConfig entitled. */ + public entitled: boolean; + + /** + * Creates a new GeminiInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GeminiInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; + + /** + * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. + * @param message GeminiInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. + * @param message GeminiInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; + + /** + * Verifies a GeminiInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeminiInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; + + /** + * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. + * @param message GeminiInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GeminiInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeminiInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeminiInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCAInstanceConfig. */ + interface IGCAInstanceConfig { + + /** GCAInstanceConfig gcaEntitlement */ + gcaEntitlement?: (google.cloud.alloydb.v1alpha.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1alpha.GCAEntitlementType|null); + } + + /** Represents a GCAInstanceConfig. */ + class GCAInstanceConfig implements IGCAInstanceConfig { + + /** + * Constructs a new GCAInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGCAInstanceConfig); + + /** GCAInstanceConfig gcaEntitlement. */ + public gcaEntitlement: (google.cloud.alloydb.v1alpha.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1alpha.GCAEntitlementType); + + /** + * Creates a new GCAInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GCAInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGCAInstanceConfig): google.cloud.alloydb.v1alpha.GCAInstanceConfig; + + /** + * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. + * @param message GCAInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. + * @param message GCAInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GCAInstanceConfig; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GCAInstanceConfig; + + /** + * Verifies a GCAInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCAInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GCAInstanceConfig; + + /** + * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. + * @param message GCAInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GCAInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCAInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCAInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AlloyDBAdmin */ + class AlloyDBAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): Promise; + + /** + * Calls ExportCluster. + * @param request ExportClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportCluster(request: google.cloud.alloydb.v1alpha.IExportClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportClusterCallback): void; + + /** + * Calls ExportCluster. + * @param request ExportClusterRequest message or plain object + * @returns Promise + */ + public exportCluster(request: google.cloud.alloydb.v1alpha.IExportClusterRequest): Promise; + + /** + * Calls ImportCluster. + * @param request ImportClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importCluster(request: google.cloud.alloydb.v1alpha.IImportClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportClusterCallback): void; + + /** + * Calls ImportCluster. + * @param request ImportClusterRequest message or plain object + * @returns Promise + */ + public importCluster(request: google.cloud.alloydb.v1alpha.IImportClusterRequest): Promise; + + /** + * Calls UpgradeCluster. + * @param request UpgradeClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public upgradeCluster(request: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeClusterCallback): void; + + /** + * Calls UpgradeCluster. + * @param request UpgradeClusterRequest message or plain object + * @returns Promise + */ + public upgradeCluster(request: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): Promise; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback): void; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @returns Promise + */ + public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): Promise; + + /** + * Calls SwitchoverCluster. + * @param request SwitchoverClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public switchoverCluster(request: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverClusterCallback): void; + + /** + * Calls SwitchoverCluster. + * @param request SwitchoverClusterRequest message or plain object + * @returns Promise + */ + public switchoverCluster(request: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest): Promise; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback): void; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @returns Promise + */ + public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): Promise; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @returns Promise + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): Promise; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @returns Promise + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): Promise; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback): void; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @returns Promise + */ + public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): Promise; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback): void; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @returns Promise + */ + public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): Promise; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public injectFault(request: google.cloud.alloydb.v1alpha.IInjectFaultRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFaultCallback): void; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @returns Promise + */ + public injectFault(request: google.cloud.alloydb.v1alpha.IInjectFaultRequest): Promise; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback): void; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): Promise; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteSqlResponse + */ + public executeSql(request: google.cloud.alloydb.v1alpha.IExecuteSqlRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSqlCallback): void; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeSql(request: google.cloud.alloydb.v1alpha.IExecuteSqlRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): Promise; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @returns Promise + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): Promise; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + */ + public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback): void; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @returns Promise + */ + public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): Promise; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionInfo + */ + public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback): void; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @returns Promise + */ + public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): Promise; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse + */ + public listUsers(request: google.cloud.alloydb.v1alpha.IListUsersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsersCallback): void; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise + */ + public listUsers(request: google.cloud.alloydb.v1alpha.IListUsersRequest): Promise; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public getUser(request: google.cloud.alloydb.v1alpha.IGetUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUserCallback): void; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise + */ + public getUser(request: google.cloud.alloydb.v1alpha.IGetUserRequest): Promise; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public createUser(request: google.cloud.alloydb.v1alpha.ICreateUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUserCallback): void; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise + */ + public createUser(request: google.cloud.alloydb.v1alpha.ICreateUserRequest): Promise; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public updateUser(request: google.cloud.alloydb.v1alpha.IUpdateUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUserCallback): void; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise + */ + public updateUser(request: google.cloud.alloydb.v1alpha.IUpdateUserRequest): Promise; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUser(request: google.cloud.alloydb.v1alpha.IDeleteUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUserCallback): void; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.cloud.alloydb.v1alpha.IDeleteUserRequest): Promise; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse + */ + public listDatabases(request: google.cloud.alloydb.v1alpha.IListDatabasesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabasesCallback): void; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @returns Promise + */ + public listDatabases(request: google.cloud.alloydb.v1alpha.IListDatabasesRequest): Promise; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Database + */ + public createDatabase(request: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabaseCallback): void; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @returns Promise + */ + public createDatabase(request: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest): Promise; + } + + namespace AlloyDBAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|exportCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|importCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|upgradeCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpgradeClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|switchoverCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type SwitchoverClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Instance) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|injectFault}. + * @param error Error, if any + * @param [response] Operation + */ + type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|executeSql}. + * @param error Error, if any + * @param [response] ExecuteSqlResponse + */ + type ExecuteSqlCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ExecuteSqlResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Backup) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @param error Error, if any + * @param [response] ListSupportedDatabaseFlagsResponse + */ + type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. + * @param error Error, if any + * @param [response] GenerateClientCertificateResponse + */ + type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. + * @param error Error, if any + * @param [response] ConnectionInfo + */ + type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ConnectionInfo) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse + */ + type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListUsersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getUser}. + * @param error Error, if any + * @param [response] User + */ + type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createUser}. + * @param error Error, if any + * @param [response] User + */ + type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateUser}. + * @param error Error, if any + * @param [response] User + */ + type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteUser}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listDatabases}. + * @param error Error, if any + * @param [response] ListDatabasesResponse + */ + type ListDatabasesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListDatabasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createDatabase}. + * @param error Error, if any + * @param [response] Database + */ + type CreateDatabaseCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Database) => void; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.alloydb.v1alpha.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.alloydb.v1alpha.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + + /** GetClusterRequest view */ + view?: (google.cloud.alloydb.v1alpha.ClusterView|keyof typeof google.cloud.alloydb.v1alpha.ClusterView|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** GetClusterRequest view. */ + public view: (google.cloud.alloydb.v1alpha.ClusterView|keyof typeof google.cloud.alloydb.v1alpha.ClusterView); + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryClusterRequest. */ + interface ICreateSecondaryClusterRequest { + + /** CreateSecondaryClusterRequest parent */ + parent?: (string|null); + + /** CreateSecondaryClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateSecondaryClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateSecondaryClusterRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryClusterRequest. */ + class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest); + + /** CreateSecondaryClusterRequest parent. */ + public parent: string; + + /** CreateSecondaryClusterRequest clusterId. */ + public clusterId: string; + + /** CreateSecondaryClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateSecondaryClusterRequest requestId. */ + public requestId: string; + + /** CreateSecondaryClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + + /** UpdateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateClusterRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** UpdateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateClusterRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGcsDestination): google.cloud.alloydb.v1alpha.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportClusterRequest. */ + interface IExportClusterRequest { + + /** ExportClusterRequest gcsDestination */ + gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); + + /** ExportClusterRequest csvExportOptions */ + csvExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null); + + /** ExportClusterRequest sqlExportOptions */ + sqlExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null); + + /** ExportClusterRequest name */ + name?: (string|null); + + /** ExportClusterRequest database */ + database?: (string|null); + } + + /** Represents an ExportClusterRequest. */ + class ExportClusterRequest implements IExportClusterRequest { + + /** + * Constructs a new ExportClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IExportClusterRequest); + + /** ExportClusterRequest gcsDestination. */ + public gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); + + /** ExportClusterRequest csvExportOptions. */ + public csvExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null); + + /** ExportClusterRequest sqlExportOptions. */ + public sqlExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null); + + /** ExportClusterRequest name. */ + public name: string; + + /** ExportClusterRequest database. */ + public database: string; + + /** ExportClusterRequest destination. */ + public destination?: "gcsDestination"; + + /** ExportClusterRequest exportOptions. */ + public exportOptions?: ("csvExportOptions"|"sqlExportOptions"); + + /** + * Creates a new ExportClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IExportClusterRequest): google.cloud.alloydb.v1alpha.ExportClusterRequest; + + /** + * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. + * @param message ExportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. + * @param message ExportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterRequest; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterRequest; + + /** + * Verifies an ExportClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterRequest; + + /** + * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. + * @param message ExportClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportClusterRequest { + + /** Properties of a CsvExportOptions. */ + interface ICsvExportOptions { + + /** CsvExportOptions selectQuery */ + selectQuery?: (string|null); + + /** CsvExportOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvExportOptions quoteCharacter */ + quoteCharacter?: (string|null); + + /** CsvExportOptions escapeCharacter */ + escapeCharacter?: (string|null); + } + + /** Represents a CsvExportOptions. */ + class CsvExportOptions implements ICsvExportOptions { + + /** + * Constructs a new CsvExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions); + + /** CsvExportOptions selectQuery. */ + public selectQuery: string; + + /** CsvExportOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvExportOptions quoteCharacter. */ + public quoteCharacter: string; + + /** CsvExportOptions escapeCharacter. */ + public escapeCharacter: string; + + /** + * Creates a new CsvExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvExportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; + + /** + * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @param message CsvExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @param message CsvExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; + + /** + * Verifies a CsvExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; + + /** + * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. + * @param message CsvExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlExportOptions. */ + interface ISqlExportOptions { + + /** SqlExportOptions tables */ + tables?: (string[]|null); + + /** SqlExportOptions schemaOnly */ + schemaOnly?: (boolean|null); + + /** SqlExportOptions cleanTargetObjects */ + cleanTargetObjects?: (boolean|null); + + /** SqlExportOptions ifExistTargetObjects */ + ifExistTargetObjects?: (boolean|null); + } + + /** Represents a SqlExportOptions. */ + class SqlExportOptions implements ISqlExportOptions { + + /** + * Constructs a new SqlExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions); + + /** SqlExportOptions tables. */ + public tables: string[]; + + /** SqlExportOptions schemaOnly. */ + public schemaOnly?: (boolean|null); + + /** SqlExportOptions cleanTargetObjects. */ + public cleanTargetObjects?: (boolean|null); + + /** SqlExportOptions ifExistTargetObjects. */ + public ifExistTargetObjects?: (boolean|null); + + /** + * Creates a new SqlExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlExportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; + + /** + * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @param message SqlExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @param message SqlExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; + + /** + * Verifies a SqlExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; + + /** + * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. + * @param message SqlExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportClusterResponse. */ + interface IExportClusterResponse { + + /** ExportClusterResponse gcsDestination */ + gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); + } + + /** Represents an ExportClusterResponse. */ + class ExportClusterResponse implements IExportClusterResponse { + + /** + * Constructs a new ExportClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IExportClusterResponse); + + /** ExportClusterResponse gcsDestination. */ + public gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); + + /** ExportClusterResponse destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new ExportClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IExportClusterResponse): google.cloud.alloydb.v1alpha.ExportClusterResponse; + + /** + * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. + * @param message ExportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. + * @param message ExportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterResponse; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterResponse; + + /** + * Verifies an ExportClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterResponse; + + /** + * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. + * @param message ExportClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportClusterRequest. */ + interface IImportClusterRequest { + + /** ImportClusterRequest sqlImportOptions */ + sqlImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null); + + /** ImportClusterRequest csvImportOptions */ + csvImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null); + + /** ImportClusterRequest name */ + name?: (string|null); + + /** ImportClusterRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportClusterRequest database */ + database?: (string|null); + + /** ImportClusterRequest user */ + user?: (string|null); + } + + /** Represents an ImportClusterRequest. */ + class ImportClusterRequest implements IImportClusterRequest { + + /** + * Constructs a new ImportClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IImportClusterRequest); + + /** ImportClusterRequest sqlImportOptions. */ + public sqlImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null); + + /** ImportClusterRequest csvImportOptions. */ + public csvImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null); + + /** ImportClusterRequest name. */ + public name: string; + + /** ImportClusterRequest gcsUri. */ + public gcsUri: string; + + /** ImportClusterRequest database. */ + public database: string; + + /** ImportClusterRequest user. */ + public user: string; + + /** ImportClusterRequest importOptions. */ + public importOptions?: ("sqlImportOptions"|"csvImportOptions"); + + /** + * Creates a new ImportClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IImportClusterRequest): google.cloud.alloydb.v1alpha.ImportClusterRequest; + + /** + * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. + * @param message ImportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. + * @param message ImportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterRequest; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterRequest; + + /** + * Verifies an ImportClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterRequest; + + /** + * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. + * @param message ImportClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportClusterRequest { + + /** Properties of a SqlImportOptions. */ + interface ISqlImportOptions { + } + + /** Represents a SqlImportOptions. */ + class SqlImportOptions implements ISqlImportOptions { + + /** + * Constructs a new SqlImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions); + + /** + * Creates a new SqlImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlImportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; + + /** + * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @param message SqlImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @param message SqlImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; + + /** + * Verifies a SqlImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; + + /** + * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. + * @param message SqlImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CsvImportOptions. */ + interface ICsvImportOptions { + + /** CsvImportOptions table */ + table?: (string|null); + + /** CsvImportOptions columns */ + columns?: (string[]|null); + + /** CsvImportOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvImportOptions quoteCharacter */ + quoteCharacter?: (string|null); + + /** CsvImportOptions escapeCharacter */ + escapeCharacter?: (string|null); + } + + /** Represents a CsvImportOptions. */ + class CsvImportOptions implements ICsvImportOptions { + + /** + * Constructs a new CsvImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions); + + /** CsvImportOptions table. */ + public table: string; + + /** CsvImportOptions columns. */ + public columns: string[]; + + /** CsvImportOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvImportOptions quoteCharacter. */ + public quoteCharacter: string; + + /** CsvImportOptions escapeCharacter. */ + public escapeCharacter: string; + + /** + * Creates a new CsvImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvImportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; + + /** + * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @param message CsvImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @param message CsvImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; + + /** + * Verifies a CsvImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; + + /** + * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. + * @param message CsvImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportClusterResponse. */ + interface IImportClusterResponse { + + /** ImportClusterResponse bytesDownloaded */ + bytesDownloaded?: (number|Long|string|null); + } + + /** Represents an ImportClusterResponse. */ + class ImportClusterResponse implements IImportClusterResponse { + + /** + * Constructs a new ImportClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IImportClusterResponse); + + /** ImportClusterResponse bytesDownloaded. */ + public bytesDownloaded: (number|Long|string); + + /** + * Creates a new ImportClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IImportClusterResponse): google.cloud.alloydb.v1alpha.ImportClusterResponse; + + /** + * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. + * @param message ImportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. + * @param message ImportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterResponse; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterResponse; + + /** + * Verifies an ImportClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterResponse; + + /** + * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. + * @param message ImportClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterRequest. */ + interface IUpgradeClusterRequest { + + /** UpgradeClusterRequest name */ + name?: (string|null); + + /** UpgradeClusterRequest version */ + version?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + + /** UpgradeClusterRequest requestId */ + requestId?: (string|null); + + /** UpgradeClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpgradeClusterRequest etag */ + etag?: (string|null); + } + + /** Represents an UpgradeClusterRequest. */ + class UpgradeClusterRequest implements IUpgradeClusterRequest { + + /** + * Constructs a new UpgradeClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest); + + /** UpgradeClusterRequest name. */ + public name: string; + + /** UpgradeClusterRequest version. */ + public version: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + + /** UpgradeClusterRequest requestId. */ + public requestId: string; + + /** UpgradeClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpgradeClusterRequest etag. */ + public etag: string; + + /** + * Creates a new UpgradeClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; + + /** + * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. + * @param message UpgradeClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. + * @param message UpgradeClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; + + /** + * Verifies an UpgradeClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; + + /** + * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. + * @param message UpgradeClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterResponse. */ + interface IUpgradeClusterResponse { + + /** UpgradeClusterResponse status */ + status?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); + + /** UpgradeClusterResponse message */ + message?: (string|null); + + /** UpgradeClusterResponse clusterUpgradeDetails */ + clusterUpgradeDetails?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails[]|null); + } + + /** Represents an UpgradeClusterResponse. */ + class UpgradeClusterResponse implements IUpgradeClusterResponse { + + /** + * Constructs a new UpgradeClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse); + + /** UpgradeClusterResponse status. */ + public status: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); + + /** UpgradeClusterResponse message. */ + public message: string; + + /** UpgradeClusterResponse clusterUpgradeDetails. */ + public clusterUpgradeDetails: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails[]; + + /** + * Creates a new UpgradeClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; + + /** + * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. + * @param message UpgradeClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. + * @param message UpgradeClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; + + /** + * Verifies an UpgradeClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; + + /** + * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. + * @param message UpgradeClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeClusterResponse { + + /** Properties of a StageInfo. */ + interface IStageInfo { + + /** StageInfo stage */ + stage?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null); + + /** StageInfo status */ + status?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); + + /** StageInfo logsUrl */ + logsUrl?: (string|null); + } + + /** Represents a StageInfo. */ + class StageInfo implements IStageInfo { + + /** + * Constructs a new StageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo); + + /** StageInfo stage. */ + public stage: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage); + + /** StageInfo status. */ + public status: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); + + /** StageInfo logsUrl. */ + public logsUrl: string; + + /** + * Creates a new StageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StageInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; + + /** + * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @param message StageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @param message StageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; + + /** + * Decodes a StageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; + + /** + * Verifies a StageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; + + /** + * Creates a plain object from a StageInfo message. Also converts values to other types if specified. + * @param message StageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceUpgradeDetails. */ + interface IInstanceUpgradeDetails { + + /** InstanceUpgradeDetails name */ + name?: (string|null); + + /** InstanceUpgradeDetails upgradeStatus */ + upgradeStatus?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); + + /** InstanceUpgradeDetails instanceType */ + instanceType?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); + } + + /** Represents an InstanceUpgradeDetails. */ + class InstanceUpgradeDetails implements IInstanceUpgradeDetails { + + /** + * Constructs a new InstanceUpgradeDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails); + + /** InstanceUpgradeDetails name. */ + public name: string; + + /** InstanceUpgradeDetails upgradeStatus. */ + public upgradeStatus: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); + + /** InstanceUpgradeDetails instanceType. */ + public instanceType: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); + + /** + * Creates a new InstanceUpgradeDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceUpgradeDetails instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @param message InstanceUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @param message InstanceUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Verifies an InstanceUpgradeDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceUpgradeDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. + * @param message InstanceUpgradeDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceUpgradeDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceUpgradeDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterUpgradeDetails. */ + interface IClusterUpgradeDetails { + + /** ClusterUpgradeDetails name */ + name?: (string|null); + + /** ClusterUpgradeDetails upgradeStatus */ + upgradeStatus?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); + + /** ClusterUpgradeDetails clusterType */ + clusterType?: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType|null); + + /** ClusterUpgradeDetails databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + + /** ClusterUpgradeDetails stageInfo */ + stageInfo?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo[]|null); + + /** ClusterUpgradeDetails instanceUpgradeDetails */ + instanceUpgradeDetails?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails[]|null); + } + + /** Represents a ClusterUpgradeDetails. */ + class ClusterUpgradeDetails implements IClusterUpgradeDetails { + + /** + * Constructs a new ClusterUpgradeDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails); + + /** ClusterUpgradeDetails name. */ + public name: string; + + /** ClusterUpgradeDetails upgradeStatus. */ + public upgradeStatus: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); + + /** ClusterUpgradeDetails clusterType. */ + public clusterType: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType); + + /** ClusterUpgradeDetails databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + + /** ClusterUpgradeDetails stageInfo. */ + public stageInfo: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo[]; + + /** ClusterUpgradeDetails instanceUpgradeDetails. */ + public instanceUpgradeDetails: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails[]; + + /** + * Creates a new ClusterUpgradeDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterUpgradeDetails instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @param message ClusterUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @param message ClusterUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Verifies a ClusterUpgradeDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterUpgradeDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. + * @param message ClusterUpgradeDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterUpgradeDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterUpgradeDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + NOT_STARTED = 4, + IN_PROGRESS = 5, + SUCCESS = 1, + FAILED = 2, + PARTIAL_SUCCESS = 3, + CANCEL_IN_PROGRESS = 6, + CANCELLED = 7 + } + + /** Stage enum. */ + enum Stage { + STAGE_UNSPECIFIED = 0, + ALLOYDB_PRECHECK = 1, + PG_UPGRADE_CHECK = 2, + PREPARE_FOR_UPGRADE = 5, + PRIMARY_INSTANCE_UPGRADE = 3, + READ_POOL_INSTANCES_UPGRADE = 4, + ROLLBACK = 6, + CLEANUP = 7 + } + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + + /** DeleteClusterRequest etag */ + etag?: (string|null); + + /** DeleteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteClusterRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** DeleteClusterRequest etag. */ + public etag: string; + + /** DeleteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteClusterRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SwitchoverClusterRequest. */ + interface ISwitchoverClusterRequest { + + /** SwitchoverClusterRequest name */ + name?: (string|null); + + /** SwitchoverClusterRequest requestId */ + requestId?: (string|null); + + /** SwitchoverClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a SwitchoverClusterRequest. */ + class SwitchoverClusterRequest implements ISwitchoverClusterRequest { + + /** + * Constructs a new SwitchoverClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest); + + /** SwitchoverClusterRequest name. */ + public name: string; + + /** SwitchoverClusterRequest requestId. */ + public requestId: string; + + /** SwitchoverClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new SwitchoverClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SwitchoverClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; + + /** + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. + * @param message SwitchoverClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. + * @param message SwitchoverClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; + + /** + * Verifies a SwitchoverClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwitchoverClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; + + /** + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. + * @param message SwitchoverClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SwitchoverClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwitchoverClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SwitchoverClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteClusterRequest. */ + interface IPromoteClusterRequest { + + /** PromoteClusterRequest name */ + name?: (string|null); + + /** PromoteClusterRequest requestId */ + requestId?: (string|null); + + /** PromoteClusterRequest etag */ + etag?: (string|null); + + /** PromoteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a PromoteClusterRequest. */ + class PromoteClusterRequest implements IPromoteClusterRequest { + + /** + * Constructs a new PromoteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest); + + /** PromoteClusterRequest name. */ + public name: string; + + /** PromoteClusterRequest requestId. */ + public requestId: string; + + /** PromoteClusterRequest etag. */ + public etag: string; + + /** PromoteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + + /** + * Verifies a PromoteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.PromoteClusterRequest; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @param message PromoteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreClusterRequest. */ + interface IRestoreClusterRequest { + + /** RestoreClusterRequest backupSource */ + backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource */ + continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent */ + parent?: (string|null); + + /** RestoreClusterRequest clusterId */ + clusterId?: (string|null); + + /** RestoreClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** RestoreClusterRequest requestId */ + requestId?: (string|null); + + /** RestoreClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestoreClusterRequest. */ + class RestoreClusterRequest implements IRestoreClusterRequest { + + /** + * Constructs a new RestoreClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest); + + /** RestoreClusterRequest backupSource. */ + public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource. */ + public continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent. */ + public parent: string; + + /** RestoreClusterRequest clusterId. */ + public clusterId: string; + + /** RestoreClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); + + /** RestoreClusterRequest requestId. */ + public requestId: string; + + /** RestoreClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** RestoreClusterRequest source. */ + public source?: ("backupSource"|"continuousBackupSource"); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + + /** + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + + /** + * Verifies a RestoreClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestoreClusterRequest; + + /** + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @param message RestoreClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest): google.cloud.alloydb.v1alpha.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1alpha.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse): google.cloud.alloydb.v1alpha.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + + /** GetInstanceRequest view */ + view?: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** GetInstanceRequest view. */ + public view: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView); + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest): google.cloud.alloydb.v1alpha.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** CreateInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** CreateInstanceRequest requestId. */ + public requestId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryInstanceRequest. */ + interface ICreateSecondaryInstanceRequest { + + /** CreateSecondaryInstanceRequest parent */ + parent?: (string|null); + + /** CreateSecondaryInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateSecondaryInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryInstanceRequest. */ + class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest); + + /** CreateSecondaryInstanceRequest parent. */ + public parent: string; + + /** CreateSecondaryInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateSecondaryInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId. */ + public requestId: string; + + /** CreateSecondaryInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequests. */ + interface ICreateInstanceRequests { + + /** CreateInstanceRequests createInstanceRequests */ + createInstanceRequests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]|null); + } + + /** Represents a CreateInstanceRequests. */ + class CreateInstanceRequests implements ICreateInstanceRequests { + + /** + * Constructs a new CreateInstanceRequests. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests); + + /** CreateInstanceRequests createInstanceRequests. */ + public createInstanceRequests: google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]; + + /** + * Creates a new CreateInstanceRequests instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequests instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + + /** + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + + /** + * Verifies a CreateInstanceRequests message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequests + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequests; + + /** + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @param message CreateInstanceRequests + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequests to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequests + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesRequest. */ + interface IBatchCreateInstancesRequest { + + /** BatchCreateInstancesRequest parent */ + parent?: (string|null); + + /** BatchCreateInstancesRequest requests */ + requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a BatchCreateInstancesRequest. */ + class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { + + /** + * Constructs a new BatchCreateInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest); + + /** BatchCreateInstancesRequest parent. */ + public parent: string; + + /** BatchCreateInstancesRequest requests. */ + public requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId. */ + public requestId: string; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + + /** + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + + /** + * Verifies a BatchCreateInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; + + /** + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @param message BatchCreateInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesResponse. */ + interface IBatchCreateInstancesResponse { + + /** BatchCreateInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); + } + + /** Represents a BatchCreateInstancesResponse. */ + class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { + + /** + * Constructs a new BatchCreateInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse); + + /** BatchCreateInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1alpha.IInstance[]; + + /** + * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + + /** + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + + /** + * Verifies a BatchCreateInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; + + /** + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @param message BatchCreateInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesMetadata. */ + interface IBatchCreateInstancesMetadata { + + /** BatchCreateInstancesMetadata instanceTargets */ + instanceTargets?: (string[]|null); + + /** BatchCreateInstancesMetadata instanceStatuses */ + instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }|null); + } + + /** Represents a BatchCreateInstancesMetadata. */ + class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { + + /** + * Constructs a new BatchCreateInstancesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata); + + /** BatchCreateInstancesMetadata instanceTargets. */ + public instanceTargets: string[]; + + /** BatchCreateInstancesMetadata instanceStatuses. */ + public instanceStatuses: { [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }; + + /** + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + + /** + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + + /** + * Verifies a BatchCreateInstancesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; + + /** + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @param message BatchCreateInstancesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstanceStatus. */ + interface IBatchCreateInstanceStatus { + + /** BatchCreateInstanceStatus state */ + state?: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null); + + /** BatchCreateInstanceStatus errorMsg */ + errorMsg?: (string|null); + + /** BatchCreateInstanceStatus error */ + error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type */ + type?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); + } + + /** Represents a BatchCreateInstanceStatus. */ + class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { + + /** + * Constructs a new BatchCreateInstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus); + + /** BatchCreateInstanceStatus state. */ + public state: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State); + + /** BatchCreateInstanceStatus errorMsg. */ + public errorMsg: string; + + /** BatchCreateInstanceStatus error. */ + public error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type. */ + public type: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstanceStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + + /** + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + + /** + * Verifies a BatchCreateInstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @param message BatchCreateInstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchCreateInstanceStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING_CREATE = 1, + READY = 2, + CREATING = 3, + DELETING = 4, + FAILED = 5, + ROLLED_BACK = 6 + } + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** UpdateInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateInstanceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); + + /** UpdateInstanceRequest requestId. */ + public requestId: string; + + /** UpdateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateInstanceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest requestId */ + requestId?: (string|null); + + /** DeleteInstanceRequest etag */ + etag?: (string|null); + + /** DeleteInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest requestId. */ + public requestId: string; + + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** DeleteInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FailoverInstanceRequest. */ + interface IFailoverInstanceRequest { + + /** FailoverInstanceRequest name */ + name?: (string|null); + + /** FailoverInstanceRequest requestId */ + requestId?: (string|null); + + /** FailoverInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a FailoverInstanceRequest. */ + class FailoverInstanceRequest implements IFailoverInstanceRequest { + + /** + * Constructs a new FailoverInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest); + + /** FailoverInstanceRequest name. */ + public name: string; + + /** FailoverInstanceRequest requestId. */ + public requestId: string; + + /** FailoverInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FailoverInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + + /** + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + + /** + * Verifies a FailoverInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FailoverInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; + + /** + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @param message FailoverInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FailoverInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FailoverInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InjectFaultRequest. */ + interface IInjectFaultRequest { + + /** InjectFaultRequest faultType */ + faultType?: (google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|null); + + /** InjectFaultRequest name */ + name?: (string|null); + + /** InjectFaultRequest requestId */ + requestId?: (string|null); + + /** InjectFaultRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an InjectFaultRequest. */ + class InjectFaultRequest implements IInjectFaultRequest { + + /** + * Constructs a new InjectFaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IInjectFaultRequest); + + /** InjectFaultRequest faultType. */ + public faultType: (google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType); + + /** InjectFaultRequest name. */ + public name: string; + + /** InjectFaultRequest requestId. */ + public requestId: string; + + /** InjectFaultRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InjectFaultRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IInjectFaultRequest): google.cloud.alloydb.v1alpha.InjectFaultRequest; + + /** + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.InjectFaultRequest; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.InjectFaultRequest; + + /** + * Verifies an InjectFaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InjectFaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.InjectFaultRequest; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @param message InjectFaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InjectFaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InjectFaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InjectFaultRequest { + + /** FaultType enum. */ + enum FaultType { + FAULT_TYPE_UNSPECIFIED = 0, + STOP_VM = 1 + } + } + + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + + /** RestartInstanceRequest requestId */ + requestId?: (string|null); + + /** RestartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** RestartInstanceRequest nodeIds */ + nodeIds?: (string[]|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { + + /** + * Constructs a new RestartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest); + + /** RestartInstanceRequest name. */ + public name: string; + + /** RestartInstanceRequest requestId. */ + public requestId: string; + + /** RestartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** RestartInstanceRequest nodeIds. */ + public nodeIds: string[]; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): google.cloud.alloydb.v1alpha.RestartInstanceRequest; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestartInstanceRequest; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestartInstanceRequest; + + /** + * Verifies a RestartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestartInstanceRequest; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlRequest. */ + interface IExecuteSqlRequest { + + /** ExecuteSqlRequest password */ + password?: (string|null); + + /** ExecuteSqlRequest instance */ + instance?: (string|null); + + /** ExecuteSqlRequest database */ + database?: (string|null); + + /** ExecuteSqlRequest user */ + user?: (string|null); + + /** ExecuteSqlRequest sqlStatement */ + sqlStatement?: (string|null); + + /** ExecuteSqlRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an ExecuteSqlRequest. */ + class ExecuteSqlRequest implements IExecuteSqlRequest { + + /** + * Constructs a new ExecuteSqlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlRequest); + + /** ExecuteSqlRequest password. */ + public password?: (string|null); + + /** ExecuteSqlRequest instance. */ + public instance: string; + + /** ExecuteSqlRequest database. */ + public database: string; + + /** ExecuteSqlRequest user. */ + public user: string; + + /** ExecuteSqlRequest sqlStatement. */ + public sqlStatement: string; + + /** ExecuteSqlRequest validateOnly. */ + public validateOnly: boolean; + + /** ExecuteSqlRequest userCredential. */ + public userCredential?: "password"; + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlRequest): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; + + /** + * Verifies an ExecuteSqlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @param message ExecuteSqlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlResponse. */ + interface IExecuteSqlResponse { + + /** ExecuteSqlResponse sqlResults */ + sqlResults?: (google.cloud.alloydb.v1alpha.ISqlResult[]|null); + + /** ExecuteSqlResponse metadata */ + metadata?: (google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null); + } + + /** Represents an ExecuteSqlResponse. */ + class ExecuteSqlResponse implements IExecuteSqlResponse { + + /** + * Constructs a new ExecuteSqlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlResponse); + + /** ExecuteSqlResponse sqlResults. */ + public sqlResults: google.cloud.alloydb.v1alpha.ISqlResult[]; + + /** ExecuteSqlResponse metadata. */ + public metadata?: (google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null); + + /** + * Creates a new ExecuteSqlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlResponse): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; + + /** + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. + * @param message ExecuteSqlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. + * @param message ExecuteSqlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; + + /** + * Verifies an ExecuteSqlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; + + /** + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. + * @param message ExecuteSqlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExecuteSqlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlMetadata. */ + interface IExecuteSqlMetadata { + + /** ExecuteSqlMetadata message */ + message?: (string|null); + + /** ExecuteSqlMetadata partialResult */ + partialResult?: (boolean|null); + + /** ExecuteSqlMetadata sqlStatementExecutionDuration */ + sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); + + /** ExecuteSqlMetadata status */ + status?: (google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|null); + } + + /** Represents an ExecuteSqlMetadata. */ + class ExecuteSqlMetadata implements IExecuteSqlMetadata { + + /** + * Constructs a new ExecuteSqlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata); + + /** ExecuteSqlMetadata message. */ + public message: string; + + /** ExecuteSqlMetadata partialResult. */ + public partialResult: boolean; + + /** ExecuteSqlMetadata sqlStatementExecutionDuration. */ + public sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); + + /** ExecuteSqlMetadata status. */ + public status: (google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status); + + /** + * Creates a new ExecuteSqlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; + + /** + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. + * @param message ExecuteSqlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. + * @param message ExecuteSqlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; + + /** + * Verifies an ExecuteSqlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; + + /** + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. + * @param message ExecuteSqlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ExecuteSqlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteSqlMetadata { + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + OK = 1, + PARTIAL = 2, + ERROR = 3 + } + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest): google.cloud.alloydb.v1alpha.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.alloydb.v1alpha.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.alloydb.v1alpha.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse): google.cloud.alloydb.v1alpha.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest): google.cloud.alloydb.v1alpha.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + + /** CreateBackupRequest requestId */ + requestId?: (string|null); + + /** CreateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + + /** CreateBackupRequest requestId. */ + public requestId: string; + + /** CreateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest): google.cloud.alloydb.v1alpha.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + + /** UpdateBackupRequest requestId */ + requestId?: (string|null); + + /** UpdateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); + + /** UpdateBackupRequest requestId. */ + public requestId: string; + + /** UpdateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** DeleteBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSupportedDatabaseFlagsRequest. */ + interface IListSupportedDatabaseFlagsRequest { + + /** ListSupportedDatabaseFlagsRequest parent */ + parent?: (string|null); + + /** ListSupportedDatabaseFlagsRequest pageSize */ + pageSize?: (number|null); + + /** ListSupportedDatabaseFlagsRequest pageToken */ + pageToken?: (string|null); + + /** ListSupportedDatabaseFlagsRequest scope */ + scope?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null); + } + + /** Represents a ListSupportedDatabaseFlagsRequest. */ + class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { + + /** + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest); + + /** ListSupportedDatabaseFlagsRequest parent. */ + public parent: string; + + /** ListSupportedDatabaseFlagsRequest pageSize. */ + public pageSize: number; + + /** ListSupportedDatabaseFlagsRequest pageToken. */ + public pageToken: string; + + /** ListSupportedDatabaseFlagsRequest scope. */ + public scope: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope); + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSupportedDatabaseFlagsRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + + /** + * Verifies a ListSupportedDatabaseFlagsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSupportedDatabaseFlagsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSupportedDatabaseFlagsResponse. */ + interface IListSupportedDatabaseFlagsResponse { + + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ + supportedDatabaseFlags?: (google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]|null); + + /** ListSupportedDatabaseFlagsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSupportedDatabaseFlagsResponse. */ + class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { + + /** + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse); + + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ + public supportedDatabaseFlags: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]; + + /** ListSupportedDatabaseFlagsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSupportedDatabaseFlagsResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + + /** + * Verifies a ListSupportedDatabaseFlagsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSupportedDatabaseFlagsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateClientCertificateRequest. */ + interface IGenerateClientCertificateRequest { + + /** GenerateClientCertificateRequest parent */ + parent?: (string|null); + + /** GenerateClientCertificateRequest requestId */ + requestId?: (string|null); + + /** GenerateClientCertificateRequest pemCsr */ + pemCsr?: (string|null); + + /** GenerateClientCertificateRequest certDuration */ + certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey */ + publicKey?: (string|null); + + /** GenerateClientCertificateRequest useMetadataExchange */ + useMetadataExchange?: (boolean|null); + } + + /** Represents a GenerateClientCertificateRequest. */ + class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { + + /** + * Constructs a new GenerateClientCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest); + + /** GenerateClientCertificateRequest parent. */ + public parent: string; + + /** GenerateClientCertificateRequest requestId. */ + public requestId: string; + + /** GenerateClientCertificateRequest pemCsr. */ + public pemCsr: string; + + /** GenerateClientCertificateRequest certDuration. */ + public certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey. */ + public publicKey: string; + + /** GenerateClientCertificateRequest useMetadataExchange. */ + public useMetadataExchange: boolean; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateClientCertificateRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + + /** + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + + /** + * Verifies a GenerateClientCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateClientCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; + + /** + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @param message GenerateClientCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateClientCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateClientCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateClientCertificateResponse. */ + interface IGenerateClientCertificateResponse { + + /** GenerateClientCertificateResponse pemCertificate */ + pemCertificate?: (string|null); + + /** GenerateClientCertificateResponse pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** GenerateClientCertificateResponse caCert */ + caCert?: (string|null); + } + + /** Represents a GenerateClientCertificateResponse. */ + class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { + + /** + * Constructs a new GenerateClientCertificateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse); + + /** GenerateClientCertificateResponse pemCertificate. */ + public pemCertificate: string; + + /** GenerateClientCertificateResponse pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** GenerateClientCertificateResponse caCert. */ + public caCert: string; + + /** + * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateClientCertificateResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + + /** + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + + /** + * Verifies a GenerateClientCertificateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateClientCertificateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @param message GenerateClientCertificateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionInfoRequest. */ + interface IGetConnectionInfoRequest { + + /** GetConnectionInfoRequest parent */ + parent?: (string|null); + + /** GetConnectionInfoRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetConnectionInfoRequest. */ + class GetConnectionInfoRequest implements IGetConnectionInfoRequest { + + /** + * Constructs a new GetConnectionInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest); + + /** GetConnectionInfoRequest parent. */ + public parent: string; + + /** GetConnectionInfoRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionInfoRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + + /** + * Verifies a GetConnectionInfoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionInfoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @param message GetConnectionInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata batchCreateInstancesMetadata */ + batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); + + /** OperationMetadata promoteClusterStatus */ + promoteClusterStatus?: (google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null); + + /** OperationMetadata upgradeClusterStatus */ + upgradeClusterStatus?: (google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata); + + /** OperationMetadata batchCreateInstancesMetadata. */ + public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); + + /** OperationMetadata promoteClusterStatus. */ + public promoteClusterStatus?: (google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null); + + /** OperationMetadata upgradeClusterStatus. */ + public upgradeClusterStatus?: (google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata requestSpecific. */ + public requestSpecific?: ("batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata): google.cloud.alloydb.v1alpha.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteClusterStatus. */ + interface IPromoteClusterStatus { + + /** PromoteClusterStatus state */ + state?: (google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|null); + } + + /** Represents a PromoteClusterStatus. */ + class PromoteClusterStatus implements IPromoteClusterStatus { + + /** + * Constructs a new PromoteClusterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterStatus); + + /** PromoteClusterStatus state. */ + public state: (google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1alpha.PromoteClusterStatus.State); + + /** + * Creates a new PromoteClusterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterStatus): google.cloud.alloydb.v1alpha.PromoteClusterStatus; + + /** + * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. + * @param message PromoteClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. + * @param message PromoteClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.PromoteClusterStatus; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.PromoteClusterStatus; + + /** + * Verifies a PromoteClusterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.PromoteClusterStatus; + + /** + * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. + * @param message PromoteClusterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.PromoteClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteClusterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteClusterStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PromoteClusterStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROMOTE_CLUSTER_AVAILABLE_FOR_READ = 1, + PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE = 2, + PROMOTE_CLUSTER_COMPLETED = 3 + } + } + + /** Properties of an UpgradeClusterStatus. */ + interface IUpgradeClusterStatus { + + /** UpgradeClusterStatus state */ + state?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); + + /** UpgradeClusterStatus cancellable */ + cancellable?: (boolean|null); + + /** UpgradeClusterStatus sourceVersion */ + sourceVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + + /** UpgradeClusterStatus targetVersion */ + targetVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); + + /** UpgradeClusterStatus stages */ + stages?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus[]|null); + } + + /** Represents an UpgradeClusterStatus. */ + class UpgradeClusterStatus implements IUpgradeClusterStatus { + + /** + * Constructs a new UpgradeClusterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus); + + /** UpgradeClusterStatus state. */ + public state: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); + + /** UpgradeClusterStatus cancellable. */ + public cancellable: boolean; + + /** UpgradeClusterStatus sourceVersion. */ + public sourceVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + + /** UpgradeClusterStatus targetVersion. */ + public targetVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + + /** UpgradeClusterStatus stages. */ + public stages: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus[]; + + /** + * Creates a new UpgradeClusterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; + + /** + * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. + * @param message UpgradeClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. + * @param message UpgradeClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; + + /** + * Verifies an UpgradeClusterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; + + /** + * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. + * @param message UpgradeClusterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeClusterStatus { + + /** Properties of a StageStatus. */ + interface IStageStatus { + + /** StageStatus readPoolInstancesUpgrade */ + readPoolInstancesUpgrade?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); + + /** StageStatus stage */ + stage?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null); + + /** StageStatus state */ + state?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); + + /** StageStatus schedule */ + schedule?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null); + } + + /** Represents a StageStatus. */ + class StageStatus implements IStageStatus { + + /** + * Constructs a new StageStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus); + + /** StageStatus readPoolInstancesUpgrade. */ + public readPoolInstancesUpgrade?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); + + /** StageStatus stage. */ + public stage: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage); + + /** StageStatus state. */ + public state: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); + + /** StageStatus schedule. */ + public schedule?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null); + + /** StageStatus stageSpecificStatus. */ + public stageSpecificStatus?: "readPoolInstancesUpgrade"; + + /** + * Creates a new StageStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns StageStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; + + /** + * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @param message StageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @param message StageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; + + /** + * Decodes a StageStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; + + /** + * Verifies a StageStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; + + /** + * Creates a plain object from a StageStatus message. Also converts values to other types if specified. + * @param message StageStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StageStatus { + + /** Properties of a StageSchedule. */ + interface IStageSchedule { + + /** StageSchedule estimatedStartTime */ + estimatedStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualStartTime */ + actualStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule estimatedEndTime */ + estimatedEndTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualEndTime */ + actualEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StageSchedule. */ + class StageSchedule implements IStageSchedule { + + /** + * Constructs a new StageSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule); + + /** StageSchedule estimatedStartTime. */ + public estimatedStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualStartTime. */ + public actualStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule estimatedEndTime. */ + public estimatedEndTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualEndTime. */ + public actualEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StageSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns StageSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @param message StageSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @param message StageSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Decodes a StageSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Verifies a StageSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. + * @param message StageSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadPoolInstancesUpgradeStageStatus. */ + interface IReadPoolInstancesUpgradeStageStatus { + + /** ReadPoolInstancesUpgradeStageStatus upgradeStats */ + upgradeStats?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); + } + + /** Represents a ReadPoolInstancesUpgradeStageStatus. */ + class ReadPoolInstancesUpgradeStageStatus implements IReadPoolInstancesUpgradeStageStatus { + + /** + * Constructs a new ReadPoolInstancesUpgradeStageStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus); + + /** ReadPoolInstancesUpgradeStageStatus upgradeStats. */ + public upgradeStats?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); + + /** + * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolInstancesUpgradeStageStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Verifies a ReadPoolInstancesUpgradeStageStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolInstancesUpgradeStageStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. + * @param message ReadPoolInstancesUpgradeStageStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolInstancesUpgradeStageStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadPoolInstancesUpgradeStageStatus { + + /** Properties of a Stats. */ + interface IStats { + + /** Stats notStarted */ + notStarted?: (number|null); + + /** Stats ongoing */ + ongoing?: (number|null); + + /** Stats success */ + success?: (number|null); + + /** Stats failed */ + failed?: (number|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats); + + /** Stats notStarted. */ + public notStarted: number; + + /** Stats ongoing. */ + public ongoing: number; + + /** Stats success. */ + public success: number; + + /** Stats failed. */ + public failed: number; + + /** + * Creates a new Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Stats instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Verifies a Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { + + /** ListUsersRequest parent */ + parent?: (string|null); + + /** ListUsersRequest pageSize */ + pageSize?: (number|null); + + /** ListUsersRequest pageToken */ + pageToken?: (string|null); + + /** ListUsersRequest filter */ + filter?: (string|null); + + /** ListUsersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { + + /** + * Constructs a new ListUsersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListUsersRequest); + + /** ListUsersRequest parent. */ + public parent: string; + + /** ListUsersRequest pageSize. */ + public pageSize: number; + + /** ListUsersRequest pageToken. */ + public pageToken: string; + + /** ListUsersRequest filter. */ + public filter: string; + + /** ListUsersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListUsersRequest): google.cloud.alloydb.v1alpha.ListUsersRequest; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListUsersRequest; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListUsersRequest; + + /** + * Verifies a ListUsersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListUsersRequest; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { + + /** ListUsersResponse users */ + users?: (google.cloud.alloydb.v1alpha.IUser[]|null); + + /** ListUsersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUsersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { + + /** + * Constructs a new ListUsersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListUsersResponse); + + /** ListUsersResponse users. */ + public users: google.cloud.alloydb.v1alpha.IUser[]; + + /** ListUsersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUsersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListUsersResponse): google.cloud.alloydb.v1alpha.ListUsersResponse; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListUsersResponse; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListUsersResponse; + + /** + * Verifies a ListUsersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListUsersResponse; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { + + /** GetUserRequest name */ + name?: (string|null); + } + + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { + + /** + * Constructs a new GetUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IGetUserRequest); + + /** GetUserRequest name. */ + public name: string; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IGetUserRequest): google.cloud.alloydb.v1alpha.GetUserRequest; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetUserRequest; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetUserRequest; + + /** + * Verifies a GetUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetUserRequest; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { + + /** CreateUserRequest parent */ + parent?: (string|null); + + /** CreateUserRequest userId */ + userId?: (string|null); + + /** CreateUserRequest user */ + user?: (google.cloud.alloydb.v1alpha.IUser|null); + + /** CreateUserRequest requestId */ + requestId?: (string|null); + + /** CreateUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { + + /** + * Constructs a new CreateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateUserRequest); + + /** CreateUserRequest parent. */ + public parent: string; + + /** CreateUserRequest userId. */ + public userId: string; + + /** CreateUserRequest user. */ + public user?: (google.cloud.alloydb.v1alpha.IUser|null); + + /** CreateUserRequest requestId. */ + public requestId: string; + + /** CreateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateUserRequest): google.cloud.alloydb.v1alpha.CreateUserRequest; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateUserRequest; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateUserRequest; + + /** + * Verifies a CreateUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateUserRequest; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { + + /** UpdateUserRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserRequest user */ + user?: (google.cloud.alloydb.v1alpha.IUser|null); + + /** UpdateUserRequest requestId */ + requestId?: (string|null); + + /** UpdateUserRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateUserRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { + + /** + * Constructs a new UpdateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateUserRequest); + + /** UpdateUserRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserRequest user. */ + public user?: (google.cloud.alloydb.v1alpha.IUser|null); + + /** UpdateUserRequest requestId. */ + public requestId: string; + + /** UpdateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateUserRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateUserRequest): google.cloud.alloydb.v1alpha.UpdateUserRequest; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateUserRequest; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateUserRequest; + + /** + * Verifies an UpdateUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateUserRequest; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { + + /** DeleteUserRequest name */ + name?: (string|null); + + /** DeleteUserRequest requestId */ + requestId?: (string|null); + + /** DeleteUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { + + /** + * Constructs a new DeleteUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteUserRequest); + + /** DeleteUserRequest name. */ + public name: string; + + /** DeleteUserRequest requestId. */ + public requestId: string; + + /** DeleteUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteUserRequest): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Verifies a DeleteUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteUserRequest; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesRequest. */ + interface IListDatabasesRequest { + + /** ListDatabasesRequest parent */ + parent?: (string|null); + + /** ListDatabasesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabasesRequest pageToken */ + pageToken?: (string|null); + + /** ListDatabasesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListDatabasesRequest. */ + class ListDatabasesRequest implements IListDatabasesRequest { + + /** + * Constructs a new ListDatabasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListDatabasesRequest); + + /** ListDatabasesRequest parent. */ + public parent: string; + + /** ListDatabasesRequest pageSize. */ + public pageSize: number; + + /** ListDatabasesRequest pageToken. */ + public pageToken: string; + + /** ListDatabasesRequest filter. */ + public filter: string; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListDatabasesRequest): google.cloud.alloydb.v1alpha.ListDatabasesRequest; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListDatabasesRequest; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListDatabasesRequest; + + /** + * Verifies a ListDatabasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListDatabasesRequest; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @param message ListDatabasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesResponse. */ + interface IListDatabasesResponse { + + /** ListDatabasesResponse databases */ + databases?: (google.cloud.alloydb.v1alpha.IDatabase[]|null); + + /** ListDatabasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabasesResponse. */ + class ListDatabasesResponse implements IListDatabasesResponse { + + /** + * Constructs a new ListDatabasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.IListDatabasesResponse); + + /** ListDatabasesResponse databases. */ + public databases: google.cloud.alloydb.v1alpha.IDatabase[]; + + /** ListDatabasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.IListDatabasesResponse): google.cloud.alloydb.v1alpha.ListDatabasesResponse; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListDatabasesResponse; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListDatabasesResponse; + + /** + * Verifies a ListDatabasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListDatabasesResponse; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @param message ListDatabasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatabaseRequest. */ + interface ICreateDatabaseRequest { + + /** CreateDatabaseRequest parent */ + parent?: (string|null); + + /** CreateDatabaseRequest databaseId */ + databaseId?: (string|null); + + /** CreateDatabaseRequest database */ + database?: (google.cloud.alloydb.v1alpha.IDatabase|null); + } + + /** Represents a CreateDatabaseRequest. */ + class CreateDatabaseRequest implements ICreateDatabaseRequest { + + /** + * Constructs a new CreateDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest); + + /** CreateDatabaseRequest parent. */ + public parent: string; + + /** CreateDatabaseRequest databaseId. */ + public databaseId: string; + + /** CreateDatabaseRequest database. */ + public database?: (google.cloud.alloydb.v1alpha.IDatabase|null); + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatabaseRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; + + /** + * Verifies a CreateDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @param message CreateDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResult. */ + interface ISqlResult { + + /** SqlResult columns */ + columns?: (google.cloud.alloydb.v1alpha.ISqlResultColumn[]|null); + + /** SqlResult rows */ + rows?: (google.cloud.alloydb.v1alpha.ISqlResultRow[]|null); + } + + /** Represents a SqlResult. */ + class SqlResult implements ISqlResult { + + /** + * Constructs a new SqlResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResult); + + /** SqlResult columns. */ + public columns: google.cloud.alloydb.v1alpha.ISqlResultColumn[]; + + /** SqlResult rows. */ + public rows: google.cloud.alloydb.v1alpha.ISqlResultRow[]; + + /** + * Creates a new SqlResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResult instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResult): google.cloud.alloydb.v1alpha.SqlResult; + + /** + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. + * @param message SqlResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. + * @param message SqlResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResult; + + /** + * Decodes a SqlResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResult; + + /** + * Verifies a SqlResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResult; + + /** + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. + * @param message SqlResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SqlResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultColumn. */ + interface ISqlResultColumn { + + /** SqlResultColumn name */ + name?: (string|null); + + /** SqlResultColumn type */ + type?: (string|null); + } + + /** Represents a SqlResultColumn. */ + class SqlResultColumn implements ISqlResultColumn { + + /** + * Constructs a new SqlResultColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResultColumn); + + /** SqlResultColumn name. */ + public name: string; + + /** SqlResultColumn type. */ + public type: string; + + /** + * Creates a new SqlResultColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultColumn instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResultColumn): google.cloud.alloydb.v1alpha.SqlResultColumn; + + /** + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. + * @param message SqlResultColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. + * @param message SqlResultColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResultColumn; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResultColumn; + + /** + * Verifies a SqlResultColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResultColumn; + + /** + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. + * @param message SqlResultColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SqlResultColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultRow. */ + interface ISqlResultRow { + + /** SqlResultRow values */ + values?: (google.cloud.alloydb.v1alpha.ISqlResultValue[]|null); + } + + /** Represents a SqlResultRow. */ + class SqlResultRow implements ISqlResultRow { + + /** + * Constructs a new SqlResultRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResultRow); + + /** SqlResultRow values. */ + public values: google.cloud.alloydb.v1alpha.ISqlResultValue[]; + + /** + * Creates a new SqlResultRow instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultRow instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResultRow): google.cloud.alloydb.v1alpha.SqlResultRow; + + /** + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. + * @param message SqlResultRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. + * @param message SqlResultRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResultRow; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResultRow; + + /** + * Verifies a SqlResultRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResultRow; + + /** + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. + * @param message SqlResultRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SqlResultRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultValue. */ + interface ISqlResultValue { + + /** SqlResultValue value */ + value?: (string|null); + + /** SqlResultValue nullValue */ + nullValue?: (boolean|null); + } + + /** Represents a SqlResultValue. */ + class SqlResultValue implements ISqlResultValue { + + /** + * Constructs a new SqlResultValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResultValue); + + /** SqlResultValue value. */ + public value?: (string|null); + + /** SqlResultValue nullValue. */ + public nullValue?: (boolean|null); + + /** + * Creates a new SqlResultValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultValue instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResultValue): google.cloud.alloydb.v1alpha.SqlResultValue; + + /** + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. + * @param message SqlResultValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. + * @param message SqlResultValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResultValue; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResultValue; + + /** + * Verifies a SqlResultValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResultValue; + + /** + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. + * @param message SqlResultValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.SqlResultValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Properties of a CloudSQLBackupRunSource. */ + interface ICloudSQLBackupRunSource { + + /** CloudSQLBackupRunSource project */ + project?: (string|null); + + /** CloudSQLBackupRunSource instanceId */ + instanceId?: (string|null); + + /** CloudSQLBackupRunSource backupRunId */ + backupRunId?: (number|Long|string|null); + } + + /** Represents a CloudSQLBackupRunSource. */ + class CloudSQLBackupRunSource implements ICloudSQLBackupRunSource { + + /** + * Constructs a new CloudSQLBackupRunSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource); + + /** CloudSQLBackupRunSource project. */ + public project: string; + + /** CloudSQLBackupRunSource instanceId. */ + public instanceId: string; + + /** CloudSQLBackupRunSource backupRunId. */ + public backupRunId: (number|Long|string); + + /** + * Creates a new CloudSQLBackupRunSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSQLBackupRunSource instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; + + /** + * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. + * @param message CloudSQLBackupRunSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. + * @param message CloudSQLBackupRunSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; + + /** + * Verifies a CloudSQLBackupRunSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSQLBackupRunSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; + + /** + * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. + * @param message CloudSQLBackupRunSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CloudSQLBackupRunSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSQLBackupRunSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSQLBackupRunSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AlloyDBCSQLAdmin */ + class AlloyDBCSQLAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBCSQLAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBCSQLAdmin; + + /** + * Calls RestoreFromCloudSQL. + * @param request RestoreFromCloudSQLRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreFromCloudSQL(request: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, callback: google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback): void; + + /** + * Calls RestoreFromCloudSQL. + * @param request RestoreFromCloudSQLRequest message or plain object + * @returns Promise + */ + public restoreFromCloudSQL(request: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest): Promise; + } + + namespace AlloyDBCSQLAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin|restoreFromCloudSQL}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreFromCloudSQLCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a RestoreFromCloudSQLRequest. */ + interface IRestoreFromCloudSQLRequest { + + /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource */ + cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); + + /** RestoreFromCloudSQLRequest parent */ + parent?: (string|null); + + /** RestoreFromCloudSQLRequest clusterId */ + clusterId?: (string|null); + + /** RestoreFromCloudSQLRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + } + + /** Represents a RestoreFromCloudSQLRequest. */ + class RestoreFromCloudSQLRequest implements IRestoreFromCloudSQLRequest { + + /** + * Constructs a new RestoreFromCloudSQLRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest); + + /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource. */ + public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); + + /** RestoreFromCloudSQLRequest parent. */ + public parent: string; + + /** RestoreFromCloudSQLRequest clusterId. */ + public clusterId: string; + + /** RestoreFromCloudSQLRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** RestoreFromCloudSQLRequest source. */ + public source?: "cloudsqlBackupRunSource"; + + /** + * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreFromCloudSQLRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. + * @param message RestoreFromCloudSQLRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. + * @param message RestoreFromCloudSQLRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; + + /** + * Verifies a RestoreFromCloudSQLRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreFromCloudSQLRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; + + /** + * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. + * @param message RestoreFromCloudSQLRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreFromCloudSQLRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreFromCloudSQLRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InstanceView enum. */ + enum InstanceView { + INSTANCE_VIEW_UNSPECIFIED = 0, + INSTANCE_VIEW_BASIC = 1, + INSTANCE_VIEW_FULL = 2 + } + + /** ClusterView enum. */ + enum ClusterView { + CLUSTER_VIEW_UNSPECIFIED = 0, + CLUSTER_VIEW_BASIC = 1, + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + } + + /** DatabaseVersion enum. */ + enum DatabaseVersion { + DATABASE_VERSION_UNSPECIFIED = 0, + POSTGRES_13 = 1, + POSTGRES_14 = 2, + POSTGRES_15 = 3, + POSTGRES_16 = 4, + POSTGRES_17 = 5, + POSTGRES_18 = 6 + } + + /** SubscriptionType enum. */ + enum SubscriptionType { + SUBSCRIPTION_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + TRIAL = 2 + } + + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword user */ + user?: (string|null); + + /** UserPassword password */ + password?: (string|null); + } + + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { + + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUserPassword); + + /** UserPassword user. */ + public user: string; + + /** UserPassword password. */ + public password: string; + + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUserPassword): google.cloud.alloydb.v1beta.UserPassword; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UserPassword; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UserPassword; + + /** + * Verifies a UserPassword message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UserPassword; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MigrationSource. */ + interface IMigrationSource { + + /** MigrationSource hostPort */ + hostPort?: (string|null); + + /** MigrationSource referenceId */ + referenceId?: (string|null); + + /** MigrationSource sourceType */ + sourceType?: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null); + } + + /** Represents a MigrationSource. */ + class MigrationSource implements IMigrationSource { + + /** + * Constructs a new MigrationSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IMigrationSource); + + /** MigrationSource hostPort. */ + public hostPort: string; + + /** MigrationSource referenceId. */ + public referenceId: string; + + /** MigrationSource sourceType. */ + public sourceType: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType); + + /** + * Creates a new MigrationSource instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationSource instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IMigrationSource): google.cloud.alloydb.v1beta.MigrationSource; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @param message MigrationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MigrationSource; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MigrationSource; + + /** + * Verifies a MigrationSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MigrationSource; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @param message MigrationSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationSource { + + /** MigrationSourceType enum. */ + enum MigrationSourceType { + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, + DMS = 1 + } + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig): google.cloud.alloydb.v1beta.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionInfo. */ + interface IEncryptionInfo { + + /** EncryptionInfo encryptionType */ + encryptionType?: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type|null); + + /** EncryptionInfo kmsKeyVersions */ + kmsKeyVersions?: (string[]|null); + } + + /** Represents an EncryptionInfo. */ + class EncryptionInfo implements IEncryptionInfo { + + /** + * Constructs a new EncryptionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo); + + /** EncryptionInfo encryptionType. */ + public encryptionType: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type); + + /** EncryptionInfo kmsKeyVersions. */ + public kmsKeyVersions: string[]; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo): google.cloud.alloydb.v1beta.EncryptionInfo; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @param message EncryptionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionInfo; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionInfo; + + /** + * Verifies an EncryptionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionInfo; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @param message EncryptionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EncryptionInfo { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GOOGLE_DEFAULT_ENCRYPTION = 1, + CUSTOMER_MANAGED_ENCRYPTION = 2 + } + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig sslMode */ + sslMode?: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode|null); + + /** SslConfig caSource */ + caSource?: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISslConfig); + + /** SslConfig sslMode. */ + public sslMode: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode); + + /** SslConfig caSource. */ + public caSource: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource); + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISslConfig): google.cloud.alloydb.v1beta.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SslConfig; + + /** + * Verifies a SslConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** SslMode enum. */ + enum SslMode { + SSL_MODE_UNSPECIFIED = 0, + SSL_MODE_ALLOW = 1, + SSL_MODE_REQUIRE = 2, + SSL_MODE_VERIFY_CA = 3, + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, + ENCRYPTED_ONLY = 5 + } + + /** CaSource enum. */ + enum CaSource { + CA_SOURCE_UNSPECIFIED = 0, + CA_SOURCE_MANAGED = 1 + } + } + + /** Properties of an AutomatedBackupPolicy. */ + interface IAutomatedBackupPolicy { + + /** AutomatedBackupPolicy weeklySchedule */ + weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention */ + timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention */ + quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled */ + enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow */ + backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location */ + location?: (string|null); + + /** AutomatedBackupPolicy labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an AutomatedBackupPolicy. */ + class AutomatedBackupPolicy implements IAutomatedBackupPolicy { + + /** + * Constructs a new AutomatedBackupPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy); + + /** AutomatedBackupPolicy weeklySchedule. */ + public weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); + + /** AutomatedBackupPolicy timeBasedRetention. */ + public timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); + + /** AutomatedBackupPolicy quantityBasedRetention. */ + public quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); + + /** AutomatedBackupPolicy enabled. */ + public enabled?: (boolean|null); + + /** AutomatedBackupPolicy backupWindow. */ + public backupWindow?: (google.protobuf.IDuration|null); + + /** AutomatedBackupPolicy encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** AutomatedBackupPolicy location. */ + public location: string; + + /** AutomatedBackupPolicy labels. */ + public labels: { [k: string]: string }; + + /** AutomatedBackupPolicy schedule. */ + public schedule?: "weeklySchedule"; + + /** AutomatedBackupPolicy retention. */ + public retention?: ("timeBasedRetention"|"quantityBasedRetention"); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedBackupPolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @param message AutomatedBackupPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + + /** + * Verifies an AutomatedBackupPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedBackupPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @param message AutomatedBackupPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutomatedBackupPolicy { + + /** Properties of a WeeklySchedule. */ + interface IWeeklySchedule { + + /** WeeklySchedule startTimes */ + startTimes?: (google.type.ITimeOfDay[]|null); + + /** WeeklySchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + } + + /** Represents a WeeklySchedule. */ + class WeeklySchedule implements IWeeklySchedule { + + /** + * Constructs a new WeeklySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule); + + /** WeeklySchedule startTimes. */ + public startTimes: google.type.ITimeOfDay[]; + + /** WeeklySchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklySchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @param message WeeklySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Verifies a WeeklySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @param message WeeklySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeeklySchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeBasedRetention. */ + interface ITimeBasedRetention { + + /** TimeBasedRetention retentionPeriod */ + retentionPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a TimeBasedRetention. */ + class TimeBasedRetention implements ITimeBasedRetention { + + /** + * Constructs a new TimeBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention); + + /** TimeBasedRetention retentionPeriod. */ + public retentionPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @param message TimeBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Verifies a TimeBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @param message TimeBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuantityBasedRetention. */ + interface IQuantityBasedRetention { + + /** QuantityBasedRetention count */ + count?: (number|null); + } + + /** Represents a QuantityBasedRetention. */ + class QuantityBasedRetention implements IQuantityBasedRetention { + + /** + * Constructs a new QuantityBasedRetention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention); + + /** QuantityBasedRetention count. */ + public count: number; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedRetention instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @param message QuantityBasedRetention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Verifies a QuantityBasedRetention message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedRetention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @param message QuantityBasedRetention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedRetention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ContinuousBackupConfig. */ + interface IContinuousBackupConfig { + + /** ContinuousBackupConfig enabled */ + enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays */ + recoveryWindowDays?: (number|null); + + /** ContinuousBackupConfig encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + } + + /** Represents a ContinuousBackupConfig. */ + class ContinuousBackupConfig implements IContinuousBackupConfig { + + /** + * Constructs a new ContinuousBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig); + + /** ContinuousBackupConfig enabled. */ + public enabled?: (boolean|null); + + /** ContinuousBackupConfig recoveryWindowDays. */ + public recoveryWindowDays: number; + + /** ContinuousBackupConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig): google.cloud.alloydb.v1beta.ContinuousBackupConfig; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @param message ContinuousBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupConfig; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupConfig; + + /** + * Verifies a ContinuousBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupConfig; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @param message ContinuousBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupInfo. */ + interface IContinuousBackupInfo { + + /** ContinuousBackupInfo encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime */ + enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule */ + schedule?: (google.type.DayOfWeek[]|null); + + /** ContinuousBackupInfo earliestRestorableTime */ + earliestRestorableTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupInfo. */ + class ContinuousBackupInfo implements IContinuousBackupInfo { + + /** + * Constructs a new ContinuousBackupInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo); + + /** ContinuousBackupInfo encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** ContinuousBackupInfo enabledTime. */ + public enabledTime?: (google.protobuf.ITimestamp|null); + + /** ContinuousBackupInfo schedule. */ + public schedule: google.type.DayOfWeek[]; + + /** ContinuousBackupInfo earliestRestorableTime. */ + public earliestRestorableTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @param message ContinuousBackupInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + + /** + * Verifies a ContinuousBackupInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupInfo; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @param message ContinuousBackupInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupSource. */ + interface IBackupSource { + + /** BackupSource backupUid */ + backupUid?: (string|null); + + /** BackupSource backupName */ + backupName?: (string|null); + } + + /** Represents a BackupSource. */ + class BackupSource implements IBackupSource { + + /** + * Constructs a new BackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBackupSource); + + /** BackupSource backupUid. */ + public backupUid: string; + + /** BackupSource backupName. */ + public backupName: string; + + /** + * Creates a new BackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBackupSource): google.cloud.alloydb.v1beta.BackupSource; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @param message BackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BackupSource; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BackupSource; + + /** + * Verifies a BackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BackupSource; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @param message BackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContinuousBackupSource. */ + interface IContinuousBackupSource { + + /** ContinuousBackupSource cluster */ + cluster?: (string|null); + + /** ContinuousBackupSource pointInTime */ + pointInTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousBackupSource. */ + class ContinuousBackupSource implements IContinuousBackupSource { + + /** + * Constructs a new ContinuousBackupSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource); + + /** ContinuousBackupSource cluster. */ + public cluster: string; + + /** ContinuousBackupSource pointInTime. */ + public pointInTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousBackupSource instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource): google.cloud.alloydb.v1beta.ContinuousBackupSource; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @param message ContinuousBackupSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupSource; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupSource; + + /** + * Verifies a ContinuousBackupSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousBackupSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupSource; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @param message ContinuousBackupSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousBackupSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenanceUpdatePolicy. */ + interface IMaintenanceUpdatePolicy { + + /** MaintenanceUpdatePolicy maintenanceWindows */ + maintenanceWindows?: (google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); + + /** MaintenanceUpdatePolicy denyMaintenancePeriods */ + denyMaintenancePeriods?: (google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]|null); + } + + /** Represents a MaintenanceUpdatePolicy. */ + class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy); + + /** MaintenanceUpdatePolicy maintenanceWindows. */ + public maintenanceWindows: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow[]; + + /** MaintenanceUpdatePolicy denyMaintenancePeriods. */ + public denyMaintenancePeriods: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceUpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @param message MaintenanceUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceUpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @param message MaintenanceUpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MaintenanceUpdatePolicy { + + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { + + /** MaintenanceWindow day */ + day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** MaintenanceWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + } + + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { + + /** + * Constructs a new MaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow); + + /** MaintenanceWindow day. */ + public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** MaintenanceWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceWindow instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Verifies a MaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DenyMaintenancePeriod. */ + interface IDenyMaintenancePeriod { + + /** DenyMaintenancePeriod startDate */ + startDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod endDate */ + endDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod time */ + time?: (google.type.ITimeOfDay|null); + } + + /** Represents a DenyMaintenancePeriod. */ + class DenyMaintenancePeriod implements IDenyMaintenancePeriod { + + /** + * Constructs a new DenyMaintenancePeriod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod); + + /** DenyMaintenancePeriod startDate. */ + public startDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod endDate. */ + public endDate?: (google.type.IDate|null); + + /** DenyMaintenancePeriod time. */ + public time?: (google.type.ITimeOfDay|null); + + /** + * Creates a new DenyMaintenancePeriod instance using the specified properties. + * @param [properties] Properties to set + * @returns DenyMaintenancePeriod instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @param message DenyMaintenancePeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @param message DenyMaintenancePeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Verifies a DenyMaintenancePeriod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DenyMaintenancePeriod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; + + /** + * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. + * @param message DenyMaintenancePeriod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DenyMaintenancePeriod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DenyMaintenancePeriod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { + + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MaintenanceSchedule. */ + class MaintenanceSchedule implements IMaintenanceSchedule { + + /** + * Constructs a new MaintenanceSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IMaintenanceSchedule); + + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IMaintenanceSchedule): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Verifies a MaintenanceSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceSchedule; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @param message MaintenanceSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); + + /** Cluster cloudsqlBackupRunSource */ + cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); + + /** Cluster name */ + name?: (string|null); + + /** Cluster displayName */ + displayName?: (string|null); + + /** Cluster uid */ + uid?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster state */ + state?: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State|null); + + /** Cluster clusterType */ + clusterType?: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType|null); + + /** Cluster databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null); + + /** Cluster network */ + network?: (string|null); + + /** Cluster etag */ + etag?: (string|null); + + /** Cluster annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Cluster reconciling */ + reconciling?: (boolean|null); + + /** Cluster initialUser */ + initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); + + /** Cluster automatedBackupPolicy */ + automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig */ + sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + + /** Cluster encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** Cluster encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** Cluster continuousBackupConfig */ + continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo */ + continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig */ + secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig */ + primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); + + /** Cluster satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Cluster pscConfig */ + pscConfig?: (google.cloud.alloydb.v1beta.Cluster.IPscConfig|null); + + /** Cluster maintenanceUpdatePolicy */ + maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); + + /** Cluster geminiConfig */ + geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiClusterConfig|null); + + /** Cluster subscriptionType */ + subscriptionType?: (google.cloud.alloydb.v1beta.SubscriptionType|keyof typeof google.cloud.alloydb.v1beta.SubscriptionType|null); + + /** Cluster trialMetadata */ + trialMetadata?: (google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null); + + /** Cluster tags */ + tags?: ({ [k: string]: string }|null); + + /** Cluster serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** Cluster dataplexConfig */ + dataplexConfig?: (google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICluster); + + /** Cluster backupSource. */ + public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + + /** Cluster migrationSource. */ + public migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); + + /** Cluster cloudsqlBackupRunSource. */ + public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); + + /** Cluster name. */ + public name: string; + + /** Cluster displayName. */ + public displayName: string; + + /** Cluster uid. */ + public uid: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster state. */ + public state: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State); + + /** Cluster clusterType. */ + public clusterType: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType); + + /** Cluster databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null); + + /** Cluster network. */ + public network: string; + + /** Cluster etag. */ + public etag: string; + + /** Cluster annotations. */ + public annotations: { [k: string]: string }; + + /** Cluster reconciling. */ + public reconciling: boolean; + + /** Cluster initialUser. */ + public initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); + + /** Cluster automatedBackupPolicy. */ + public automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); + + /** Cluster sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + + /** Cluster encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** Cluster encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** Cluster continuousBackupConfig. */ + public continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); + + /** Cluster continuousBackupInfo. */ + public continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); + + /** Cluster secondaryConfig. */ + public secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); + + /** Cluster primaryConfig. */ + public primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); + + /** Cluster satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Cluster pscConfig. */ + public pscConfig?: (google.cloud.alloydb.v1beta.Cluster.IPscConfig|null); + + /** Cluster maintenanceUpdatePolicy. */ + public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); + + /** Cluster geminiConfig. */ + public geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiClusterConfig|null); + + /** Cluster subscriptionType. */ + public subscriptionType: (google.cloud.alloydb.v1beta.SubscriptionType|keyof typeof google.cloud.alloydb.v1beta.SubscriptionType); + + /** Cluster trialMetadata. */ + public trialMetadata?: (google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null); + + /** Cluster tags. */ + public tags: { [k: string]: string }; + + /** Cluster serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** Cluster dataplexConfig. */ + public dataplexConfig?: (google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null); + + /** Cluster source. */ + public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICluster): google.cloud.alloydb.v1beta.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.INetworkConfig): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecondaryConfig. */ + interface ISecondaryConfig { + + /** SecondaryConfig primaryClusterName */ + primaryClusterName?: (string|null); + } + + /** Represents a SecondaryConfig. */ + class SecondaryConfig implements ISecondaryConfig { + + /** + * Constructs a new SecondaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig); + + /** SecondaryConfig primaryClusterName. */ + public primaryClusterName: string; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecondaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @param message SecondaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + + /** + * Verifies a SecondaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecondaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @param message SecondaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecondaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecondaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrimaryConfig. */ + interface IPrimaryConfig { + + /** PrimaryConfig secondaryClusterNames */ + secondaryClusterNames?: (string[]|null); + } + + /** Represents a PrimaryConfig. */ + class PrimaryConfig implements IPrimaryConfig { + + /** + * Constructs a new PrimaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig); + + /** PrimaryConfig secondaryClusterNames. */ + public secondaryClusterNames: string[]; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimaryConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @param message PrimaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + + /** + * Verifies a PrimaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @param message PrimaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrimaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrimaryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscConfig. */ + interface IPscConfig { + + /** PscConfig pscEnabled */ + pscEnabled?: (boolean|null); + + /** PscConfig serviceOwnedProjectNumber */ + serviceOwnedProjectNumber?: (number|Long|string|null); + } + + /** Represents a PscConfig. */ + class PscConfig implements IPscConfig { + + /** + * Constructs a new PscConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IPscConfig); + + /** PscConfig pscEnabled. */ + public pscEnabled: boolean; + + /** PscConfig serviceOwnedProjectNumber. */ + public serviceOwnedProjectNumber: (number|Long|string); + + /** + * Creates a new PscConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IPscConfig): google.cloud.alloydb.v1beta.Cluster.PscConfig; + + /** + * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. + * @param message PscConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. + * @param message PscConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.PscConfig; + + /** + * Decodes a PscConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.PscConfig; + + /** + * Verifies a PscConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.PscConfig; + + /** + * Creates a plain object from a PscConfig message. Also converts values to other types if specified. + * @param message PscConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.PscConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrialMetadata. */ + interface ITrialMetadata { + + /** TrialMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata upgradeTime */ + upgradeTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata graceEndTime */ + graceEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TrialMetadata. */ + class TrialMetadata implements ITrialMetadata { + + /** + * Constructs a new TrialMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata); + + /** TrialMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata upgradeTime. */ + public upgradeTime?: (google.protobuf.ITimestamp|null); + + /** TrialMetadata graceEndTime. */ + public graceEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TrialMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; + + /** + * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. + * @param message TrialMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. + * @param message TrialMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; + + /** + * Verifies a TrialMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; + + /** + * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. + * @param message TrialMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.TrialMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataplexConfig. */ + interface IDataplexConfig { + + /** DataplexConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a DataplexConfig. */ + class DataplexConfig implements IDataplexConfig { + + /** + * Constructs a new DataplexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig); + + /** DataplexConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataplexConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Verifies a DataplexConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataplexConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @param message DataplexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataplexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataplexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + EMPTY = 3, + CREATING = 4, + DELETING = 5, + FAILED = 6, + BOOTSTRAPPING = 7, + MAINTENANCE = 8, + PROMOTING = 9 + } + + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + SECONDARY = 2 + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance uid */ + uid?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance state */ + state?: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State|null); + + /** Instance instanceType */ + instanceType?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); + + /** Instance machineConfig */ + machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); + + /** Instance availabilityType */ + availabilityType?: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType|null); + + /** Instance gceZone */ + gceZone?: (string|null); + + /** Instance databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** Instance writableNode */ + writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); + + /** Instance nodes */ + nodes?: (google.cloud.alloydb.v1beta.Instance.INode[]|null); + + /** Instance queryInsightsConfig */ + queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance observabilityConfig */ + observabilityConfig?: (google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null); + + /** Instance readPoolConfig */ + readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); + + /** Instance ipAddress */ + ipAddress?: (string|null); + + /** Instance publicIpAddress */ + publicIpAddress?: (string|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance updatePolicy */ + updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); + + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance pscInstanceConfig */ + pscInstanceConfig?: (google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null); + + /** Instance networkConfig */ + networkConfig?: (google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null); + + /** Instance geminiConfig */ + geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null); + + /** Instance outboundPublicIpAddresses */ + outboundPublicIpAddresses?: (string[]|null); + + /** Instance activationPolicy */ + activationPolicy?: (google.cloud.alloydb.v1beta.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1beta.Instance.ActivationPolicy|null); + + /** Instance connectionPoolConfig */ + connectionPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null); + + /** Instance gcaConfig */ + gcaConfig?: (google.cloud.alloydb.v1beta.IGCAInstanceConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance uid. */ + public uid: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance state. */ + public state: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State); + + /** Instance instanceType. */ + public instanceType: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); + + /** Instance machineConfig. */ + public machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); + + /** Instance availabilityType. */ + public availabilityType: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType); + + /** Instance gceZone. */ + public gceZone: string; + + /** Instance databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** Instance writableNode. */ + public writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); + + /** Instance nodes. */ + public nodes: google.cloud.alloydb.v1beta.Instance.INode[]; + + /** Instance queryInsightsConfig. */ + public queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); + + /** Instance observabilityConfig. */ + public observabilityConfig?: (google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null); + + /** Instance readPoolConfig. */ + public readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); + + /** Instance ipAddress. */ + public ipAddress: string; + + /** Instance publicIpAddress. */ + public publicIpAddress: string; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance updatePolicy. */ + public updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); + + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null); + + /** Instance satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Instance pscInstanceConfig. */ + public pscInstanceConfig?: (google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null); + + /** Instance networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null); + + /** Instance geminiConfig. */ + public geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null); + + /** Instance outboundPublicIpAddresses. */ + public outboundPublicIpAddresses: string[]; + + /** Instance activationPolicy. */ + public activationPolicy: (google.cloud.alloydb.v1beta.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1beta.Instance.ActivationPolicy); + + /** Instance connectionPoolConfig. */ + public connectionPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null); + + /** Instance gcaConfig. */ + public gcaConfig?: (google.cloud.alloydb.v1beta.IGCAInstanceConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IInstance): google.cloud.alloydb.v1beta.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Properties of a MachineConfig. */ + interface IMachineConfig { + + /** MachineConfig cpuCount */ + cpuCount?: (number|null); + + /** MachineConfig machineType */ + machineType?: (string|null); + } + + /** Represents a MachineConfig. */ + class MachineConfig implements IMachineConfig { + + /** + * Constructs a new MachineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig); + + /** MachineConfig cpuCount. */ + public cpuCount: number; + + /** MachineConfig machineType. */ + public machineType: string; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig): google.cloud.alloydb.v1beta.Instance.MachineConfig; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.MachineConfig; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.MachineConfig; + + /** + * Verifies a MachineConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.MachineConfig; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @param message MachineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Node. */ + interface INode { + + /** Node zoneId */ + zoneId?: (string|null); + + /** Node id */ + id?: (string|null); + + /** Node ip */ + ip?: (string|null); + + /** Node state */ + state?: (string|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.INode); + + /** Node zoneId. */ + public zoneId: string; + + /** Node id. */ + public id: string; + + /** Node ip. */ + public ip: string; + + /** Node state. */ + public state: string; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.INode): google.cloud.alloydb.v1beta.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryInsightsInstanceConfig. */ + interface IQueryInsightsInstanceConfig { + + /** QueryInsightsInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); + + /** QueryInsightsInstanceConfig recordClientAddress */ + recordClientAddress?: (boolean|null); + + /** QueryInsightsInstanceConfig queryStringLength */ + queryStringLength?: (number|null); + + /** QueryInsightsInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + } + + /** Represents a QueryInsightsInstanceConfig. */ + class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig); + + /** QueryInsightsInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); + + /** QueryInsightsInstanceConfig recordClientAddress. */ + public recordClientAddress?: (boolean|null); + + /** QueryInsightsInstanceConfig queryStringLength. */ + public queryStringLength: number; + + /** QueryInsightsInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInsightsInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @param message QueryInsightsInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInsightsInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @param message QueryInsightsInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObservabilityInstanceConfig. */ + interface IObservabilityInstanceConfig { + + /** ObservabilityInstanceConfig enabled */ + enabled?: (boolean|null); + + /** ObservabilityInstanceConfig preserveComments */ + preserveComments?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEvents */ + trackWaitEvents?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEventTypes */ + trackWaitEventTypes?: (boolean|null); + + /** ObservabilityInstanceConfig maxQueryStringLength */ + maxQueryStringLength?: (number|null); + + /** ObservabilityInstanceConfig recordApplicationTags */ + recordApplicationTags?: (boolean|null); + + /** ObservabilityInstanceConfig queryPlansPerMinute */ + queryPlansPerMinute?: (number|null); + + /** ObservabilityInstanceConfig trackActiveQueries */ + trackActiveQueries?: (boolean|null); + + /** ObservabilityInstanceConfig trackClientAddress */ + trackClientAddress?: (boolean|null); + + /** ObservabilityInstanceConfig assistiveExperiencesEnabled */ + assistiveExperiencesEnabled?: (boolean|null); + } + + /** Represents an ObservabilityInstanceConfig. */ + class ObservabilityInstanceConfig implements IObservabilityInstanceConfig { + + /** + * Constructs a new ObservabilityInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig); + + /** ObservabilityInstanceConfig enabled. */ + public enabled?: (boolean|null); + + /** ObservabilityInstanceConfig preserveComments. */ + public preserveComments?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEvents. */ + public trackWaitEvents?: (boolean|null); + + /** ObservabilityInstanceConfig trackWaitEventTypes. */ + public trackWaitEventTypes?: (boolean|null); + + /** ObservabilityInstanceConfig maxQueryStringLength. */ + public maxQueryStringLength?: (number|null); + + /** ObservabilityInstanceConfig recordApplicationTags. */ + public recordApplicationTags?: (boolean|null); + + /** ObservabilityInstanceConfig queryPlansPerMinute. */ + public queryPlansPerMinute?: (number|null); + + /** ObservabilityInstanceConfig trackActiveQueries. */ + public trackActiveQueries?: (boolean|null); + + /** ObservabilityInstanceConfig trackClientAddress. */ + public trackClientAddress?: (boolean|null); + + /** ObservabilityInstanceConfig assistiveExperiencesEnabled. */ + public assistiveExperiencesEnabled?: (boolean|null); + + /** + * Creates a new ObservabilityInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObservabilityInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; + + /** + * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @param message ObservabilityInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @param message ObservabilityInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; + + /** + * Verifies an ObservabilityInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObservabilityInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; + + /** + * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. + * @param message ObservabilityInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObservabilityInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObservabilityInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadPoolConfig. */ + interface IReadPoolConfig { + + /** ReadPoolConfig nodeCount */ + nodeCount?: (number|null); + } + + /** Represents a ReadPoolConfig. */ + class ReadPoolConfig implements IReadPoolConfig { + + /** + * Constructs a new ReadPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig); + + /** ReadPoolConfig nodeCount. */ + public nodeCount: number; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * @param message ReadPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + + /** + * Verifies a ReadPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @param message ReadPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePolicy. */ + interface IUpdatePolicy { + + /** UpdatePolicy mode */ + mode?: (google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|null); + } + + /** Represents an UpdatePolicy. */ + class UpdatePolicy implements IUpdatePolicy { + + /** + * Constructs a new UpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy); + + /** UpdatePolicy mode. */ + public mode: (google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode); + + /** + * Creates a new UpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePolicy instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; + + /** + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. + * @param message UpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; + + /** + * Verifies an UpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; + + /** + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @param message UpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.UpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpdatePolicy { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DEFAULT = 1, + FORCE_APPLY = 2 + } + } + + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscInterfaceConfig. */ + interface IPscInterfaceConfig { + + /** PscInterfaceConfig networkAttachmentResource */ + networkAttachmentResource?: (string|null); + } + + /** Represents a PscInterfaceConfig. */ + class PscInterfaceConfig implements IPscInterfaceConfig { + + /** + * Constructs a new PscInterfaceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig); + + /** PscInterfaceConfig networkAttachmentResource. */ + public networkAttachmentResource: string; + + /** + * Creates a new PscInterfaceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscInterfaceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; + + /** + * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. + * @param message PscInterfaceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. + * @param message PscInterfaceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; + + /** + * Verifies a PscInterfaceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscInterfaceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; + + /** + * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. + * @param message PscInterfaceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscInterfaceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscInterfaceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscAutoConnectionConfig. */ + interface IPscAutoConnectionConfig { + + /** PscAutoConnectionConfig consumerProject */ + consumerProject?: (string|null); + + /** PscAutoConnectionConfig consumerNetwork */ + consumerNetwork?: (string|null); + + /** PscAutoConnectionConfig ipAddress */ + ipAddress?: (string|null); + + /** PscAutoConnectionConfig status */ + status?: (string|null); + + /** PscAutoConnectionConfig consumerNetworkStatus */ + consumerNetworkStatus?: (string|null); + } + + /** Represents a PscAutoConnectionConfig. */ + class PscAutoConnectionConfig implements IPscAutoConnectionConfig { + + /** + * Constructs a new PscAutoConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig); + + /** PscAutoConnectionConfig consumerProject. */ + public consumerProject: string; + + /** PscAutoConnectionConfig consumerNetwork. */ + public consumerNetwork: string; + + /** PscAutoConnectionConfig ipAddress. */ + public ipAddress: string; + + /** PscAutoConnectionConfig status. */ + public status: string; + + /** PscAutoConnectionConfig consumerNetworkStatus. */ + public consumerNetworkStatus: string; + + /** + * Creates a new PscAutoConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscAutoConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; + + /** + * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @param message PscAutoConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @param message PscAutoConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; + + /** + * Verifies a PscAutoConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscAutoConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; + + /** + * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. + * @param message PscAutoConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscAutoConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscAutoConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PscInstanceConfig. */ + interface IPscInstanceConfig { + + /** PscInstanceConfig serviceAttachmentLink */ + serviceAttachmentLink?: (string|null); + + /** PscInstanceConfig allowedConsumerProjects */ + allowedConsumerProjects?: (string[]|null); + + /** PscInstanceConfig pscDnsName */ + pscDnsName?: (string|null); + + /** PscInstanceConfig pscInterfaceConfigs */ + pscInterfaceConfigs?: (google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]|null); + + /** PscInstanceConfig pscAutoConnections */ + pscAutoConnections?: (google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig[]|null); + } + + /** Represents a PscInstanceConfig. */ + class PscInstanceConfig implements IPscInstanceConfig { + + /** + * Constructs a new PscInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig); + + /** PscInstanceConfig serviceAttachmentLink. */ + public serviceAttachmentLink: string; + + /** PscInstanceConfig allowedConsumerProjects. */ + public allowedConsumerProjects: string[]; + + /** PscInstanceConfig pscDnsName. */ + public pscDnsName: string; + + /** PscInstanceConfig pscInterfaceConfigs. */ + public pscInterfaceConfigs: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]; + + /** PscInstanceConfig pscAutoConnections. */ + public pscAutoConnections: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig[]; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PscInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; + + /** + * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. + * @param message PscInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. + * @param message PscInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; + + /** + * Verifies a PscInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PscInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; + + /** + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. + * @param message PscInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.PscInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PscInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PscInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceNetworkConfig. */ + interface IInstanceNetworkConfig { + + /** InstanceNetworkConfig authorizedExternalNetworks */ + authorizedExternalNetworks?: (google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]|null); + + /** InstanceNetworkConfig enablePublicIp */ + enablePublicIp?: (boolean|null); + + /** InstanceNetworkConfig enableOutboundPublicIp */ + enableOutboundPublicIp?: (boolean|null); + + /** InstanceNetworkConfig network */ + network?: (string|null); + + /** InstanceNetworkConfig allocatedIpRangeOverride */ + allocatedIpRangeOverride?: (string|null); + } + + /** Represents an InstanceNetworkConfig. */ + class InstanceNetworkConfig implements IInstanceNetworkConfig { + + /** + * Constructs a new InstanceNetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig); + + /** InstanceNetworkConfig authorizedExternalNetworks. */ + public authorizedExternalNetworks: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]; + + /** InstanceNetworkConfig enablePublicIp. */ + public enablePublicIp: boolean; + + /** InstanceNetworkConfig enableOutboundPublicIp. */ + public enableOutboundPublicIp: boolean; + + /** InstanceNetworkConfig network. */ + public network: string; + + /** InstanceNetworkConfig allocatedIpRangeOverride. */ + public allocatedIpRangeOverride: string; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceNetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; + + /** + * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. + * @param message InstanceNetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. + * @param message InstanceNetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; + + /** + * Verifies an InstanceNetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceNetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; + + /** + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. + * @param message InstanceNetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceNetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceNetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceNetworkConfig { + + /** Properties of an AuthorizedNetwork. */ + interface IAuthorizedNetwork { + + /** AuthorizedNetwork cidrRange */ + cidrRange?: (string|null); + } + + /** Represents an AuthorizedNetwork. */ + class AuthorizedNetwork implements IAuthorizedNetwork { + + /** + * Constructs a new AuthorizedNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork); + + /** AuthorizedNetwork cidrRange. */ + public cidrRange: string; + + /** + * Creates a new AuthorizedNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizedNetwork instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @param message AuthorizedNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @param message AuthorizedNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Verifies an AuthorizedNetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizedNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; + + /** + * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. + * @param message AuthorizedNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizedNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizedNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ConnectionPoolConfig. */ + interface IConnectionPoolConfig { + + /** ConnectionPoolConfig enabled */ + enabled?: (boolean|null); + + /** ConnectionPoolConfig flags */ + flags?: ({ [k: string]: string }|null); + + /** ConnectionPoolConfig poolerCount */ + poolerCount?: (number|null); + } + + /** Represents a ConnectionPoolConfig. */ + class ConnectionPoolConfig implements IConnectionPoolConfig { + + /** + * Constructs a new ConnectionPoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig); + + /** ConnectionPoolConfig enabled. */ + public enabled: boolean; + + /** ConnectionPoolConfig flags. */ + public flags: { [k: string]: string }; + + /** ConnectionPoolConfig poolerCount. */ + public poolerCount: number; + + /** + * Creates a new ConnectionPoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionPoolConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; + + /** + * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. + * @param message ConnectionPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. + * @param message ConnectionPoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; + + /** + * Verifies a ConnectionPoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionPoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; + + /** + * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. + * @param message ConnectionPoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionPoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionPoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + STOPPED = 2, + CREATING = 3, + DELETING = 4, + MAINTENANCE = 5, + FAILED = 6, + BOOTSTRAPPING = 8, + PROMOTING = 9 + } + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + READ_POOL = 2, + SECONDARY = 3 + } + + /** AvailabilityType enum. */ + enum AvailabilityType { + AVAILABILITY_TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2 + } + + /** ActivationPolicy enum. */ + enum ActivationPolicy { + ACTIVATION_POLICY_UNSPECIFIED = 0, + ALWAYS = 1, + NEVER = 2 + } + } + + /** Properties of a ConnectionInfo. */ + interface IConnectionInfo { + + /** ConnectionInfo name */ + name?: (string|null); + + /** ConnectionInfo ipAddress */ + ipAddress?: (string|null); + + /** ConnectionInfo publicIpAddress */ + publicIpAddress?: (string|null); + + /** ConnectionInfo pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** ConnectionInfo instanceUid */ + instanceUid?: (string|null); + + /** ConnectionInfo pscDnsName */ + pscDnsName?: (string|null); + } + + /** Represents a ConnectionInfo. */ + class ConnectionInfo implements IConnectionInfo { + + /** + * Constructs a new ConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IConnectionInfo); + + /** ConnectionInfo name. */ + public name: string; + + /** ConnectionInfo ipAddress. */ + public ipAddress: string; + + /** ConnectionInfo publicIpAddress. */ + public publicIpAddress: string; + + /** ConnectionInfo pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** ConnectionInfo instanceUid. */ + public instanceUid: string; + + /** ConnectionInfo pscDnsName. */ + public pscDnsName: string; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IConnectionInfo): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @param message ConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Verifies a ConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ConnectionInfo; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @param message ConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup displayName */ + displayName?: (string|null); + + /** Backup uid */ + uid?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup createCompletionTime */ + createCompletionTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup state */ + state?: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State|null); + + /** Backup type */ + type?: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type|null); + + /** Backup description */ + description?: (string|null); + + /** Backup clusterUid */ + clusterUid?: (string|null); + + /** Backup clusterName */ + clusterName?: (string|null); + + /** Backup reconciling */ + reconciling?: (boolean|null); + + /** Backup encryptionConfig */ + encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** Backup encryptionInfo */ + encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Backup sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** Backup expiryTime */ + expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity */ + expiryQuantity?: (google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** Backup tags */ + tags?: ({ [k: string]: string }|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup displayName. */ + public displayName: string; + + /** Backup uid. */ + public uid: string; + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Backup createCompletionTime. */ + public createCompletionTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup state. */ + public state: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State); + + /** Backup type. */ + public type: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type); + + /** Backup description. */ + public description: string; + + /** Backup clusterUid. */ + public clusterUid: string; + + /** Backup clusterName. */ + public clusterName: string; + + /** Backup reconciling. */ + public reconciling: boolean; + + /** Backup encryptionConfig. */ + public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); + + /** Backup encryptionInfo. */ + public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); + + /** Backup etag. */ + public etag: string; + + /** Backup annotations. */ + public annotations: { [k: string]: string }; + + /** Backup sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** Backup expiryTime. */ + public expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity. */ + public expiryQuantity?: (google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null); + + /** Backup satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** Backup tags. */ + public tags: { [k: string]: string }; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBackup): google.cloud.alloydb.v1beta.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** Properties of a QuantityBasedExpiry. */ + interface IQuantityBasedExpiry { + + /** QuantityBasedExpiry retentionCount */ + retentionCount?: (number|null); + + /** QuantityBasedExpiry totalRetentionCount */ + totalRetentionCount?: (number|null); + } + + /** Represents a QuantityBasedExpiry. */ + class QuantityBasedExpiry implements IQuantityBasedExpiry { + + /** + * Constructs a new QuantityBasedExpiry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry); + + /** QuantityBasedExpiry retentionCount. */ + public retentionCount: number; + + /** QuantityBasedExpiry totalRetentionCount. */ + public totalRetentionCount: number; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedExpiry instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Verifies a QuantityBasedExpiry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedExpiry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @param message QuantityBasedExpiry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + CREATING = 2, + FAILED = 3, + DELETING = 4 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ON_DEMAND = 1, + AUTOMATED = 2, + CONTINUOUS = 3 + } + } + + /** Properties of a SupportedDatabaseFlag. */ + interface ISupportedDatabaseFlag { + + /** SupportedDatabaseFlag stringRestrictions */ + stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions */ + integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag recommendedStringValue */ + recommendedStringValue?: (string|null); + + /** SupportedDatabaseFlag recommendedIntegerValue */ + recommendedIntegerValue?: (google.protobuf.IInt64Value|null); + + /** SupportedDatabaseFlag name */ + name?: (string|null); + + /** SupportedDatabaseFlag flagName */ + flagName?: (string|null); + + /** SupportedDatabaseFlag valueType */ + valueType?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null); + + /** SupportedDatabaseFlag acceptsMultipleValues */ + acceptsMultipleValues?: (boolean|null); + + /** SupportedDatabaseFlag supportedDbVersions */ + supportedDbVersions?: (google.cloud.alloydb.v1beta.DatabaseVersion[]|null); + + /** SupportedDatabaseFlag requiresDbRestart */ + requiresDbRestart?: (boolean|null); + + /** SupportedDatabaseFlag scope */ + scope?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null); + } + + /** Represents a SupportedDatabaseFlag. */ + class SupportedDatabaseFlag implements ISupportedDatabaseFlag { + + /** + * Constructs a new SupportedDatabaseFlag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag); + + /** SupportedDatabaseFlag stringRestrictions. */ + public stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); + + /** SupportedDatabaseFlag integerRestrictions. */ + public integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); + + /** SupportedDatabaseFlag recommendedStringValue. */ + public recommendedStringValue?: (string|null); + + /** SupportedDatabaseFlag recommendedIntegerValue. */ + public recommendedIntegerValue?: (google.protobuf.IInt64Value|null); + + /** SupportedDatabaseFlag name. */ + public name: string; + + /** SupportedDatabaseFlag flagName. */ + public flagName: string; + + /** SupportedDatabaseFlag valueType. */ + public valueType: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType); + + /** SupportedDatabaseFlag acceptsMultipleValues. */ + public acceptsMultipleValues: boolean; + + /** SupportedDatabaseFlag supportedDbVersions. */ + public supportedDbVersions: google.cloud.alloydb.v1beta.DatabaseVersion[]; + + /** SupportedDatabaseFlag requiresDbRestart. */ + public requiresDbRestart: boolean; + + /** SupportedDatabaseFlag scope. */ + public scope: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope); + + /** SupportedDatabaseFlag restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** SupportedDatabaseFlag recommendedValue. */ + public recommendedValue?: ("recommendedStringValue"|"recommendedIntegerValue"); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedDatabaseFlag instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @param message SupportedDatabaseFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + + /** + * Verifies a SupportedDatabaseFlag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedDatabaseFlag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @param message SupportedDatabaseFlag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SupportedDatabaseFlag { + + /** Properties of a StringRestrictions. */ + interface IStringRestrictions { + + /** StringRestrictions allowedValues */ + allowedValues?: (string[]|null); + } + + /** Represents a StringRestrictions. */ + class StringRestrictions implements IStringRestrictions { + + /** + * Constructs a new StringRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions); + + /** StringRestrictions allowedValues. */ + public allowedValues: string[]; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns StringRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @param message StringRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; + + /** + * Verifies a StringRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @param message StringRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntegerRestrictions. */ + interface IIntegerRestrictions { + + /** IntegerRestrictions minValue */ + minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue */ + maxValue?: (google.protobuf.IInt64Value|null); + } + + /** Represents an IntegerRestrictions. */ + class IntegerRestrictions implements IIntegerRestrictions { + + /** + * Constructs a new IntegerRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions); + + /** IntegerRestrictions minValue. */ + public minValue?: (google.protobuf.IInt64Value|null); + + /** IntegerRestrictions maxValue. */ + public maxValue?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerRestrictions instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @param message IntegerRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Verifies an IntegerRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @param message IntegerRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + FLOAT = 3, + NONE = 4 + } + + /** Scope enum. */ + enum Scope { + SCOPE_UNSPECIFIED = 0, + DATABASE = 1, + CONNECTION_POOL = 2 + } + } + + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User password */ + password?: (string|null); + + /** User databaseRoles */ + databaseRoles?: (string[]|null); + + /** User userType */ + userType?: (google.cloud.alloydb.v1beta.User.UserType|keyof typeof google.cloud.alloydb.v1beta.User.UserType|null); + + /** User keepExtraRoles */ + keepExtraRoles?: (boolean|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUser); + + /** User name. */ + public name: string; + + /** User password. */ + public password: string; + + /** User databaseRoles. */ + public databaseRoles: string[]; + + /** User userType. */ + public userType: (google.cloud.alloydb.v1beta.User.UserType|keyof typeof google.cloud.alloydb.v1beta.User.UserType); + + /** User keepExtraRoles. */ + public keepExtraRoles: boolean; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUser): google.cloud.alloydb.v1beta.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.User; + + /** + * Verifies a User message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** UserType enum. */ + enum UserType { + USER_TYPE_UNSPECIFIED = 0, + ALLOYDB_BUILT_IN = 1, + ALLOYDB_IAM_USER = 2 + } + } + + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database charset */ + charset?: (string|null); + + /** Database collation */ + collation?: (string|null); + + /** Database characterType */ + characterType?: (string|null); + + /** Database isTemplate */ + isTemplate?: (boolean|null); + + /** Database databaseTemplate */ + databaseTemplate?: (string|null); + + /** Database isTemplateDatabase */ + isTemplateDatabase?: (boolean|null); + } + + /** Represents a Database. */ + class Database implements IDatabase { + + /** + * Constructs a new Database. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IDatabase); + + /** Database name. */ + public name: string; + + /** Database charset. */ + public charset: string; + + /** Database collation. */ + public collation: string; + + /** Database characterType. */ + public characterType: string; + + /** Database isTemplate. */ + public isTemplate: boolean; + + /** Database databaseTemplate. */ + public databaseTemplate: string; + + /** Database isTemplateDatabase. */ + public isTemplateDatabase?: (boolean|null); + + /** + * Creates a new Database instance using the specified properties. + * @param [properties] Properties to set + * @returns Database instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IDatabase): google.cloud.alloydb.v1beta.Database; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. + * @param message Database message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Database message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Database; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Database; + + /** + * Verifies a Database message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Database + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Database; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @param message Database + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Database to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Database + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** GCAEntitlementType enum. */ + enum GCAEntitlementType { + GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0, + GCA_STANDARD = 1 + } + + /** Properties of a GeminiClusterConfig. */ + interface IGeminiClusterConfig { + + /** GeminiClusterConfig entitled */ + entitled?: (boolean|null); + } + + /** Represents a GeminiClusterConfig. */ + class GeminiClusterConfig implements IGeminiClusterConfig { + + /** + * Constructs a new GeminiClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGeminiClusterConfig); + + /** GeminiClusterConfig entitled. */ + public entitled: boolean; + + /** + * Creates a new GeminiClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GeminiClusterConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGeminiClusterConfig): google.cloud.alloydb.v1beta.GeminiClusterConfig; + + /** + * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. + * @param message GeminiClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. + * @param message GeminiClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GeminiClusterConfig; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GeminiClusterConfig; + + /** + * Verifies a GeminiClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeminiClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GeminiClusterConfig; + + /** + * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. + * @param message GeminiClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GeminiClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeminiClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeminiClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeminiInstanceConfig. */ + interface IGeminiInstanceConfig { + + /** GeminiInstanceConfig entitled */ + entitled?: (boolean|null); + } + + /** Represents a GeminiInstanceConfig. */ + class GeminiInstanceConfig implements IGeminiInstanceConfig { + + /** + * Constructs a new GeminiInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGeminiInstanceConfig); + + /** GeminiInstanceConfig entitled. */ + public entitled: boolean; + + /** + * Creates a new GeminiInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GeminiInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGeminiInstanceConfig): google.cloud.alloydb.v1beta.GeminiInstanceConfig; + + /** + * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. + * @param message GeminiInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. + * @param message GeminiInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GeminiInstanceConfig; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GeminiInstanceConfig; + + /** + * Verifies a GeminiInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeminiInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GeminiInstanceConfig; + + /** + * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. + * @param message GeminiInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GeminiInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeminiInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeminiInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCAInstanceConfig. */ + interface IGCAInstanceConfig { + + /** GCAInstanceConfig gcaEntitlement */ + gcaEntitlement?: (google.cloud.alloydb.v1beta.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1beta.GCAEntitlementType|null); + } + + /** Represents a GCAInstanceConfig. */ + class GCAInstanceConfig implements IGCAInstanceConfig { + + /** + * Constructs a new GCAInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGCAInstanceConfig); + + /** GCAInstanceConfig gcaEntitlement. */ + public gcaEntitlement: (google.cloud.alloydb.v1beta.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1beta.GCAEntitlementType); + + /** + * Creates a new GCAInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GCAInstanceConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGCAInstanceConfig): google.cloud.alloydb.v1beta.GCAInstanceConfig; + + /** + * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. + * @param message GCAInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. + * @param message GCAInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GCAInstanceConfig; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GCAInstanceConfig; + + /** + * Verifies a GCAInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCAInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GCAInstanceConfig; + + /** + * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. + * @param message GCAInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GCAInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCAInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCAInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AlloyDBAdmin */ + class AlloyDBAdmin extends $protobuf.rpc.Service { + + /** + * Constructs a new AlloyDBAdmin service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest): Promise; + + /** + * Calls ExportCluster. + * @param request ExportClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportCluster(request: google.cloud.alloydb.v1beta.IExportClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportClusterCallback): void; + + /** + * Calls ExportCluster. + * @param request ExportClusterRequest message or plain object + * @returns Promise + */ + public exportCluster(request: google.cloud.alloydb.v1beta.IExportClusterRequest): Promise; + + /** + * Calls ImportCluster. + * @param request ImportClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importCluster(request: google.cloud.alloydb.v1beta.IImportClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportClusterCallback): void; + + /** + * Calls ImportCluster. + * @param request ImportClusterRequest message or plain object + * @returns Promise + */ + public importCluster(request: google.cloud.alloydb.v1beta.IImportClusterRequest): Promise; + + /** + * Calls UpgradeCluster. + * @param request UpgradeClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public upgradeCluster(request: google.cloud.alloydb.v1beta.IUpgradeClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeClusterCallback): void; + + /** + * Calls UpgradeCluster. + * @param request UpgradeClusterRequest message or plain object + * @returns Promise + */ + public upgradeCluster(request: google.cloud.alloydb.v1beta.IUpgradeClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest): Promise; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback): void; + + /** + * Calls PromoteCluster. + * @param request PromoteClusterRequest message or plain object + * @returns Promise + */ + public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest): Promise; + + /** + * Calls SwitchoverCluster. + * @param request SwitchoverClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public switchoverCluster(request: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverClusterCallback): void; + + /** + * Calls SwitchoverCluster. + * @param request SwitchoverClusterRequest message or plain object + * @returns Promise + */ + public switchoverCluster(request: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest): Promise; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback): void; + + /** + * Calls RestoreCluster. + * @param request RestoreClusterRequest message or plain object + * @returns Promise + */ + public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest): Promise; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback): void; + + /** + * Calls CreateSecondaryCluster. + * @param request CreateSecondaryClusterRequest message or plain object + * @returns Promise + */ + public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest): Promise; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; + + /** + * Calls CreateSecondaryInstance. + * @param request CreateSecondaryInstanceRequest message or plain object + * @returns Promise + */ + public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): Promise; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback): void; + + /** + * Calls BatchCreateInstances. + * @param request BatchCreateInstancesRequest message or plain object + * @returns Promise + */ + public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): Promise; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback): void; + + /** + * Calls FailoverInstance. + * @param request FailoverInstanceRequest message or plain object + * @returns Promise + */ + public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): Promise; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public injectFault(request: google.cloud.alloydb.v1beta.IInjectFaultRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFaultCallback): void; + + /** + * Calls InjectFault. + * @param request InjectFaultRequest message or plain object + * @returns Promise + */ + public injectFault(request: google.cloud.alloydb.v1beta.IInjectFaultRequest): Promise; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback): void; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest): Promise; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExecuteSqlResponse + */ + public executeSql(request: google.cloud.alloydb.v1beta.IExecuteSqlRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSqlCallback): void; + + /** + * Calls ExecuteSql. + * @param request ExecuteSqlRequest message or plain object + * @returns Promise + */ + public executeSql(request: google.cloud.alloydb.v1beta.IExecuteSqlRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest): Promise; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; + + /** + * Calls ListSupportedDatabaseFlags. + * @param request ListSupportedDatabaseFlagsRequest message or plain object + * @returns Promise + */ + public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): Promise; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + */ + public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback): void; + + /** + * Calls GenerateClientCertificate. + * @param request GenerateClientCertificateRequest message or plain object + * @returns Promise + */ + public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): Promise; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionInfo + */ + public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback): void; + + /** + * Calls GetConnectionInfo. + * @param request GetConnectionInfoRequest message or plain object + * @returns Promise + */ + public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): Promise; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse + */ + public listUsers(request: google.cloud.alloydb.v1beta.IListUsersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsersCallback): void; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise + */ + public listUsers(request: google.cloud.alloydb.v1beta.IListUsersRequest): Promise; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public getUser(request: google.cloud.alloydb.v1beta.IGetUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUserCallback): void; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise + */ + public getUser(request: google.cloud.alloydb.v1beta.IGetUserRequest): Promise; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public createUser(request: google.cloud.alloydb.v1beta.ICreateUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUserCallback): void; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise + */ + public createUser(request: google.cloud.alloydb.v1beta.ICreateUserRequest): Promise; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public updateUser(request: google.cloud.alloydb.v1beta.IUpdateUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUserCallback): void; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise + */ + public updateUser(request: google.cloud.alloydb.v1beta.IUpdateUserRequest): Promise; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUser(request: google.cloud.alloydb.v1beta.IDeleteUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUserCallback): void; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.cloud.alloydb.v1beta.IDeleteUserRequest): Promise; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse + */ + public listDatabases(request: google.cloud.alloydb.v1beta.IListDatabasesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabasesCallback): void; + + /** + * Calls ListDatabases. + * @param request ListDatabasesRequest message or plain object + * @returns Promise + */ + public listDatabases(request: google.cloud.alloydb.v1beta.IListDatabasesRequest): Promise; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Database + */ + public createDatabase(request: google.cloud.alloydb.v1beta.ICreateDatabaseRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabaseCallback): void; + + /** + * Calls CreateDatabase. + * @param request CreateDatabaseRequest message or plain object + * @returns Promise + */ + public createDatabase(request: google.cloud.alloydb.v1beta.ICreateDatabaseRequest): Promise; + } + + namespace AlloyDBAdmin { + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|exportCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|importCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|upgradeCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpgradeClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|switchoverCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type SwitchoverClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Instance) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|injectFault}. + * @param error Error, if any + * @param [response] Operation + */ + type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|executeSql}. + * @param error Error, if any + * @param [response] ExecuteSqlResponse + */ + type ExecuteSqlCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ExecuteSqlResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Backup) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @param error Error, if any + * @param [response] ListSupportedDatabaseFlagsResponse + */ + type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. + * @param error Error, if any + * @param [response] GenerateClientCertificateResponse + */ + type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. + * @param error Error, if any + * @param [response] ConnectionInfo + */ + type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ConnectionInfo) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse + */ + type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListUsersResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getUser}. + * @param error Error, if any + * @param [response] User + */ + type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createUser}. + * @param error Error, if any + * @param [response] User + */ + type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateUser}. + * @param error Error, if any + * @param [response] User + */ + type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteUser}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listDatabases}. + * @param error Error, if any + * @param [response] ListDatabasesResponse + */ + type ListDatabasesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListDatabasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createDatabase}. + * @param error Error, if any + * @param [response] Database + */ + type CreateDatabaseCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Database) => void; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListClustersRequest): google.cloud.alloydb.v1beta.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.alloydb.v1beta.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.alloydb.v1beta.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListClustersResponse): google.cloud.alloydb.v1beta.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + + /** GetClusterRequest view */ + view?: (google.cloud.alloydb.v1beta.ClusterView|keyof typeof google.cloud.alloydb.v1beta.ClusterView|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** GetClusterRequest view. */ + public view: (google.cloud.alloydb.v1beta.ClusterView|keyof typeof google.cloud.alloydb.v1beta.ClusterView); + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest): google.cloud.alloydb.v1beta.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryClusterRequest. */ + interface ICreateSecondaryClusterRequest { + + /** CreateSecondaryClusterRequest parent */ + parent?: (string|null); + + /** CreateSecondaryClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateSecondaryClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateSecondaryClusterRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryClusterRequest. */ + class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest); + + /** CreateSecondaryClusterRequest parent. */ + public parent: string; + + /** CreateSecondaryClusterRequest clusterId. */ + public clusterId: string; + + /** CreateSecondaryClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateSecondaryClusterRequest requestId. */ + public requestId: string; + + /** CreateSecondaryClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @param message CreateSecondaryClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest): google.cloud.alloydb.v1beta.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + + /** UpdateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateClusterRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** UpdateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateClusterRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest): google.cloud.alloydb.v1beta.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGcsDestination); + + /** GcsDestination uri. */ + public uri: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGcsDestination): google.cloud.alloydb.v1beta.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportClusterRequest. */ + interface IExportClusterRequest { + + /** ExportClusterRequest gcsDestination */ + gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); + + /** ExportClusterRequest csvExportOptions */ + csvExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null); + + /** ExportClusterRequest sqlExportOptions */ + sqlExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null); + + /** ExportClusterRequest name */ + name?: (string|null); + + /** ExportClusterRequest database */ + database?: (string|null); + } + + /** Represents an ExportClusterRequest. */ + class ExportClusterRequest implements IExportClusterRequest { + + /** + * Constructs a new ExportClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IExportClusterRequest); + + /** ExportClusterRequest gcsDestination. */ + public gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); + + /** ExportClusterRequest csvExportOptions. */ + public csvExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null); + + /** ExportClusterRequest sqlExportOptions. */ + public sqlExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null); + + /** ExportClusterRequest name. */ + public name: string; + + /** ExportClusterRequest database. */ + public database: string; + + /** ExportClusterRequest destination. */ + public destination?: "gcsDestination"; + + /** ExportClusterRequest exportOptions. */ + public exportOptions?: ("csvExportOptions"|"sqlExportOptions"); + + /** + * Creates a new ExportClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IExportClusterRequest): google.cloud.alloydb.v1beta.ExportClusterRequest; + + /** + * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. + * @param message ExportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. + * @param message ExportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterRequest; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterRequest; + + /** + * Verifies an ExportClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterRequest; + + /** + * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. + * @param message ExportClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportClusterRequest { + + /** Properties of a CsvExportOptions. */ + interface ICsvExportOptions { + + /** CsvExportOptions selectQuery */ + selectQuery?: (string|null); + + /** CsvExportOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvExportOptions quoteCharacter */ + quoteCharacter?: (string|null); + + /** CsvExportOptions escapeCharacter */ + escapeCharacter?: (string|null); + } + + /** Represents a CsvExportOptions. */ + class CsvExportOptions implements ICsvExportOptions { + + /** + * Constructs a new CsvExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions); + + /** CsvExportOptions selectQuery. */ + public selectQuery: string; + + /** CsvExportOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvExportOptions quoteCharacter. */ + public quoteCharacter: string; + + /** CsvExportOptions escapeCharacter. */ + public escapeCharacter: string; + + /** + * Creates a new CsvExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvExportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; + + /** + * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @param message CsvExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @param message CsvExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; + + /** + * Verifies a CsvExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; + + /** + * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. + * @param message CsvExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlExportOptions. */ + interface ISqlExportOptions { + + /** SqlExportOptions tables */ + tables?: (string[]|null); + + /** SqlExportOptions schemaOnly */ + schemaOnly?: (boolean|null); + + /** SqlExportOptions cleanTargetObjects */ + cleanTargetObjects?: (boolean|null); + + /** SqlExportOptions ifExistTargetObjects */ + ifExistTargetObjects?: (boolean|null); + } + + /** Represents a SqlExportOptions. */ + class SqlExportOptions implements ISqlExportOptions { + + /** + * Constructs a new SqlExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions); + + /** SqlExportOptions tables. */ + public tables: string[]; + + /** SqlExportOptions schemaOnly. */ + public schemaOnly?: (boolean|null); + + /** SqlExportOptions cleanTargetObjects. */ + public cleanTargetObjects?: (boolean|null); + + /** SqlExportOptions ifExistTargetObjects. */ + public ifExistTargetObjects?: (boolean|null); + + /** + * Creates a new SqlExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlExportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; + + /** + * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @param message SqlExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @param message SqlExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; + + /** + * Verifies a SqlExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; + + /** + * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. + * @param message SqlExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportClusterResponse. */ + interface IExportClusterResponse { + + /** ExportClusterResponse gcsDestination */ + gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); + } + + /** Represents an ExportClusterResponse. */ + class ExportClusterResponse implements IExportClusterResponse { + + /** + * Constructs a new ExportClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IExportClusterResponse); + + /** ExportClusterResponse gcsDestination. */ + public gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); + + /** ExportClusterResponse destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new ExportClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IExportClusterResponse): google.cloud.alloydb.v1beta.ExportClusterResponse; + + /** + * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. + * @param message ExportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. + * @param message ExportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterResponse; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterResponse; + + /** + * Verifies an ExportClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterResponse; + + /** + * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. + * @param message ExportClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportClusterRequest. */ + interface IImportClusterRequest { + + /** ImportClusterRequest sqlImportOptions */ + sqlImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null); + + /** ImportClusterRequest csvImportOptions */ + csvImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null); + + /** ImportClusterRequest name */ + name?: (string|null); + + /** ImportClusterRequest gcsUri */ + gcsUri?: (string|null); + + /** ImportClusterRequest database */ + database?: (string|null); + + /** ImportClusterRequest user */ + user?: (string|null); + } + + /** Represents an ImportClusterRequest. */ + class ImportClusterRequest implements IImportClusterRequest { + + /** + * Constructs a new ImportClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IImportClusterRequest); + + /** ImportClusterRequest sqlImportOptions. */ + public sqlImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null); + + /** ImportClusterRequest csvImportOptions. */ + public csvImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null); + + /** ImportClusterRequest name. */ + public name: string; + + /** ImportClusterRequest gcsUri. */ + public gcsUri: string; + + /** ImportClusterRequest database. */ + public database: string; + + /** ImportClusterRequest user. */ + public user: string; + + /** ImportClusterRequest importOptions. */ + public importOptions?: ("sqlImportOptions"|"csvImportOptions"); + + /** + * Creates a new ImportClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IImportClusterRequest): google.cloud.alloydb.v1beta.ImportClusterRequest; + + /** + * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. + * @param message ImportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. + * @param message ImportClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterRequest; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterRequest; + + /** + * Verifies an ImportClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterRequest; + + /** + * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. + * @param message ImportClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportClusterRequest { + + /** Properties of a SqlImportOptions. */ + interface ISqlImportOptions { + } + + /** Represents a SqlImportOptions. */ + class SqlImportOptions implements ISqlImportOptions { + + /** + * Constructs a new SqlImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions); + + /** + * Creates a new SqlImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlImportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; + + /** + * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @param message SqlImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @param message SqlImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; + + /** + * Verifies a SqlImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; + + /** + * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. + * @param message SqlImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CsvImportOptions. */ + interface ICsvImportOptions { + + /** CsvImportOptions table */ + table?: (string|null); + + /** CsvImportOptions columns */ + columns?: (string[]|null); + + /** CsvImportOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvImportOptions quoteCharacter */ + quoteCharacter?: (string|null); + + /** CsvImportOptions escapeCharacter */ + escapeCharacter?: (string|null); + } + + /** Represents a CsvImportOptions. */ + class CsvImportOptions implements ICsvImportOptions { + + /** + * Constructs a new CsvImportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions); + + /** CsvImportOptions table. */ + public table: string; + + /** CsvImportOptions columns. */ + public columns: string[]; + + /** CsvImportOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvImportOptions quoteCharacter. */ + public quoteCharacter: string; + + /** CsvImportOptions escapeCharacter. */ + public escapeCharacter: string; + + /** + * Creates a new CsvImportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvImportOptions instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; + + /** + * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @param message CsvImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @param message CsvImportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; + + /** + * Verifies a CsvImportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvImportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; + + /** + * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. + * @param message CsvImportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvImportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvImportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportClusterResponse. */ + interface IImportClusterResponse { + + /** ImportClusterResponse bytesDownloaded */ + bytesDownloaded?: (number|Long|string|null); + } + + /** Represents an ImportClusterResponse. */ + class ImportClusterResponse implements IImportClusterResponse { + + /** + * Constructs a new ImportClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IImportClusterResponse); + + /** ImportClusterResponse bytesDownloaded. */ + public bytesDownloaded: (number|Long|string); + + /** + * Creates a new ImportClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IImportClusterResponse): google.cloud.alloydb.v1beta.ImportClusterResponse; + + /** + * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. + * @param message ImportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. + * @param message ImportClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterResponse; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterResponse; + + /** + * Verifies an ImportClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterResponse; + + /** + * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. + * @param message ImportClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterRequest. */ + interface IUpgradeClusterRequest { + + /** UpgradeClusterRequest name */ + name?: (string|null); + + /** UpgradeClusterRequest version */ + version?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** UpgradeClusterRequest requestId */ + requestId?: (string|null); + + /** UpgradeClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpgradeClusterRequest etag */ + etag?: (string|null); + } + + /** Represents an UpgradeClusterRequest. */ + class UpgradeClusterRequest implements IUpgradeClusterRequest { + + /** + * Constructs a new UpgradeClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterRequest); + + /** UpgradeClusterRequest name. */ + public name: string; + + /** UpgradeClusterRequest version. */ + public version: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** UpgradeClusterRequest requestId. */ + public requestId: string; + + /** UpgradeClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpgradeClusterRequest etag. */ + public etag: string; + + /** + * Creates a new UpgradeClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterRequest): google.cloud.alloydb.v1beta.UpgradeClusterRequest; + + /** + * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. + * @param message UpgradeClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. + * @param message UpgradeClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterRequest; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterRequest; + + /** + * Verifies an UpgradeClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterRequest; + + /** + * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. + * @param message UpgradeClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeClusterResponse. */ + interface IUpgradeClusterResponse { + + /** UpgradeClusterResponse status */ + status?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); + + /** UpgradeClusterResponse message */ + message?: (string|null); + + /** UpgradeClusterResponse clusterUpgradeDetails */ + clusterUpgradeDetails?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails[]|null); + } + + /** Represents an UpgradeClusterResponse. */ + class UpgradeClusterResponse implements IUpgradeClusterResponse { + + /** + * Constructs a new UpgradeClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterResponse); + + /** UpgradeClusterResponse status. */ + public status: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); + + /** UpgradeClusterResponse message. */ + public message: string; + + /** UpgradeClusterResponse clusterUpgradeDetails. */ + public clusterUpgradeDetails: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails[]; + + /** + * Creates a new UpgradeClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterResponse): google.cloud.alloydb.v1beta.UpgradeClusterResponse; + + /** + * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. + * @param message UpgradeClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. + * @param message UpgradeClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse; + + /** + * Verifies an UpgradeClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse; + + /** + * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. + * @param message UpgradeClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeClusterResponse { + + /** Properties of a StageInfo. */ + interface IStageInfo { + + /** StageInfo stage */ + stage?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null); + + /** StageInfo status */ + status?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); + + /** StageInfo logsUrl */ + logsUrl?: (string|null); + } + + /** Represents a StageInfo. */ + class StageInfo implements IStageInfo { + + /** + * Constructs a new StageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo); + + /** StageInfo stage. */ + public stage: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage); + + /** StageInfo status. */ + public status: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); + + /** StageInfo logsUrl. */ + public logsUrl: string; + + /** + * Creates a new StageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StageInfo instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; + + /** + * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @param message StageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @param message StageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; + + /** + * Decodes a StageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; + + /** + * Verifies a StageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; + + /** + * Creates a plain object from a StageInfo message. Also converts values to other types if specified. + * @param message StageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceUpgradeDetails. */ + interface IInstanceUpgradeDetails { + + /** InstanceUpgradeDetails name */ + name?: (string|null); + + /** InstanceUpgradeDetails upgradeStatus */ + upgradeStatus?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); + + /** InstanceUpgradeDetails instanceType */ + instanceType?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); + } + + /** Represents an InstanceUpgradeDetails. */ + class InstanceUpgradeDetails implements IInstanceUpgradeDetails { + + /** + * Constructs a new InstanceUpgradeDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails); + + /** InstanceUpgradeDetails name. */ + public name: string; + + /** InstanceUpgradeDetails upgradeStatus. */ + public upgradeStatus: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); + + /** InstanceUpgradeDetails instanceType. */ + public instanceType: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); + + /** + * Creates a new InstanceUpgradeDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceUpgradeDetails instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @param message InstanceUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @param message InstanceUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Verifies an InstanceUpgradeDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceUpgradeDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; + + /** + * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. + * @param message InstanceUpgradeDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceUpgradeDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceUpgradeDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterUpgradeDetails. */ + interface IClusterUpgradeDetails { + + /** ClusterUpgradeDetails name */ + name?: (string|null); + + /** ClusterUpgradeDetails upgradeStatus */ + upgradeStatus?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); + + /** ClusterUpgradeDetails clusterType */ + clusterType?: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType|null); + + /** ClusterUpgradeDetails databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** ClusterUpgradeDetails stageInfo */ + stageInfo?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo[]|null); + + /** ClusterUpgradeDetails instanceUpgradeDetails */ + instanceUpgradeDetails?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails[]|null); + } + + /** Represents a ClusterUpgradeDetails. */ + class ClusterUpgradeDetails implements IClusterUpgradeDetails { + + /** + * Constructs a new ClusterUpgradeDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails); + + /** ClusterUpgradeDetails name. */ + public name: string; + + /** ClusterUpgradeDetails upgradeStatus. */ + public upgradeStatus: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); + + /** ClusterUpgradeDetails clusterType. */ + public clusterType: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType); + + /** ClusterUpgradeDetails databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** ClusterUpgradeDetails stageInfo. */ + public stageInfo: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo[]; + + /** ClusterUpgradeDetails instanceUpgradeDetails. */ + public instanceUpgradeDetails: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails[]; + + /** + * Creates a new ClusterUpgradeDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterUpgradeDetails instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @param message ClusterUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @param message ClusterUpgradeDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Verifies a ClusterUpgradeDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterUpgradeDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; + + /** + * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. + * @param message ClusterUpgradeDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterUpgradeDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterUpgradeDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + NOT_STARTED = 4, + IN_PROGRESS = 5, + SUCCESS = 1, + FAILED = 2, + PARTIAL_SUCCESS = 3, + CANCEL_IN_PROGRESS = 6, + CANCELLED = 7 + } + + /** Stage enum. */ + enum Stage { + STAGE_UNSPECIFIED = 0, + ALLOYDB_PRECHECK = 1, + PG_UPGRADE_CHECK = 2, + PREPARE_FOR_UPGRADE = 5, + PRIMARY_INSTANCE_UPGRADE = 3, + READ_POOL_INSTANCES_UPGRADE = 4, + ROLLBACK = 6, + CLEANUP = 7 + } + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + + /** DeleteClusterRequest etag */ + etag?: (string|null); + + /** DeleteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteClusterRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** DeleteClusterRequest etag. */ + public etag: string; + + /** DeleteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteClusterRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest): google.cloud.alloydb.v1beta.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SwitchoverClusterRequest. */ + interface ISwitchoverClusterRequest { + + /** SwitchoverClusterRequest name */ + name?: (string|null); + + /** SwitchoverClusterRequest requestId */ + requestId?: (string|null); + + /** SwitchoverClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a SwitchoverClusterRequest. */ + class SwitchoverClusterRequest implements ISwitchoverClusterRequest { + + /** + * Constructs a new SwitchoverClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest); + + /** SwitchoverClusterRequest name. */ + public name: string; + + /** SwitchoverClusterRequest requestId. */ + public requestId: string; + + /** SwitchoverClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new SwitchoverClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SwitchoverClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; + + /** + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. + * @param message SwitchoverClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. + * @param message SwitchoverClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; + + /** + * Verifies a SwitchoverClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwitchoverClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; + + /** + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. + * @param message SwitchoverClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SwitchoverClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwitchoverClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SwitchoverClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteClusterRequest. */ + interface IPromoteClusterRequest { + + /** PromoteClusterRequest name */ + name?: (string|null); + + /** PromoteClusterRequest requestId */ + requestId?: (string|null); + + /** PromoteClusterRequest etag */ + etag?: (string|null); + + /** PromoteClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a PromoteClusterRequest. */ + class PromoteClusterRequest implements IPromoteClusterRequest { + + /** + * Constructs a new PromoteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest); + + /** PromoteClusterRequest name. */ + public name: string; + + /** PromoteClusterRequest requestId. */ + public requestId: string; + + /** PromoteClusterRequest etag. */ + public etag: string; + + /** PromoteClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest): google.cloud.alloydb.v1beta.PromoteClusterRequest; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * @param message PromoteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.PromoteClusterRequest; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.PromoteClusterRequest; + + /** + * Verifies a PromoteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.PromoteClusterRequest; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @param message PromoteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreClusterRequest. */ + interface IRestoreClusterRequest { + + /** RestoreClusterRequest backupSource */ + backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource */ + continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent */ + parent?: (string|null); + + /** RestoreClusterRequest clusterId */ + clusterId?: (string|null); + + /** RestoreClusterRequest cluster */ + cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** RestoreClusterRequest requestId */ + requestId?: (string|null); + + /** RestoreClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a RestoreClusterRequest. */ + class RestoreClusterRequest implements IRestoreClusterRequest { + + /** + * Constructs a new RestoreClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest); + + /** RestoreClusterRequest backupSource. */ + public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); + + /** RestoreClusterRequest continuousBackupSource. */ + public continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); + + /** RestoreClusterRequest parent. */ + public parent: string; + + /** RestoreClusterRequest clusterId. */ + public clusterId: string; + + /** RestoreClusterRequest cluster. */ + public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); + + /** RestoreClusterRequest requestId. */ + public requestId: string; + + /** RestoreClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** RestoreClusterRequest source. */ + public source?: ("backupSource"|"continuousBackupSource"); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreClusterRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest): google.cloud.alloydb.v1beta.RestoreClusterRequest; + + /** + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * @param message RestoreClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestoreClusterRequest; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestoreClusterRequest; + + /** + * Verifies a RestoreClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestoreClusterRequest; + + /** + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @param message RestoreClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest): google.cloud.alloydb.v1beta.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1beta.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse): google.cloud.alloydb.v1beta.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + + /** GetInstanceRequest view */ + view?: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** GetInstanceRequest view. */ + public view: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView); + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest): google.cloud.alloydb.v1beta.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** CreateInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** CreateInstanceRequest requestId. */ + public requestId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest): google.cloud.alloydb.v1beta.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecondaryInstanceRequest. */ + interface ICreateSecondaryInstanceRequest { + + /** CreateSecondaryInstanceRequest parent */ + parent?: (string|null); + + /** CreateSecondaryInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateSecondaryInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId */ + requestId?: (string|null); + + /** CreateSecondaryInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateSecondaryInstanceRequest. */ + class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest); + + /** CreateSecondaryInstanceRequest parent. */ + public parent: string; + + /** CreateSecondaryInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateSecondaryInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** CreateSecondaryInstanceRequest requestId. */ + public requestId: string; + + /** CreateSecondaryInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecondaryInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * @param message CreateSecondaryInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecondaryInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @param message CreateSecondaryInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequests. */ + interface ICreateInstanceRequests { + + /** CreateInstanceRequests createInstanceRequests */ + createInstanceRequests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequest[]|null); + } + + /** Represents a CreateInstanceRequests. */ + class CreateInstanceRequests implements ICreateInstanceRequests { + + /** + * Constructs a new CreateInstanceRequests. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests); + + /** CreateInstanceRequests createInstanceRequests. */ + public createInstanceRequests: google.cloud.alloydb.v1beta.ICreateInstanceRequest[]; + + /** + * Creates a new CreateInstanceRequests instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequests instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests): google.cloud.alloydb.v1beta.CreateInstanceRequests; + + /** + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * @param message CreateInstanceRequests message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequests; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequests; + + /** + * Verifies a CreateInstanceRequests message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequests + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequests; + + /** + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @param message CreateInstanceRequests + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequests to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequests + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesRequest. */ + interface IBatchCreateInstancesRequest { + + /** BatchCreateInstancesRequest parent */ + parent?: (string|null); + + /** BatchCreateInstancesRequest requests */ + requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId */ + requestId?: (string|null); + } + + /** Represents a BatchCreateInstancesRequest. */ + class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { + + /** + * Constructs a new BatchCreateInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest); + + /** BatchCreateInstancesRequest parent. */ + public parent: string; + + /** BatchCreateInstancesRequest requests. */ + public requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); + + /** BatchCreateInstancesRequest requestId. */ + public requestId: string; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + + /** + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * @param message BatchCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + + /** + * Verifies a BatchCreateInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; + + /** + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @param message BatchCreateInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesResponse. */ + interface IBatchCreateInstancesResponse { + + /** BatchCreateInstancesResponse instances */ + instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); + } + + /** Represents a BatchCreateInstancesResponse. */ + class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { + + /** + * Constructs a new BatchCreateInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse); + + /** BatchCreateInstancesResponse instances. */ + public instances: google.cloud.alloydb.v1beta.IInstance[]; + + /** + * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + + /** + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * @param message BatchCreateInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + + /** + * Verifies a BatchCreateInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; + + /** + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @param message BatchCreateInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstancesMetadata. */ + interface IBatchCreateInstancesMetadata { + + /** BatchCreateInstancesMetadata instanceTargets */ + instanceTargets?: (string[]|null); + + /** BatchCreateInstancesMetadata instanceStatuses */ + instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }|null); + } + + /** Represents a BatchCreateInstancesMetadata. */ + class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { + + /** + * Constructs a new BatchCreateInstancesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata); + + /** BatchCreateInstancesMetadata instanceTargets. */ + public instanceTargets: string[]; + + /** BatchCreateInstancesMetadata instanceStatuses. */ + public instanceStatuses: { [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }; + + /** + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstancesMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + + /** + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * @param message BatchCreateInstancesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + + /** + * Verifies a BatchCreateInstancesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstancesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; + + /** + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @param message BatchCreateInstancesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstancesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstancesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateInstanceStatus. */ + interface IBatchCreateInstanceStatus { + + /** BatchCreateInstanceStatus state */ + state?: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null); + + /** BatchCreateInstanceStatus errorMsg */ + errorMsg?: (string|null); + + /** BatchCreateInstanceStatus error */ + error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type */ + type?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); + } + + /** Represents a BatchCreateInstanceStatus. */ + class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { + + /** + * Constructs a new BatchCreateInstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus); + + /** BatchCreateInstanceStatus state. */ + public state: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State); + + /** BatchCreateInstanceStatus errorMsg. */ + public errorMsg: string; + + /** BatchCreateInstanceStatus error. */ + public error?: (google.rpc.IStatus|null); + + /** BatchCreateInstanceStatus type. */ + public type: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateInstanceStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + + /** + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * @param message BatchCreateInstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + + /** + * Verifies a BatchCreateInstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateInstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @param message BatchCreateInstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateInstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchCreateInstanceStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING_CREATE = 1, + READY = 2, + CREATING = 3, + DELETING = 4, + FAILED = 5, + ROLLED_BACK = 6 + } + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** UpdateInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateInstanceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.alloydb.v1beta.IInstance|null); + + /** UpdateInstanceRequest requestId. */ + public requestId: string; + + /** UpdateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateInstanceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest requestId */ + requestId?: (string|null); + + /** DeleteInstanceRequest etag */ + etag?: (string|null); + + /** DeleteInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest requestId. */ + public requestId: string; + + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** DeleteInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FailoverInstanceRequest. */ + interface IFailoverInstanceRequest { + + /** FailoverInstanceRequest name */ + name?: (string|null); + + /** FailoverInstanceRequest requestId */ + requestId?: (string|null); + + /** FailoverInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a FailoverInstanceRequest. */ + class FailoverInstanceRequest implements IFailoverInstanceRequest { + + /** + * Constructs a new FailoverInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest); + + /** FailoverInstanceRequest name. */ + public name: string; + + /** FailoverInstanceRequest requestId. */ + public requestId: string; + + /** FailoverInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FailoverInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + + /** + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * @param message FailoverInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + + /** + * Verifies a FailoverInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FailoverInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.FailoverInstanceRequest; + + /** + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @param message FailoverInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FailoverInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FailoverInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InjectFaultRequest. */ + interface IInjectFaultRequest { + + /** InjectFaultRequest faultType */ + faultType?: (google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|null); + + /** InjectFaultRequest name */ + name?: (string|null); + + /** InjectFaultRequest requestId */ + requestId?: (string|null); + + /** InjectFaultRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an InjectFaultRequest. */ + class InjectFaultRequest implements IInjectFaultRequest { + + /** + * Constructs a new InjectFaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IInjectFaultRequest); + + /** InjectFaultRequest faultType. */ + public faultType: (google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType); + + /** InjectFaultRequest name. */ + public name: string; + + /** InjectFaultRequest requestId. */ + public requestId: string; + + /** InjectFaultRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InjectFaultRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IInjectFaultRequest): google.cloud.alloydb.v1beta.InjectFaultRequest; + + /** + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. + * @param message InjectFaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.InjectFaultRequest; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.InjectFaultRequest; + + /** + * Verifies an InjectFaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InjectFaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.InjectFaultRequest; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @param message InjectFaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InjectFaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InjectFaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InjectFaultRequest { + + /** FaultType enum. */ + enum FaultType { + FAULT_TYPE_UNSPECIFIED = 0, + STOP_VM = 1 + } + } + + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + + /** RestartInstanceRequest requestId */ + requestId?: (string|null); + + /** RestartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** RestartInstanceRequest nodeIds */ + nodeIds?: (string[]|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { + + /** + * Constructs a new RestartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest); + + /** RestartInstanceRequest name. */ + public name: string; + + /** RestartInstanceRequest requestId. */ + public requestId: string; + + /** RestartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** RestartInstanceRequest nodeIds. */ + public nodeIds: string[]; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartInstanceRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest): google.cloud.alloydb.v1beta.RestartInstanceRequest; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestartInstanceRequest; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestartInstanceRequest; + + /** + * Verifies a RestartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestartInstanceRequest; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlRequest. */ + interface IExecuteSqlRequest { + + /** ExecuteSqlRequest password */ + password?: (string|null); + + /** ExecuteSqlRequest instance */ + instance?: (string|null); + + /** ExecuteSqlRequest database */ + database?: (string|null); + + /** ExecuteSqlRequest user */ + user?: (string|null); + + /** ExecuteSqlRequest sqlStatement */ + sqlStatement?: (string|null); + + /** ExecuteSqlRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an ExecuteSqlRequest. */ + class ExecuteSqlRequest implements IExecuteSqlRequest { + + /** + * Constructs a new ExecuteSqlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IExecuteSqlRequest); + + /** ExecuteSqlRequest password. */ + public password?: (string|null); + + /** ExecuteSqlRequest instance. */ + public instance: string; + + /** ExecuteSqlRequest database. */ + public database: string; + + /** ExecuteSqlRequest user. */ + public user: string; + + /** ExecuteSqlRequest sqlStatement. */ + public sqlStatement: string; + + /** ExecuteSqlRequest validateOnly. */ + public validateOnly: boolean; + + /** ExecuteSqlRequest userCredential. */ + public userCredential?: "password"; + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IExecuteSqlRequest): google.cloud.alloydb.v1beta.ExecuteSqlRequest; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. + * @param message ExecuteSqlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExecuteSqlRequest; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExecuteSqlRequest; + + /** + * Verifies an ExecuteSqlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExecuteSqlRequest; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @param message ExecuteSqlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlResponse. */ + interface IExecuteSqlResponse { + + /** ExecuteSqlResponse sqlResults */ + sqlResults?: (google.cloud.alloydb.v1beta.ISqlResult[]|null); + + /** ExecuteSqlResponse metadata */ + metadata?: (google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null); + } + + /** Represents an ExecuteSqlResponse. */ + class ExecuteSqlResponse implements IExecuteSqlResponse { + + /** + * Constructs a new ExecuteSqlResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IExecuteSqlResponse); + + /** ExecuteSqlResponse sqlResults. */ + public sqlResults: google.cloud.alloydb.v1beta.ISqlResult[]; + + /** ExecuteSqlResponse metadata. */ + public metadata?: (google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null); + + /** + * Creates a new ExecuteSqlResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IExecuteSqlResponse): google.cloud.alloydb.v1beta.ExecuteSqlResponse; + + /** + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. + * @param message ExecuteSqlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. + * @param message ExecuteSqlResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExecuteSqlResponse; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExecuteSqlResponse; + + /** + * Verifies an ExecuteSqlResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExecuteSqlResponse; + + /** + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. + * @param message ExecuteSqlResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExecuteSqlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecuteSqlMetadata. */ + interface IExecuteSqlMetadata { + + /** ExecuteSqlMetadata message */ + message?: (string|null); + + /** ExecuteSqlMetadata partialResult */ + partialResult?: (boolean|null); + + /** ExecuteSqlMetadata sqlStatementExecutionDuration */ + sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); + + /** ExecuteSqlMetadata status */ + status?: (google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|null); + } + + /** Represents an ExecuteSqlMetadata. */ + class ExecuteSqlMetadata implements IExecuteSqlMetadata { + + /** + * Constructs a new ExecuteSqlMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IExecuteSqlMetadata); + + /** ExecuteSqlMetadata message. */ + public message: string; + + /** ExecuteSqlMetadata partialResult. */ + public partialResult: boolean; + + /** ExecuteSqlMetadata sqlStatementExecutionDuration. */ + public sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); + + /** ExecuteSqlMetadata status. */ + public status: (google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status); + + /** + * Creates a new ExecuteSqlMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecuteSqlMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IExecuteSqlMetadata): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; + + /** + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. + * @param message ExecuteSqlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. + * @param message ExecuteSqlMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; + + /** + * Verifies an ExecuteSqlMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecuteSqlMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; + + /** + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. + * @param message ExecuteSqlMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ExecuteSqlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecuteSqlMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecuteSqlMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecuteSqlMetadata { + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + OK = 1, + PARTIAL = 2, + ERROR = 3 + } + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest): google.cloud.alloydb.v1beta.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.alloydb.v1beta.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.alloydb.v1beta.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse): google.cloud.alloydb.v1beta.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest): google.cloud.alloydb.v1beta.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1beta.IBackup|null); + + /** CreateBackupRequest requestId */ + requestId?: (string|null); + + /** CreateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1beta.IBackup|null); + + /** CreateBackupRequest requestId. */ + public requestId: string; + + /** CreateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest): google.cloud.alloydb.v1beta.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.alloydb.v1beta.IBackup|null); + + /** UpdateBackupRequest requestId */ + requestId?: (string|null); + + /** UpdateBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.alloydb.v1beta.IBackup|null); + + /** UpdateBackupRequest requestId. */ + public requestId: string; + + /** UpdateBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest): google.cloud.alloydb.v1beta.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** DeleteBackupRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest): google.cloud.alloydb.v1beta.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSupportedDatabaseFlagsRequest. */ + interface IListSupportedDatabaseFlagsRequest { + + /** ListSupportedDatabaseFlagsRequest parent */ + parent?: (string|null); + + /** ListSupportedDatabaseFlagsRequest pageSize */ + pageSize?: (number|null); + + /** ListSupportedDatabaseFlagsRequest pageToken */ + pageToken?: (string|null); + + /** ListSupportedDatabaseFlagsRequest scope */ + scope?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null); + } + + /** Represents a ListSupportedDatabaseFlagsRequest. */ + class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { + + /** + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest); + + /** ListSupportedDatabaseFlagsRequest parent. */ + public parent: string; + + /** ListSupportedDatabaseFlagsRequest pageSize. */ + public pageSize: number; + + /** ListSupportedDatabaseFlagsRequest pageToken. */ + public pageToken: string; + + /** ListSupportedDatabaseFlagsRequest scope. */ + public scope: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope); + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSupportedDatabaseFlagsRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + + /** + * Verifies a ListSupportedDatabaseFlagsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSupportedDatabaseFlagsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSupportedDatabaseFlagsResponse. */ + interface IListSupportedDatabaseFlagsResponse { + + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ + supportedDatabaseFlags?: (google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]|null); + + /** ListSupportedDatabaseFlagsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSupportedDatabaseFlagsResponse. */ + class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { + + /** + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse); + + /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ + public supportedDatabaseFlags: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]; + + /** ListSupportedDatabaseFlagsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSupportedDatabaseFlagsResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + + /** + * Verifies a ListSupportedDatabaseFlagsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSupportedDatabaseFlagsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @param message ListSupportedDatabaseFlagsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateClientCertificateRequest. */ + interface IGenerateClientCertificateRequest { + + /** GenerateClientCertificateRequest parent */ + parent?: (string|null); + + /** GenerateClientCertificateRequest requestId */ + requestId?: (string|null); + + /** GenerateClientCertificateRequest pemCsr */ + pemCsr?: (string|null); + + /** GenerateClientCertificateRequest certDuration */ + certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey */ + publicKey?: (string|null); + + /** GenerateClientCertificateRequest useMetadataExchange */ + useMetadataExchange?: (boolean|null); + } + + /** Represents a GenerateClientCertificateRequest. */ + class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { + + /** + * Constructs a new GenerateClientCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest); + + /** GenerateClientCertificateRequest parent. */ + public parent: string; + + /** GenerateClientCertificateRequest requestId. */ + public requestId: string; + + /** GenerateClientCertificateRequest pemCsr. */ + public pemCsr: string; + + /** GenerateClientCertificateRequest certDuration. */ + public certDuration?: (google.protobuf.IDuration|null); + + /** GenerateClientCertificateRequest publicKey. */ + public publicKey: string; + + /** GenerateClientCertificateRequest useMetadataExchange. */ + public useMetadataExchange: boolean; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateClientCertificateRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + + /** + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * @param message GenerateClientCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + + /** + * Verifies a GenerateClientCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateClientCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; + + /** + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @param message GenerateClientCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateClientCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateClientCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateClientCertificateResponse. */ + interface IGenerateClientCertificateResponse { + + /** GenerateClientCertificateResponse pemCertificate */ + pemCertificate?: (string|null); + + /** GenerateClientCertificateResponse pemCertificateChain */ + pemCertificateChain?: (string[]|null); + + /** GenerateClientCertificateResponse caCert */ + caCert?: (string|null); + } + + /** Represents a GenerateClientCertificateResponse. */ + class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { + + /** + * Constructs a new GenerateClientCertificateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse); + + /** GenerateClientCertificateResponse pemCertificate. */ + public pemCertificate: string; + + /** GenerateClientCertificateResponse pemCertificateChain. */ + public pemCertificateChain: string[]; + + /** GenerateClientCertificateResponse caCert. */ + public caCert: string; + + /** + * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateClientCertificateResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + + /** + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * @param message GenerateClientCertificateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + + /** + * Verifies a GenerateClientCertificateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateClientCertificateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @param message GenerateClientCertificateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionInfoRequest. */ + interface IGetConnectionInfoRequest { + + /** GetConnectionInfoRequest parent */ + parent?: (string|null); + + /** GetConnectionInfoRequest requestId */ + requestId?: (string|null); + } + + /** Represents a GetConnectionInfoRequest. */ + class GetConnectionInfoRequest implements IGetConnectionInfoRequest { + + /** + * Constructs a new GetConnectionInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest); + + /** GetConnectionInfoRequest parent. */ + public parent: string; + + /** GetConnectionInfoRequest requestId. */ + public requestId: string; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionInfoRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * @param message GetConnectionInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + + /** + * Verifies a GetConnectionInfoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionInfoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @param message GetConnectionInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata batchCreateInstancesMetadata */ + batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); + + /** OperationMetadata promoteClusterStatus */ + promoteClusterStatus?: (google.cloud.alloydb.v1beta.IPromoteClusterStatus|null); + + /** OperationMetadata upgradeClusterStatus */ + upgradeClusterStatus?: (google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IOperationMetadata); + + /** OperationMetadata batchCreateInstancesMetadata. */ + public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); + + /** OperationMetadata promoteClusterStatus. */ + public promoteClusterStatus?: (google.cloud.alloydb.v1beta.IPromoteClusterStatus|null); + + /** OperationMetadata upgradeClusterStatus. */ + public upgradeClusterStatus?: (google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata requestSpecific. */ + public requestSpecific?: ("batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IOperationMetadata): google.cloud.alloydb.v1beta.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteClusterStatus. */ + interface IPromoteClusterStatus { + + /** PromoteClusterStatus state */ + state?: (google.cloud.alloydb.v1beta.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1beta.PromoteClusterStatus.State|null); + } + + /** Represents a PromoteClusterStatus. */ + class PromoteClusterStatus implements IPromoteClusterStatus { + + /** + * Constructs a new PromoteClusterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IPromoteClusterStatus); + + /** PromoteClusterStatus state. */ + public state: (google.cloud.alloydb.v1beta.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1beta.PromoteClusterStatus.State); + + /** + * Creates a new PromoteClusterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteClusterStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IPromoteClusterStatus): google.cloud.alloydb.v1beta.PromoteClusterStatus; + + /** + * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. + * @param message PromoteClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. + * @param message PromoteClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.PromoteClusterStatus; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.PromoteClusterStatus; + + /** + * Verifies a PromoteClusterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteClusterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.PromoteClusterStatus; + + /** + * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. + * @param message PromoteClusterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.PromoteClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteClusterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteClusterStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PromoteClusterStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROMOTE_CLUSTER_AVAILABLE_FOR_READ = 1, + PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE = 2, + PROMOTE_CLUSTER_COMPLETED = 3 + } + } + + /** Properties of an UpgradeClusterStatus. */ + interface IUpgradeClusterStatus { + + /** UpgradeClusterStatus state */ + state?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); + + /** UpgradeClusterStatus cancellable */ + cancellable?: (boolean|null); + + /** UpgradeClusterStatus sourceVersion */ + sourceVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** UpgradeClusterStatus targetVersion */ + targetVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); + + /** UpgradeClusterStatus stages */ + stages?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus[]|null); + } + + /** Represents an UpgradeClusterStatus. */ + class UpgradeClusterStatus implements IUpgradeClusterStatus { + + /** + * Constructs a new UpgradeClusterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterStatus); + + /** UpgradeClusterStatus state. */ + public state: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); + + /** UpgradeClusterStatus cancellable. */ + public cancellable: boolean; + + /** UpgradeClusterStatus sourceVersion. */ + public sourceVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** UpgradeClusterStatus targetVersion. */ + public targetVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + + /** UpgradeClusterStatus stages. */ + public stages: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus[]; + + /** + * Creates a new UpgradeClusterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeClusterStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterStatus): google.cloud.alloydb.v1beta.UpgradeClusterStatus; + + /** + * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. + * @param message UpgradeClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. + * @param message UpgradeClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus; + + /** + * Verifies an UpgradeClusterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeClusterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus; + + /** + * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. + * @param message UpgradeClusterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeClusterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeClusterStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeClusterStatus { + + /** Properties of a StageStatus. */ + interface IStageStatus { + + /** StageStatus readPoolInstancesUpgrade */ + readPoolInstancesUpgrade?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); + + /** StageStatus stage */ + stage?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null); + + /** StageStatus state */ + state?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); + + /** StageStatus schedule */ + schedule?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null); + } + + /** Represents a StageStatus. */ + class StageStatus implements IStageStatus { + + /** + * Constructs a new StageStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus); + + /** StageStatus readPoolInstancesUpgrade. */ + public readPoolInstancesUpgrade?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); + + /** StageStatus stage. */ + public stage: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage); + + /** StageStatus state. */ + public state: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); + + /** StageStatus schedule. */ + public schedule?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null); + + /** StageStatus stageSpecificStatus. */ + public stageSpecificStatus?: "readPoolInstancesUpgrade"; + + /** + * Creates a new StageStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns StageStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; + + /** + * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @param message StageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @param message StageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; + + /** + * Decodes a StageStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; + + /** + * Verifies a StageStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; + + /** + * Creates a plain object from a StageStatus message. Also converts values to other types if specified. + * @param message StageStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StageStatus { + + /** Properties of a StageSchedule. */ + interface IStageSchedule { + + /** StageSchedule estimatedStartTime */ + estimatedStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualStartTime */ + actualStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule estimatedEndTime */ + estimatedEndTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualEndTime */ + actualEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StageSchedule. */ + class StageSchedule implements IStageSchedule { + + /** + * Constructs a new StageSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule); + + /** StageSchedule estimatedStartTime. */ + public estimatedStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualStartTime. */ + public actualStartTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule estimatedEndTime. */ + public estimatedEndTime?: (google.protobuf.ITimestamp|null); + + /** StageSchedule actualEndTime. */ + public actualEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StageSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns StageSchedule instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @param message StageSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @param message StageSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Decodes a StageSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Verifies a StageSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; + + /** + * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. + * @param message StageSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadPoolInstancesUpgradeStageStatus. */ + interface IReadPoolInstancesUpgradeStageStatus { + + /** ReadPoolInstancesUpgradeStageStatus upgradeStats */ + upgradeStats?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); + } + + /** Represents a ReadPoolInstancesUpgradeStageStatus. */ + class ReadPoolInstancesUpgradeStageStatus implements IReadPoolInstancesUpgradeStageStatus { + + /** + * Constructs a new ReadPoolInstancesUpgradeStageStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus); + + /** ReadPoolInstancesUpgradeStageStatus upgradeStats. */ + public upgradeStats?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); + + /** + * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadPoolInstancesUpgradeStageStatus instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Verifies a ReadPoolInstancesUpgradeStageStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadPoolInstancesUpgradeStageStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; + + /** + * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. + * @param message ReadPoolInstancesUpgradeStageStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadPoolInstancesUpgradeStageStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadPoolInstancesUpgradeStageStatus { + + /** Properties of a Stats. */ + interface IStats { + + /** Stats notStarted */ + notStarted?: (number|null); + + /** Stats ongoing */ + ongoing?: (number|null); + + /** Stats success */ + success?: (number|null); + + /** Stats failed */ + failed?: (number|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats); + + /** Stats notStarted. */ + public notStarted: number; + + /** Stats ongoing. */ + public ongoing: number; + + /** Stats success. */ + public success: number; + + /** Stats failed. */ + public failed: number; + + /** + * Creates a new Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Stats instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Verifies a Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { + + /** ListUsersRequest parent */ + parent?: (string|null); + + /** ListUsersRequest pageSize */ + pageSize?: (number|null); + + /** ListUsersRequest pageToken */ + pageToken?: (string|null); + + /** ListUsersRequest filter */ + filter?: (string|null); + + /** ListUsersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { + + /** + * Constructs a new ListUsersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListUsersRequest); + + /** ListUsersRequest parent. */ + public parent: string; + + /** ListUsersRequest pageSize. */ + public pageSize: number; + + /** ListUsersRequest pageToken. */ + public pageToken: string; + + /** ListUsersRequest filter. */ + public filter: string; + + /** ListUsersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListUsersRequest): google.cloud.alloydb.v1beta.ListUsersRequest; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListUsersRequest; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListUsersRequest; + + /** + * Verifies a ListUsersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListUsersRequest; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { + + /** ListUsersResponse users */ + users?: (google.cloud.alloydb.v1beta.IUser[]|null); + + /** ListUsersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUsersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { + + /** + * Constructs a new ListUsersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListUsersResponse); + + /** ListUsersResponse users. */ + public users: google.cloud.alloydb.v1beta.IUser[]; + + /** ListUsersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUsersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListUsersResponse): google.cloud.alloydb.v1beta.ListUsersResponse; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListUsersResponse; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListUsersResponse; + + /** + * Verifies a ListUsersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListUsersResponse; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { + + /** GetUserRequest name */ + name?: (string|null); + } + + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { + + /** + * Constructs a new GetUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IGetUserRequest); + + /** GetUserRequest name. */ + public name: string; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IGetUserRequest): google.cloud.alloydb.v1beta.GetUserRequest; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetUserRequest; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetUserRequest; + + /** + * Verifies a GetUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetUserRequest; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { + + /** CreateUserRequest parent */ + parent?: (string|null); + + /** CreateUserRequest userId */ + userId?: (string|null); + + /** CreateUserRequest user */ + user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** CreateUserRequest requestId */ + requestId?: (string|null); + + /** CreateUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { + + /** + * Constructs a new CreateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateUserRequest); + + /** CreateUserRequest parent. */ + public parent: string; + + /** CreateUserRequest userId. */ + public userId: string; + + /** CreateUserRequest user. */ + public user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** CreateUserRequest requestId. */ + public requestId: string; + + /** CreateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateUserRequest): google.cloud.alloydb.v1beta.CreateUserRequest; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateUserRequest; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateUserRequest; + + /** + * Verifies a CreateUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateUserRequest; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { + + /** UpdateUserRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserRequest user */ + user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** UpdateUserRequest requestId */ + requestId?: (string|null); + + /** UpdateUserRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateUserRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { + + /** + * Constructs a new UpdateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IUpdateUserRequest); + + /** UpdateUserRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUserRequest user. */ + public user?: (google.cloud.alloydb.v1beta.IUser|null); + + /** UpdateUserRequest requestId. */ + public requestId: string; + + /** UpdateUserRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateUserRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IUpdateUserRequest): google.cloud.alloydb.v1beta.UpdateUserRequest; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateUserRequest; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateUserRequest; + + /** + * Verifies an UpdateUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateUserRequest; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { + + /** DeleteUserRequest name */ + name?: (string|null); + + /** DeleteUserRequest requestId */ + requestId?: (string|null); + + /** DeleteUserRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { + + /** + * Constructs a new DeleteUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IDeleteUserRequest); + + /** DeleteUserRequest name. */ + public name: string; + + /** DeleteUserRequest requestId. */ + public requestId: string; + + /** DeleteUserRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUserRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IDeleteUserRequest): google.cloud.alloydb.v1beta.DeleteUserRequest; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteUserRequest; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteUserRequest; + + /** + * Verifies a DeleteUserRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteUserRequest; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesRequest. */ + interface IListDatabasesRequest { + + /** ListDatabasesRequest parent */ + parent?: (string|null); + + /** ListDatabasesRequest pageSize */ + pageSize?: (number|null); + + /** ListDatabasesRequest pageToken */ + pageToken?: (string|null); + + /** ListDatabasesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListDatabasesRequest. */ + class ListDatabasesRequest implements IListDatabasesRequest { + + /** + * Constructs a new ListDatabasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListDatabasesRequest); + + /** ListDatabasesRequest parent. */ + public parent: string; + + /** ListDatabasesRequest pageSize. */ + public pageSize: number; + + /** ListDatabasesRequest pageToken. */ + public pageToken: string; + + /** ListDatabasesRequest filter. */ + public filter: string; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListDatabasesRequest): google.cloud.alloydb.v1beta.ListDatabasesRequest; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. + * @param message ListDatabasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListDatabasesRequest; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListDatabasesRequest; + + /** + * Verifies a ListDatabasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListDatabasesRequest; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @param message ListDatabasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatabasesResponse. */ + interface IListDatabasesResponse { + + /** ListDatabasesResponse databases */ + databases?: (google.cloud.alloydb.v1beta.IDatabase[]|null); + + /** ListDatabasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatabasesResponse. */ + class ListDatabasesResponse implements IListDatabasesResponse { + + /** + * Constructs a new ListDatabasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.IListDatabasesResponse); + + /** ListDatabasesResponse databases. */ + public databases: google.cloud.alloydb.v1beta.IDatabase[]; + + /** ListDatabasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatabasesResponse instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.IListDatabasesResponse): google.cloud.alloydb.v1beta.ListDatabasesResponse; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. + * @param message ListDatabasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListDatabasesResponse; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListDatabasesResponse; + + /** + * Verifies a ListDatabasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatabasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListDatabasesResponse; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @param message ListDatabasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatabasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatabaseRequest. */ + interface ICreateDatabaseRequest { + + /** CreateDatabaseRequest parent */ + parent?: (string|null); + + /** CreateDatabaseRequest databaseId */ + databaseId?: (string|null); + + /** CreateDatabaseRequest database */ + database?: (google.cloud.alloydb.v1beta.IDatabase|null); + } + + /** Represents a CreateDatabaseRequest. */ + class CreateDatabaseRequest implements ICreateDatabaseRequest { + + /** + * Constructs a new CreateDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ICreateDatabaseRequest); + + /** CreateDatabaseRequest parent. */ + public parent: string; + + /** CreateDatabaseRequest databaseId. */ + public databaseId: string; + + /** CreateDatabaseRequest database. */ + public database?: (google.cloud.alloydb.v1beta.IDatabase|null); + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatabaseRequest instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ICreateDatabaseRequest): google.cloud.alloydb.v1beta.CreateDatabaseRequest; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. + * @param message CreateDatabaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateDatabaseRequest; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateDatabaseRequest; + + /** + * Verifies a CreateDatabaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateDatabaseRequest; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @param message CreateDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResult. */ + interface ISqlResult { + + /** SqlResult columns */ + columns?: (google.cloud.alloydb.v1beta.ISqlResultColumn[]|null); + + /** SqlResult rows */ + rows?: (google.cloud.alloydb.v1beta.ISqlResultRow[]|null); + } + + /** Represents a SqlResult. */ + class SqlResult implements ISqlResult { + + /** + * Constructs a new SqlResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISqlResult); + + /** SqlResult columns. */ + public columns: google.cloud.alloydb.v1beta.ISqlResultColumn[]; + + /** SqlResult rows. */ + public rows: google.cloud.alloydb.v1beta.ISqlResultRow[]; + + /** + * Creates a new SqlResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResult instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISqlResult): google.cloud.alloydb.v1beta.SqlResult; + + /** + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. + * @param message SqlResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. + * @param message SqlResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResult; + + /** + * Decodes a SqlResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResult; + + /** + * Verifies a SqlResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResult; + + /** + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. + * @param message SqlResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SqlResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultColumn. */ + interface ISqlResultColumn { + + /** SqlResultColumn name */ + name?: (string|null); + + /** SqlResultColumn type */ + type?: (string|null); + } + + /** Represents a SqlResultColumn. */ + class SqlResultColumn implements ISqlResultColumn { + + /** + * Constructs a new SqlResultColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISqlResultColumn); + + /** SqlResultColumn name. */ + public name: string; + + /** SqlResultColumn type. */ + public type: string; + + /** + * Creates a new SqlResultColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultColumn instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISqlResultColumn): google.cloud.alloydb.v1beta.SqlResultColumn; + + /** + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. + * @param message SqlResultColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. + * @param message SqlResultColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResultColumn; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResultColumn; + + /** + * Verifies a SqlResultColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResultColumn; + + /** + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. + * @param message SqlResultColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SqlResultColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultRow. */ + interface ISqlResultRow { + + /** SqlResultRow values */ + values?: (google.cloud.alloydb.v1beta.ISqlResultValue[]|null); + } + + /** Represents a SqlResultRow. */ + class SqlResultRow implements ISqlResultRow { + + /** + * Constructs a new SqlResultRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISqlResultRow); + + /** SqlResultRow values. */ + public values: google.cloud.alloydb.v1beta.ISqlResultValue[]; + + /** + * Creates a new SqlResultRow instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultRow instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISqlResultRow): google.cloud.alloydb.v1beta.SqlResultRow; + + /** + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. + * @param message SqlResultRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. + * @param message SqlResultRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResultRow; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResultRow; + + /** + * Verifies a SqlResultRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResultRow; + + /** + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. + * @param message SqlResultRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SqlResultRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlResultValue. */ + interface ISqlResultValue { + + /** SqlResultValue value */ + value?: (string|null); + + /** SqlResultValue nullValue */ + nullValue?: (boolean|null); + } + + /** Represents a SqlResultValue. */ + class SqlResultValue implements ISqlResultValue { + + /** + * Constructs a new SqlResultValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.ISqlResultValue); + + /** SqlResultValue value. */ + public value?: (string|null); + + /** SqlResultValue nullValue. */ + public nullValue?: (boolean|null); + + /** + * Creates a new SqlResultValue instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlResultValue instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.ISqlResultValue): google.cloud.alloydb.v1beta.SqlResultValue; + + /** + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. + * @param message SqlResultValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. + * @param message SqlResultValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResultValue; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResultValue; + + /** + * Verifies a SqlResultValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlResultValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResultValue; + + /** + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. + * @param message SqlResultValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.SqlResultValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlResultValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlResultValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeOfDay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/protos/protos.js new file mode 100644 index 00000000000..0af3beae285 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/protos.js @@ -0,0 +1,142445 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_alloydb_protos || ($protobuf.roots._google_cloud_alloydb_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.alloydb = (function() { + + /** + * Namespace alloydb. + * @memberof google.cloud + * @namespace + */ + var alloydb = {}; + + alloydb.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1 = {}; + + v1.CloudSQLBackupRunSource = (function() { + + /** + * Properties of a CloudSQLBackupRunSource. + * @memberof google.cloud.alloydb.v1 + * @interface ICloudSQLBackupRunSource + * @property {string|null} [project] CloudSQLBackupRunSource project + * @property {string|null} [instanceId] CloudSQLBackupRunSource instanceId + * @property {number|Long|null} [backupRunId] CloudSQLBackupRunSource backupRunId + */ + + /** + * Constructs a new CloudSQLBackupRunSource. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CloudSQLBackupRunSource. + * @implements ICloudSQLBackupRunSource + * @constructor + * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource=} [properties] Properties to set + */ + function CloudSQLBackupRunSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSQLBackupRunSource project. + * @member {string} project + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.project = ""; + + /** + * CloudSQLBackupRunSource instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.instanceId = ""; + + /** + * CloudSQLBackupRunSource backupRunId. + * @member {number|Long} backupRunId + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.backupRunId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CloudSQLBackupRunSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource instance + */ + CloudSQLBackupRunSource.create = function create(properties) { + return new CloudSQLBackupRunSource(properties); + }; + + /** + * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSQLBackupRunSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.backupRunId); + return writer; + }; + + /** + * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSQLBackupRunSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSQLBackupRunSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupRunId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSQLBackupRunSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSQLBackupRunSource message. + * @function verify + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSQLBackupRunSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) + return "backupRunId: integer|Long expected"; + return null; + }; + + /** + * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource + */ + CloudSQLBackupRunSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource) + return object; + var message = new $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource(); + if (object.project != null) + message.project = String(object.project); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupRunId != null) + if ($util.Long) + (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; + else if (typeof object.backupRunId === "string") + message.backupRunId = parseInt(object.backupRunId, 10); + else if (typeof object.backupRunId === "number") + message.backupRunId = object.backupRunId; + else if (typeof object.backupRunId === "object") + message.backupRunId = new $util.LongBits(object.backupRunId.low >>> 0, object.backupRunId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1.CloudSQLBackupRunSource} message CloudSQLBackupRunSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSQLBackupRunSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.instanceId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupRunId = options.longs === String ? "0" : 0; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (typeof message.backupRunId === "number") + object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; + else + object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; + return object; + }; + + /** + * Converts this CloudSQLBackupRunSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @instance + * @returns {Object.} JSON object + */ + CloudSQLBackupRunSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSQLBackupRunSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSQLBackupRunSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CloudSQLBackupRunSource"; + }; + + return CloudSQLBackupRunSource; + })(); + + v1.AlloyDBCSQLAdmin = (function() { + + /** + * Constructs a new AlloyDBCSQLAdmin service. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an AlloyDBCSQLAdmin + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AlloyDBCSQLAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBCSQLAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBCSQLAdmin; + + /** + * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AlloyDBCSQLAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBCSQLAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBCSQLAdmin|restoreFromCloudSQL}. + * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin + * @typedef RestoreFromCloudSQLCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreFromCloudSQL. + * @function restoreFromCloudSQL + * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBCSQLAdmin.prototype.restoreFromCloudSQL = function restoreFromCloudSQL(request, callback) { + return this.rpcCall(restoreFromCloudSQL, $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreFromCloudSQL" }); + + /** + * Calls RestoreFromCloudSQL. + * @function restoreFromCloudSQL + * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBCSQLAdmin; + })(); + + v1.RestoreFromCloudSQLRequest = (function() { + + /** + * Properties of a RestoreFromCloudSQLRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IRestoreFromCloudSQLRequest + * @property {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] RestoreFromCloudSQLRequest cloudsqlBackupRunSource + * @property {string|null} [parent] RestoreFromCloudSQLRequest parent + * @property {string|null} [clusterId] RestoreFromCloudSQLRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] RestoreFromCloudSQLRequest cluster + */ + + /** + * Constructs a new RestoreFromCloudSQLRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a RestoreFromCloudSQLRequest. + * @implements IRestoreFromCloudSQLRequest + * @constructor + * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest=} [properties] Properties to set + */ + function RestoreFromCloudSQLRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreFromCloudSQLRequest cloudsqlBackupRunSource. + * @member {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.cloudsqlBackupRunSource = null; + + /** + * RestoreFromCloudSQLRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.parent = ""; + + /** + * RestoreFromCloudSQLRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.clusterId = ""; + + /** + * RestoreFromCloudSQLRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.cluster = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreFromCloudSQLRequest source. + * @member {"cloudsqlBackupRunSource"|undefined} source + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @instance + */ + Object.defineProperty(RestoreFromCloudSQLRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["cloudsqlBackupRunSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest instance + */ + RestoreFromCloudSQLRequest.create = function create(properties) { + return new RestoreFromCloudSQLRequest(properties); + }; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreFromCloudSQLRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) + $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreFromCloudSQLRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreFromCloudSQLRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 101: { + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreFromCloudSQLRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreFromCloudSQLRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreFromCloudSQLRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); + if (error) + return "cloudsqlBackupRunSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + return null; + }; + + /** + * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + */ + RestoreFromCloudSQLRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest(); + if (object.cloudsqlBackupRunSource != null) { + if (typeof object.cloudsqlBackupRunSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.cloudsqlBackupRunSource: object expected"); + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); + } + return message; + }; + + /** + * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreFromCloudSQLRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); + if (options.oneofs) + object.source = "cloudsqlBackupRunSource"; + } + return object; + }; + + /** + * Converts this RestoreFromCloudSQLRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreFromCloudSQLRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreFromCloudSQLRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreFromCloudSQLRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreFromCloudSQLRequest"; + }; + + return RestoreFromCloudSQLRequest; + })(); + + /** + * InstanceView enum. + * @name google.cloud.alloydb.v1.InstanceView + * @enum {number} + * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value + * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value + * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value + */ + v1.InstanceView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; + values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; + return values; + })(); + + /** + * ClusterView enum. + * @name google.cloud.alloydb.v1.ClusterView + * @enum {number} + * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value + * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value + * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value + */ + v1.ClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; + values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; + return values; + })(); + + /** + * DatabaseVersion enum. + * @name google.cloud.alloydb.v1.DatabaseVersion + * @enum {number} + * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value + * @property {number} POSTGRES_13=1 POSTGRES_13 value + * @property {number} POSTGRES_14=2 POSTGRES_14 value + * @property {number} POSTGRES_15=3 POSTGRES_15 value + * @property {number} POSTGRES_16=4 POSTGRES_16 value + * @property {number} POSTGRES_17=5 POSTGRES_17 value + */ + v1.DatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSTGRES_13"] = 1; + values[valuesById[2] = "POSTGRES_14"] = 2; + values[valuesById[3] = "POSTGRES_15"] = 3; + values[valuesById[4] = "POSTGRES_16"] = 4; + values[valuesById[5] = "POSTGRES_17"] = 5; + return values; + })(); + + /** + * SubscriptionType enum. + * @name google.cloud.alloydb.v1.SubscriptionType + * @enum {number} + * @property {number} SUBSCRIPTION_TYPE_UNSPECIFIED=0 SUBSCRIPTION_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} TRIAL=2 TRIAL value + */ + v1.SubscriptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUBSCRIPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "TRIAL"] = 2; + return values; + })(); + + v1.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.alloydb.v1 + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set + */ + function UserPassword(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserPassword user. + * @member {string} user + * @memberof google.cloud.alloydb.v1.UserPassword + * @instance + */ + UserPassword.prototype.user = ""; + + /** + * UserPassword password. + * @member {string} password + * @memberof google.cloud.alloydb.v1.UserPassword + * @instance + */ + UserPassword.prototype.password = ""; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {google.cloud.alloydb.v1.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {google.cloud.alloydb.v1.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UserPassword) + return object; + var message = new $root.google.cloud.alloydb.v1.UserPassword(); + if (object.user != null) + message.user = String(object.user); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {google.cloud.alloydb.v1.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = ""; + object.password = ""; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UserPassword"; + }; + + return UserPassword; + })(); + + v1.MigrationSource = (function() { + + /** + * Properties of a MigrationSource. + * @memberof google.cloud.alloydb.v1 + * @interface IMigrationSource + * @property {string|null} [hostPort] MigrationSource hostPort + * @property {string|null} [referenceId] MigrationSource referenceId + * @property {google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType + */ + + /** + * Constructs a new MigrationSource. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a MigrationSource. + * @implements IMigrationSource + * @constructor + * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set + */ + function MigrationSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationSource hostPort. + * @member {string} hostPort + * @memberof google.cloud.alloydb.v1.MigrationSource + * @instance + */ + MigrationSource.prototype.hostPort = ""; + + /** + * MigrationSource referenceId. + * @member {string} referenceId + * @memberof google.cloud.alloydb.v1.MigrationSource + * @instance + */ + MigrationSource.prototype.referenceId = ""; + + /** + * MigrationSource sourceType. + * @member {google.cloud.alloydb.v1.MigrationSource.MigrationSourceType} sourceType + * @memberof google.cloud.alloydb.v1.MigrationSource + * @instance + */ + MigrationSource.prototype.sourceType = 0; + + /** + * Creates a new MigrationSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource instance + */ + MigrationSource.create = function create(properties) { + return new MigrationSource(properties); + }; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {google.cloud.alloydb.v1.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); + if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); + return writer; + }; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {google.cloud.alloydb.v1.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MigrationSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hostPort = reader.string(); + break; + } + case 2: { + message.referenceId = reader.string(); + break; + } + case 3: { + message.sourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationSource message. + * @function verify + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (!$util.isString(message.hostPort)) + return "hostPort: string expected"; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + if (!$util.isString(message.referenceId)) + return "referenceId: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource + */ + MigrationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MigrationSource) + return object; + var message = new $root.google.cloud.alloydb.v1.MigrationSource(); + if (object.hostPort != null) + message.hostPort = String(object.hostPort); + if (object.referenceId != null) + message.referenceId = String(object.referenceId); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "DMS": + case 1: + message.sourceType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {google.cloud.alloydb.v1.MigrationSource} message MigrationSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostPort = ""; + object.referenceId = ""; + object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + object.hostPort = message.hostPort; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + object.referenceId = message.referenceId; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; + return object; + }; + + /** + * Converts this MigrationSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.MigrationSource + * @instance + * @returns {Object.} JSON object + */ + MigrationSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.MigrationSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.MigrationSource"; + }; + + /** + * MigrationSourceType enum. + * @name google.cloud.alloydb.v1.MigrationSource.MigrationSourceType + * @enum {number} + * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value + * @property {number} DMS=1 DMS value + */ + MigrationSource.MigrationSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DMS"] = 1; + return values; + })(); + + return MigrationSource; + })(); + + v1.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.alloydb.v1 + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.alloydb.v1.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.EncryptionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.cloud.alloydb.v1 + * @interface IEncryptionInfo + * @property {google.cloud.alloydb.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.cloud.alloydb.v1.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + this.kmsKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.cloud.alloydb.v1.EncryptionInfo.Type} encryptionType + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo kmsKeyVersions. + * @member {Array.} kmsKeyVersions + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1.IEncryptionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) + message.kmsKeyVersions = []; + message.kmsKeyVersions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { + if (!Array.isArray(message.kmsKeyVersions)) + return "kmsKeyVersions: array expected"; + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + if (!$util.isString(message.kmsKeyVersions[i])) + return "kmsKeyVersions: string[] expected"; + } + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.EncryptionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.kmsKeyVersions) { + if (!Array.isArray(object.kmsKeyVersions)) + throw TypeError(".google.cloud.alloydb.v1.EncryptionInfo.kmsKeyVersions: array expected"); + message.kmsKeyVersions = []; + for (var i = 0; i < object.kmsKeyVersions.length; ++i) + message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyVersions = []; + if (options.defaults) + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.kmsKeyVersions && message.kmsKeyVersions.length) { + object.kmsKeyVersions = []; + for (var j = 0; j < message.kmsKeyVersions.length; ++j) + object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + } + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.EncryptionInfo"; + }; + + /** + * Type enum. + * @name google.cloud.alloydb.v1.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + v1.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.alloydb.v1 + * @interface ISslConfig + * @property {google.cloud.alloydb.v1.SslConfig.SslMode|null} [sslMode] SslConfig sslMode + * @property {google.cloud.alloydb.v1.SslConfig.CaSource|null} [caSource] SslConfig caSource + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.alloydb.v1.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig sslMode. + * @member {google.cloud.alloydb.v1.SslConfig.SslMode} sslMode + * @memberof google.cloud.alloydb.v1.SslConfig + * @instance + */ + SslConfig.prototype.sslMode = 0; + + /** + * SslConfig caSource. + * @member {google.cloud.alloydb.v1.SslConfig.CaSource} caSource + * @memberof google.cloud.alloydb.v1.SslConfig + * @instance + */ + SslConfig.prototype.caSource = 0; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {google.cloud.alloydb.v1.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {google.cloud.alloydb.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); + if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {google.cloud.alloydb.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sslMode = reader.int32(); + break; + } + case 2: { + message.caSource = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + switch (message.sslMode) { + default: + return "sslMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.caSource != null && message.hasOwnProperty("caSource")) + switch (message.caSource) { + default: + return "caSource: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SslConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.SslConfig(); + switch (object.sslMode) { + default: + if (typeof object.sslMode === "number") { + message.sslMode = object.sslMode; + break; + } + break; + case "SSL_MODE_UNSPECIFIED": + case 0: + message.sslMode = 0; + break; + case "SSL_MODE_ALLOW": + case 1: + message.sslMode = 1; + break; + case "SSL_MODE_REQUIRE": + case 2: + message.sslMode = 2; + break; + case "SSL_MODE_VERIFY_CA": + case 3: + message.sslMode = 3; + break; + case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": + case 4: + message.sslMode = 4; + break; + case "ENCRYPTED_ONLY": + case 5: + message.sslMode = 5; + break; + } + switch (object.caSource) { + default: + if (typeof object.caSource === "number") { + message.caSource = object.caSource; + break; + } + break; + case "CA_SOURCE_UNSPECIFIED": + case 0: + message.caSource = 0; + break; + case "CA_SOURCE_MANAGED": + case 1: + message.caSource = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {google.cloud.alloydb.v1.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; + object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; + } + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1.SslConfig.SslMode[message.sslMode] : message.sslMode; + if (message.caSource != null && message.hasOwnProperty("caSource")) + object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1.SslConfig.CaSource[message.caSource] : message.caSource; + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SslConfig"; + }; + + /** + * SslMode enum. + * @name google.cloud.alloydb.v1.SslConfig.SslMode + * @enum {number} + * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value + * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value + * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value + * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value + * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value + * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value + */ + SslConfig.SslMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; + values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; + values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; + values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; + values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; + return values; + })(); + + /** + * CaSource enum. + * @name google.cloud.alloydb.v1.SslConfig.CaSource + * @enum {number} + * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value + * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value + */ + SslConfig.CaSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; + return values; + })(); + + return SslConfig; + })(); + + v1.AutomatedBackupPolicy = (function() { + + /** + * Properties of an AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1 + * @interface IAutomatedBackupPolicy + * @property {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule + * @property {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention + * @property {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention + * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled + * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig + * @property {string|null} [location] AutomatedBackupPolicy location + * @property {Object.|null} [labels] AutomatedBackupPolicy labels + */ + + /** + * Constructs a new AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy + * @constructor + * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy=} [properties] Properties to set + */ + function AutomatedBackupPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedBackupPolicy weeklySchedule. + * @member {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.weeklySchedule = null; + + /** + * AutomatedBackupPolicy timeBasedRetention. + * @member {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.timeBasedRetention = null; + + /** + * AutomatedBackupPolicy quantityBasedRetention. + * @member {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.quantityBasedRetention = null; + + /** + * AutomatedBackupPolicy enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.enabled = null; + + /** + * AutomatedBackupPolicy backupWindow. + * @member {google.protobuf.IDuration|null|undefined} backupWindow + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.backupWindow = null; + + /** + * AutomatedBackupPolicy encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.encryptionConfig = null; + + /** + * AutomatedBackupPolicy location. + * @member {string} location + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.location = ""; + + /** + * AutomatedBackupPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutomatedBackupPolicy schedule. + * @member {"weeklySchedule"|undefined} schedule + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { + get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy retention. + * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { + get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) + $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) + $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) + $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.weeklySchedule = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timeBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); + break; + } + case 5: { + message.quantityBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); + break; + } + case 1: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedBackupPolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedBackupPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + properties.schedule = 1; + { + var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); + if (error) + return "weeklySchedule." + error; + } + } + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); + if (error) + return "timeBasedRetention." + error; + } + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + if (properties.retention === 1) + return "retention: multiple values"; + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); + if (error) + return "quantityBasedRetention." + error; + } + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.protobuf.Duration.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy + */ + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy) + return object; + var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy(); + if (object.weeklySchedule != null) { + if (typeof object.weeklySchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.weeklySchedule: object expected"); + message.weeklySchedule = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); + } + if (object.timeBasedRetention != null) { + if (typeof object.timeBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.timeBasedRetention: object expected"); + message.timeBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); + } + if (object.quantityBasedRetention != null) { + if (typeof object.quantityBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.quantityBasedRetention: object expected"); + message.quantityBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.backupWindow: object expected"); + message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedBackupPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.backupWindow = null; + object.location = ""; + object.encryptionConfig = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + object.weeklySchedule = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); + if (options.oneofs) + object.schedule = "weeklySchedule"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + object.timeBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); + if (options.oneofs) + object.retention = "timeBasedRetention"; + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + object.quantityBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); + if (options.oneofs) + object.retention = "quantityBasedRetention"; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + * @returns {Object.} JSON object + */ + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy"; + }; + + AutomatedBackupPolicy.WeeklySchedule = (function() { + + /** + * Properties of a WeeklySchedule. + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @interface IWeeklySchedule + * @property {Array.|null} [startTimes] WeeklySchedule startTimes + * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek + */ + + /** + * Constructs a new WeeklySchedule. + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @classdesc Represents a WeeklySchedule. + * @implements IWeeklySchedule + * @constructor + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + */ + function WeeklySchedule(properties) { + this.startTimes = []; + this.daysOfWeek = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklySchedule startTimes. + * @member {Array.} startTimes + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.startTimes = $util.emptyArray; + + /** + * WeeklySchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance + */ + WeeklySchedule.create = function create(properties) { + return new WeeklySchedule(properties); + }; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimes != null && message.startTimes.length) + for (var i = 0; i < message.startTimes.length; ++i) + $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.startTimes && message.startTimes.length)) + message.startTimes = []; + message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklySchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimes != null && message.hasOwnProperty("startTimes")) { + if (!Array.isArray(message.startTimes)) + return "startTimes: array expected"; + for (var i = 0; i < message.startTimes.length; ++i) { + var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); + if (error) + return "startTimes." + error; + } + } + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + */ + WeeklySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + return object; + var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule(); + if (object.startTimes) { + if (!Array.isArray(object.startTimes)) + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); + message.startTimes = []; + for (var i = 0; i < object.startTimes.length; ++i) { + if (typeof object.startTimes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); + message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); + } + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startTimes = []; + object.daysOfWeek = []; + } + if (message.startTimes && message.startTimes.length) { + object.startTimes = []; + for (var j = 0; j < message.startTimes.length; ++j) + object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); + } + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + return object; + }; + + /** + * Converts this WeeklySchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @instance + * @returns {Object.} JSON object + */ + WeeklySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeeklySchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule"; + }; + + return WeeklySchedule; + })(); + + AutomatedBackupPolicy.TimeBasedRetention = (function() { + + /** + * Properties of a TimeBasedRetention. + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @interface ITimeBasedRetention + * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod + */ + + /** + * Constructs a new TimeBasedRetention. + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @classdesc Represents a TimeBasedRetention. + * @implements ITimeBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + */ + function TimeBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeBasedRetention retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @instance + */ + TimeBasedRetention.prototype.retentionPeriod = null; + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance + */ + TimeBasedRetention.create = function create(properties) { + return new TimeBasedRetention(properties); + }; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + */ + TimeBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this TimeBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @instance + * @returns {Object.} JSON object + */ + TimeBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention"; + }; + + return TimeBasedRetention; + })(); + + AutomatedBackupPolicy.QuantityBasedRetention = (function() { + + /** + * Properties of a QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @interface IQuantityBasedRetention + * @property {number|null} [count] QuantityBasedRetention count + */ + + /** + * Constructs a new QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @classdesc Represents a QuantityBasedRetention. + * @implements IQuantityBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + */ + function QuantityBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedRetention count. + * @member {number} count + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + */ + QuantityBasedRetention.prototype.count = 0; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance + */ + QuantityBasedRetention.create = function create(properties) { + return new QuantityBasedRetention(properties); + }; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); + return writer; + }; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + */ + QuantityBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention(); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.count = 0; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention"; + }; + + return QuantityBasedRetention; + })(); + + return AutomatedBackupPolicy; + })(); + + v1.ContinuousBackupConfig = (function() { + + /** + * Properties of a ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1 + * @interface IContinuousBackupConfig + * @property {boolean|null} [enabled] ContinuousBackupConfig enabled + * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + */ + + /** + * Constructs a new ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ContinuousBackupConfig. + * @implements IContinuousBackupConfig + * @constructor + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set + */ + function ContinuousBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.enabled = null; + + /** + * ContinuousBackupConfig recoveryWindowDays. + * @member {number} recoveryWindowDays + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + + /** + * ContinuousBackupConfig encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig instance + */ + ContinuousBackupConfig.create = function create(properties) { + return new ContinuousBackupConfig(properties); + }; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 4: { + message.recoveryWindowDays = reader.int32(); + break; + } + case 3: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + if (!$util.isInteger(message.recoveryWindowDays)) + return "recoveryWindowDays: integer expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig + */ + ContinuousBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.ContinuousBackupConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.recoveryWindowDays != null) + message.recoveryWindowDays = object.recoveryWindowDays | 0; + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encryptionConfig = null; + object.recoveryWindowDays = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + object.recoveryWindowDays = message.recoveryWindowDays; + return object; + }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupConfig"; + }; + + return ContinuousBackupConfig; + })(); + + v1.ContinuousBackupInfo = (function() { + + /** + * Properties of a ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1 + * @interface IContinuousBackupInfo + * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo + * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime + * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime + */ + + /** + * Constructs a new ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ContinuousBackupInfo. + * @implements IContinuousBackupInfo + * @constructor + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set + */ + function ContinuousBackupInfo(properties) { + this.schedule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupInfo encryptionInfo. + * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.encryptionInfo = null; + + /** + * ContinuousBackupInfo enabledTime. + * @member {google.protobuf.ITimestamp|null|undefined} enabledTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.enabledTime = null; + + /** + * ContinuousBackupInfo schedule. + * @member {Array.} schedule + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.schedule = $util.emptyArray; + + /** + * ContinuousBackupInfo earliestRestorableTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.earliestRestorableTime = null; + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo instance + */ + ContinuousBackupInfo.create = function create(properties) { + return new ContinuousBackupInfo(properties); + }; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) + $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schedule != null && message.schedule.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.schedule.length; ++i) + writer.int32(message.schedule[i]); + writer.ldelim(); + } + if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) + $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.schedule && message.schedule.length)) + message.schedule = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.schedule.push(reader.int32()); + } else + message.schedule.push(reader.int32()); + break; + } + case 4: { + message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); + if (error) + return "enabledTime." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + if (!Array.isArray(message.schedule)) + return "schedule: array expected"; + for (var i = 0; i < message.schedule.length; ++i) + switch (message.schedule[i]) { + default: + return "schedule: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); + if (error) + return "earliestRestorableTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + */ + ContinuousBackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupInfo) + return object; + var message = new $root.google.cloud.alloydb.v1.ContinuousBackupInfo(); + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.enabledTime != null) { + if (typeof object.enabledTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.enabledTime: object expected"); + message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); + } + if (object.schedule) { + if (!Array.isArray(object.schedule)) + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.schedule: array expected"); + message.schedule = []; + for (var i = 0; i < object.schedule.length; ++i) + switch (object.schedule[i]) { + default: + if (typeof object.schedule[i] === "number") { + message.schedule[i] = object.schedule[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.schedule[i] = 0; + break; + case "MONDAY": + case 1: + message.schedule[i] = 1; + break; + case "TUESDAY": + case 2: + message.schedule[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.schedule[i] = 3; + break; + case "THURSDAY": + case 4: + message.schedule[i] = 4; + break; + case "FRIDAY": + case 5: + message.schedule[i] = 5; + break; + case "SATURDAY": + case 6: + message.schedule[i] = 6; + break; + case "SUNDAY": + case 7: + message.schedule[i] = 7; + break; + } + } + if (object.earliestRestorableTime != null) { + if (typeof object.earliestRestorableTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.earliestRestorableTime: object expected"); + message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schedule = []; + if (options.defaults) { + object.encryptionInfo = null; + object.enabledTime = null; + object.earliestRestorableTime = null; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) + object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); + if (message.schedule && message.schedule.length) { + object.schedule = []; + for (var j = 0; j < message.schedule.length; ++j) + object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) + object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupInfo"; + }; + + return ContinuousBackupInfo; + })(); + + v1.BackupSource = (function() { + + /** + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1 + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName + */ + + /** + * Constructs a new BackupSource. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a BackupSource. + * @implements IBackupSource + * @constructor + * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set + */ + function BackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1.BackupSource + * @instance + */ + BackupSource.prototype.backupUid = ""; + + /** + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1.BackupSource + * @instance + */ + BackupSource.prototype.backupName = ""; + + /** + * Creates a new BackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource instance + */ + BackupSource.create = function create(properties) { + return new BackupSource(properties); + }; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); + if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + return writer; + }; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.backupUid = reader.string(); + break; + } + case 1: { + message.backupName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + if (!$util.isString(message.backupUid)) + return "backupUid: string expected"; + if (message.backupName != null && message.hasOwnProperty("backupName")) + if (!$util.isString(message.backupName)) + return "backupName: string expected"; + return null; + }; + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource + */ + BackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1.BackupSource(); + if (object.backupUid != null) + message.backupUid = String(object.backupUid); + if (object.backupName != null) + message.backupName = String(object.backupName); + return message; + }; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {google.cloud.alloydb.v1.BackupSource} message BackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupName = ""; + object.backupUid = ""; + } + if (message.backupName != null && message.hasOwnProperty("backupName")) + object.backupName = message.backupName; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + object.backupUid = message.backupUid; + return object; + }; + + /** + * Converts this BackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BackupSource + * @instance + * @returns {Object.} JSON object + */ + BackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.BackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.BackupSource"; + }; + + return BackupSource; + })(); + + v1.ContinuousBackupSource = (function() { + + /** + * Properties of a ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1 + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + */ + + /** + * Constructs a new ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource + * @constructor + * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set + */ + function ContinuousBackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.cluster = ""; + + /** + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.pointInTime = null; + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource instance + */ + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); + }; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); + if (error) + return "pointInTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + */ + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1.ContinuousBackupSource(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.pointInTime != null) { + if (typeof object.pointInTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupSource.pointInTime: object expected"); + message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1.ContinuousBackupSource} message ContinuousBackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.pointInTime = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupSource"; + }; + + return ContinuousBackupSource; + })(); + + v1.MaintenanceUpdatePolicy = (function() { + + /** + * Properties of a MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1 + * @interface IMaintenanceUpdatePolicy + * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows + * @property {Array.|null} [denyMaintenancePeriods] MaintenanceUpdatePolicy denyMaintenancePeriods + */ + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a MaintenanceUpdatePolicy. + * @implements IMaintenanceUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy=} [properties] Properties to set + */ + function MaintenanceUpdatePolicy(properties) { + this.maintenanceWindows = []; + this.denyMaintenancePeriods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceUpdatePolicy maintenanceWindows. + * @member {Array.} maintenanceWindows + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; + + /** + * MaintenanceUpdatePolicy denyMaintenancePeriods. + * @member {Array.} denyMaintenancePeriods + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.denyMaintenancePeriods = $util.emptyArray; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance + */ + MaintenanceUpdatePolicy.create = function create(properties) { + return new MaintenanceUpdatePolicy(properties); + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maintenanceWindows != null && message.maintenanceWindows.length) + for (var i = 0; i < message.maintenanceWindows.length; ++i) + $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) + for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) + $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.maintenanceWindows && message.maintenanceWindows.length)) + message.maintenanceWindows = []; + message.maintenanceWindows.push($root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.denyMaintenancePeriods && message.denyMaintenancePeriods.length)) + message.denyMaintenancePeriods = []; + message.denyMaintenancePeriods.push($root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceUpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { + if (!Array.isArray(message.maintenanceWindows)) + return "maintenanceWindows: array expected"; + for (var i = 0; i < message.maintenanceWindows.length; ++i) { + var error = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); + if (error) + return "maintenanceWindows." + error; + } + } + if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { + if (!Array.isArray(message.denyMaintenancePeriods)) + return "denyMaintenancePeriods: array expected"; + for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { + var error = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify(message.denyMaintenancePeriods[i]); + if (error) + return "denyMaintenancePeriods." + error; + } + } + return null; + }; + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + */ + MaintenanceUpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy(); + if (object.maintenanceWindows) { + if (!Array.isArray(object.maintenanceWindows)) + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); + message.maintenanceWindows = []; + for (var i = 0; i < object.maintenanceWindows.length; ++i) { + if (typeof object.maintenanceWindows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); + message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); + } + } + if (object.denyMaintenancePeriods) { + if (!Array.isArray(object.denyMaintenancePeriods)) + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.denyMaintenancePeriods: array expected"); + message.denyMaintenancePeriods = []; + for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { + if (typeof object.denyMaintenancePeriods[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.denyMaintenancePeriods: object expected"); + message.denyMaintenancePeriods[i] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceUpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.maintenanceWindows = []; + object.denyMaintenancePeriods = []; + } + if (message.maintenanceWindows && message.maintenanceWindows.length) { + object.maintenanceWindows = []; + for (var j = 0; j < message.maintenanceWindows.length; ++j) + object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); + } + if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { + object.denyMaintenancePeriods = []; + for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) + object.denyMaintenancePeriods[j] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); + } + return object; + }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy"; + }; + + MaintenanceUpdatePolicy.MaintenanceWindow = (function() { + + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @interface IMaintenanceWindow + * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day + * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime + */ + + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.day = 0; + + /** + * MaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.day = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.day != null && message.hasOwnProperty("day")) + switch (message.day) { + default: + return "day: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow) + return object; + var message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.day = 0; + break; + case "MONDAY": + case 1: + message.day = 1; + break; + case "TUESDAY": + case 2: + message.day = 2; + break; + case "WEDNESDAY": + case 3: + message.day = 3; + break; + case "THURSDAY": + case 4: + message.day = 4; + break; + case "FRIDAY": + case 5: + message.day = 5; + break; + case "SATURDAY": + case 6: + message.day = 6; + break; + case "SUNDAY": + case 7: + message.day = 7; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.day != null && message.hasOwnProperty("day")) + object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + MaintenanceUpdatePolicy.DenyMaintenancePeriod = (function() { + + /** + * Properties of a DenyMaintenancePeriod. + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @interface IDenyMaintenancePeriod + * @property {google.type.IDate|null} [startDate] DenyMaintenancePeriod startDate + * @property {google.type.IDate|null} [endDate] DenyMaintenancePeriod endDate + * @property {google.type.ITimeOfDay|null} [time] DenyMaintenancePeriod time + */ + + /** + * Constructs a new DenyMaintenancePeriod. + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy + * @classdesc Represents a DenyMaintenancePeriod. + * @implements IDenyMaintenancePeriod + * @constructor + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set + */ + function DenyMaintenancePeriod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenyMaintenancePeriod startDate. + * @member {google.type.IDate|null|undefined} startDate + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.startDate = null; + + /** + * DenyMaintenancePeriod endDate. + * @member {google.type.IDate|null|undefined} endDate + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.endDate = null; + + /** + * DenyMaintenancePeriod time. + * @member {google.type.ITimeOfDay|null|undefined} time + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.time = null; + + /** + * Creates a new DenyMaintenancePeriod instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod instance + */ + DenyMaintenancePeriod.create = function create(properties) { + return new DenyMaintenancePeriod(properties); + }; + + /** + * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenyMaintenancePeriod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) + $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) + $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenyMaintenancePeriod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 3: { + message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenyMaintenancePeriod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenyMaintenancePeriod message. + * @function verify + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenyMaintenancePeriod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startDate != null && message.hasOwnProperty("startDate")) { + var error = $root.google.type.Date.verify(message.startDate); + if (error) + return "startDate." + error; + } + if (message.endDate != null && message.hasOwnProperty("endDate")) { + var error = $root.google.type.Date.verify(message.endDate); + if (error) + return "endDate." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.type.TimeOfDay.verify(message.time); + if (error) + return "time." + error; + } + return null; + }; + + /** + * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + */ + DenyMaintenancePeriod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod) + return object; + var message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); + if (object.startDate != null) { + if (typeof object.startDate !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.startDate: object expected"); + message.startDate = $root.google.type.Date.fromObject(object.startDate); + } + if (object.endDate != null) { + if (typeof object.endDate !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.endDate: object expected"); + message.endDate = $root.google.type.Date.fromObject(object.endDate); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.time: object expected"); + message.time = $root.google.type.TimeOfDay.fromObject(object.time); + } + return message; + }; + + /** + * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} message DenyMaintenancePeriod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenyMaintenancePeriod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = null; + object.endDate = null; + object.time = null; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = $root.google.type.Date.toObject(message.startDate, options); + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = $root.google.type.Date.toObject(message.endDate, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.type.TimeOfDay.toObject(message.time, options); + return object; + }; + + /** + * Converts this DenyMaintenancePeriod to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + * @returns {Object.} JSON object + */ + DenyMaintenancePeriod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DenyMaintenancePeriod + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DenyMaintenancePeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod"; + }; + + return DenyMaintenancePeriod; + })(); + + return MaintenanceUpdatePolicy; + })(); + + v1.MaintenanceSchedule = (function() { + + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1 + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + */ + + /** + * Constructs a new MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.alloydb.v1.IMaintenanceSchedule=} [properties] Properties to set + */ + function MaintenanceSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.MaintenanceSchedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1.MaintenanceSchedule} message MaintenanceSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTime = null; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceSchedule"; + }; + + return MaintenanceSchedule; + })(); + + v1.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.alloydb.v1 + * @interface ICluster + * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] Cluster backupSource + * @property {google.cloud.alloydb.v1.IMigrationSource|null} [migrationSource] Cluster migrationSource + * @property {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] Cluster cloudsqlBackupRunSource + * @property {string|null} [name] Cluster name + * @property {string|null} [displayName] Cluster displayName + * @property {string|null} [uid] Cluster uid + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.alloydb.v1.Cluster.State|null} [state] Cluster state + * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] Cluster clusterType + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig + * @property {string|null} [network] Cluster network + * @property {string|null} [etag] Cluster etag + * @property {Object.|null} [annotations] Cluster annotations + * @property {boolean|null} [reconciling] Cluster reconciling + * @property {google.cloud.alloydb.v1.IUserPassword|null} [initialUser] Cluster initialUser + * @property {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy + * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] Cluster sslConfig + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo + * @property {google.cloud.alloydb.v1.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig + * @property {google.cloud.alloydb.v1.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo + * @property {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig + * @property {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs + * @property {google.cloud.alloydb.v1.Cluster.IPscConfig|null} [pscConfig] Cluster pscConfig + * @property {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy + * @property {google.cloud.alloydb.v1.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule + * @property {google.cloud.alloydb.v1.SubscriptionType|null} [subscriptionType] Cluster subscriptionType + * @property {google.cloud.alloydb.v1.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata + * @property {Object.|null} [tags] Cluster tags + * @property {google.cloud.alloydb.v1.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.labels = {}; + this.annotations = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster backupSource. + * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.backupSource = null; + + /** + * Cluster migrationSource. + * @member {google.cloud.alloydb.v1.IMigrationSource|null|undefined} migrationSource + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.migrationSource = null; + + /** + * Cluster cloudsqlBackupRunSource. + * @member {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.cloudsqlBackupRunSource = null; + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.displayName = ""; + + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.uid = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.deleteTime = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster state. + * @member {google.cloud.alloydb.v1.Cluster.State} state + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster clusterType. + * @member {google.cloud.alloydb.v1.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.clusterType = 0; + + /** + * Cluster databaseVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.databaseVersion = 0; + + /** + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.networkConfig = null; + + /** + * Cluster network. + * @member {string} network + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.network = ""; + + /** + * Cluster etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.etag = ""; + + /** + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.annotations = $util.emptyObject; + + /** + * Cluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.reconciling = false; + + /** + * Cluster initialUser. + * @member {google.cloud.alloydb.v1.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.initialUser = null; + + /** + * Cluster automatedBackupPolicy. + * @member {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.automatedBackupPolicy = null; + + /** + * Cluster sslConfig. + * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.sslConfig = null; + + /** + * Cluster encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; + + /** + * Cluster encryptionInfo. + * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.encryptionInfo = null; + + /** + * Cluster continuousBackupConfig. + * @member {google.cloud.alloydb.v1.IContinuousBackupConfig|null|undefined} continuousBackupConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.continuousBackupConfig = null; + + /** + * Cluster continuousBackupInfo. + * @member {google.cloud.alloydb.v1.IContinuousBackupInfo|null|undefined} continuousBackupInfo + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.continuousBackupInfo = null; + + /** + * Cluster secondaryConfig. + * @member {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null|undefined} secondaryConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.secondaryConfig = null; + + /** + * Cluster primaryConfig. + * @member {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null|undefined} primaryConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.primaryConfig = null; + + /** + * Cluster satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.satisfiesPzs = false; + + /** + * Cluster pscConfig. + * @member {google.cloud.alloydb.v1.Cluster.IPscConfig|null|undefined} pscConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.pscConfig = null; + + /** + * Cluster maintenanceUpdatePolicy. + * @member {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.maintenanceUpdatePolicy = null; + + /** + * Cluster maintenanceSchedule. + * @member {google.cloud.alloydb.v1.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.maintenanceSchedule = null; + + /** + * Cluster subscriptionType. + * @member {google.cloud.alloydb.v1.SubscriptionType} subscriptionType + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.subscriptionType = 0; + + /** + * Cluster trialMetadata. + * @member {google.cloud.alloydb.v1.Cluster.ITrialMetadata|null|undefined} trialMetadata + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.trialMetadata = null; + + /** + * Cluster tags. + * @member {Object.} tags + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.tags = $util.emptyObject; + + /** + * Cluster dataplexConfig. + * @member {google.cloud.alloydb.v1.Cluster.IDataplexConfig|null|undefined} dataplexConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.dataplexConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|"cloudsqlBackupRunSource"|undefined} source + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource", "cloudsqlBackupRunSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.alloydb.v1.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) + $root.google.cloud.alloydb.v1.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) + $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) + $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) + $root.google.cloud.alloydb.v1.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) + $root.google.cloud.alloydb.v1.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) + $root.google.cloud.alloydb.v1.Cluster.PscConfig.encode(message.pscConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) + $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.alloydb.v1.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.subscriptionType != null && Object.hasOwnProperty.call(message, "subscriptionType")) + writer.uint32(/* id 38, wireType 0 =*/304).int32(message.subscriptionType); + if (message.trialMetadata != null && Object.hasOwnProperty.call(message, "trialMetadata")) + $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.encode(message.trialMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) + $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) + $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 15: { + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); + break; + } + case 16: { + message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.decode(reader, reader.uint32()); + break; + } + case 42: { + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 24: { + message.clusterType = reader.int32(); + break; + } + case 9: { + message.databaseVersion = reader.int32(); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.network = reader.string(); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 13: { + message.reconciling = reader.bool(); + break; + } + case 14: { + message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.decode(reader, reader.uint32()); + break; + } + case 17: { + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 18: { + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 27: { + message.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + message.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.decode(reader, reader.uint32()); + break; + } + case 22: { + message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + break; + } + case 30: { + message.satisfiesPzs = reader.bool(); + break; + } + case 31: { + message.pscConfig = $root.google.cloud.alloydb.v1.Cluster.PscConfig.decode(reader, reader.uint32()); + break; + } + case 32: { + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); + break; + } + case 37: { + message.maintenanceSchedule = $root.google.cloud.alloydb.v1.MaintenanceSchedule.decode(reader, reader.uint32()); + break; + } + case 38: { + message.subscriptionType = reader.int32(); + break; + } + case 39: { + message.trialMetadata = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.decode(reader, reader.uint32()); + break; + } + case 41: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + case 47: { + message.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.MigrationSource.verify(message.migrationSource); + if (error) + return "migrationSource." + error; + } + } + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); + if (error) + return "cloudsqlBackupRunSource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.alloydb.v1.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { + var error = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.verify(message.continuousBackupConfig); + if (error) + return "continuousBackupConfig." + error; + } + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { + var error = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.verify(message.continuousBackupInfo); + if (error) + return "continuousBackupInfo." + error; + } + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify(message.secondaryConfig); + if (error) + return "secondaryConfig." + error; + } + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (error) + return "primaryConfig." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.PscConfig.verify(message.pscConfig); + if (error) + return "pscConfig." + error; + } + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { + var error = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); + if (error) + return "maintenanceUpdatePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.alloydb.v1.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } + if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) + switch (message.subscriptionType) { + default: + return "subscriptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) { + var error = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.verify(message.trialMetadata); + if (error) + return "trialMetadata." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.verify(message.dataplexConfig); + if (error) + return "dataplexConfig." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); + } + if (object.migrationSource != null) { + if (typeof object.migrationSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.migrationSource: object expected"); + message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.fromObject(object.migrationSource); + } + if (object.cloudsqlBackupRunSource != null) { + if (typeof object.cloudsqlBackupRunSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.cloudsqlBackupRunSource: object expected"); + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "EMPTY": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 7: + message.state = 7; + break; + case "MAINTENANCE": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.fromObject(object.networkConfig); + } + if (object.network != null) + message.network = String(object.network); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.initialUser: object expected"); + message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.fromObject(object.initialUser); + } + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.continuousBackupConfig != null) { + if (typeof object.continuousBackupConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.continuousBackupConfig: object expected"); + message.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); + } + if (object.continuousBackupInfo != null) { + if (typeof object.continuousBackupInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.continuousBackupInfo: object expected"); + message.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); + } + if (object.secondaryConfig != null) { + if (typeof object.secondaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.secondaryConfig: object expected"); + message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); + } + if (object.primaryConfig != null) { + if (typeof object.primaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.primaryConfig: object expected"); + message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.pscConfig != null) { + if (typeof object.pscConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.pscConfig: object expected"); + message.pscConfig = $root.google.cloud.alloydb.v1.Cluster.PscConfig.fromObject(object.pscConfig); + } + if (object.maintenanceUpdatePolicy != null) { + if (typeof object.maintenanceUpdatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.maintenanceUpdatePolicy: object expected"); + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.alloydb.v1.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } + switch (object.subscriptionType) { + default: + if (typeof object.subscriptionType === "number") { + message.subscriptionType = object.subscriptionType; + break; + } + break; + case "SUBSCRIPTION_TYPE_UNSPECIFIED": + case 0: + message.subscriptionType = 0; + break; + case "STANDARD": + case 1: + message.subscriptionType = 1; + break; + case "TRIAL": + case 2: + message.subscriptionType = 2; + break; + } + if (object.trialMetadata != null) { + if (typeof object.trialMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.trialMetadata: object expected"); + message.trialMetadata = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.fromObject(object.trialMetadata); + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + if (object.dataplexConfig != null) { + if (typeof object.dataplexConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.dataplexConfig: object expected"); + message.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.fromObject(object.dataplexConfig); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {google.cloud.alloydb.v1.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.network = ""; + object.etag = ""; + object.reconciling = false; + object.initialUser = null; + object.automatedBackupPolicy = null; + object.sslConfig = null; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.secondaryConfig = null; + object.primaryConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.continuousBackupConfig = null; + object.continuousBackupInfo = null; + object.networkConfig = null; + object.satisfiesPzs = false; + object.pscConfig = null; + object.maintenanceUpdatePolicy = null; + object.maintenanceSchedule = null; + object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; + object.trialMetadata = null; + object.dataplexConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Cluster.State[message.state] : message.state; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.alloydb.v1.UserPassword.toObject(message.initialUser, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + object.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.toObject(message.migrationSource, options); + if (options.oneofs) + object.source = "migrationSource"; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) + object.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) + object.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) + object.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) + object.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) + object.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.toObject(message.networkConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) + object.pscConfig = $root.google.cloud.alloydb.v1.Cluster.PscConfig.toObject(message.pscConfig, options); + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) + object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.alloydb.v1.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); + if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) + object.subscriptionType = options.enums === String ? $root.google.cloud.alloydb.v1.SubscriptionType[message.subscriptionType] === undefined ? message.subscriptionType : $root.google.cloud.alloydb.v1.SubscriptionType[message.subscriptionType] : message.subscriptionType; + if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) + object.trialMetadata = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.toObject(message.trialMetadata, options); + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); + if (options.oneofs) + object.source = "cloudsqlBackupRunSource"; + } + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) + object.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster"; + }; + + Cluster.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.NetworkConfig"; + }; + + return NetworkConfig; + })(); + + Cluster.SecondaryConfig = (function() { + + /** + * Properties of a SecondaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface ISecondaryConfig + * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName + */ + + /** + * Constructs a new SecondaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a SecondaryConfig. + * @implements ISecondaryConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set + */ + function SecondaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecondaryConfig primaryClusterName. + * @member {string} primaryClusterName + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @instance + */ + SecondaryConfig.prototype.primaryClusterName = ""; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig instance + */ + SecondaryConfig.create = function create(properties) { + return new SecondaryConfig(properties); + }; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); + return writer; + }; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.primaryClusterName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecondaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecondaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + if (!$util.isString(message.primaryClusterName)) + return "primaryClusterName: string expected"; + return null; + }; + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig + */ + SecondaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); + if (object.primaryClusterName != null) + message.primaryClusterName = String(object.primaryClusterName); + return message; + }; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.SecondaryConfig} message SecondaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecondaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.primaryClusterName = ""; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + object.primaryClusterName = message.primaryClusterName; + return object; + }; + + /** + * Converts this SecondaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @instance + * @returns {Object.} JSON object + */ + SecondaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecondaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.SecondaryConfig"; + }; + + return SecondaryConfig; + })(); + + Cluster.PrimaryConfig = (function() { + + /** + * Properties of a PrimaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface IPrimaryConfig + * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames + */ + + /** + * Constructs a new PrimaryConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a PrimaryConfig. + * @implements IPrimaryConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set + */ + function PrimaryConfig(properties) { + this.secondaryClusterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryConfig secondaryClusterNames. + * @member {Array.} secondaryClusterNames + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @instance + */ + PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig instance + */ + PrimaryConfig.create = function create(properties) { + return new PrimaryConfig(properties); + }; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); + return writer; + }; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) + message.secondaryClusterNames = []; + message.secondaryClusterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { + if (!Array.isArray(message.secondaryClusterNames)) + return "secondaryClusterNames: array expected"; + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + if (!$util.isString(message.secondaryClusterNames[i])) + return "secondaryClusterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig + */ + PrimaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); + if (object.secondaryClusterNames) { + if (!Array.isArray(object.secondaryClusterNames)) + throw TypeError(".google.cloud.alloydb.v1.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); + message.secondaryClusterNames = []; + for (var i = 0; i < object.secondaryClusterNames.length; ++i) + message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.PrimaryConfig} message PrimaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryClusterNames = []; + if (message.secondaryClusterNames && message.secondaryClusterNames.length) { + object.secondaryClusterNames = []; + for (var j = 0; j < message.secondaryClusterNames.length; ++j) + object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; + } + return object; + }; + + /** + * Converts this PrimaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @instance + * @returns {Object.} JSON object + */ + PrimaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.PrimaryConfig"; + }; + + return PrimaryConfig; + })(); + + Cluster.PscConfig = (function() { + + /** + * Properties of a PscConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface IPscConfig + * @property {boolean|null} [pscEnabled] PscConfig pscEnabled + * @property {number|Long|null} [serviceOwnedProjectNumber] PscConfig serviceOwnedProjectNumber + */ + + /** + * Constructs a new PscConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a PscConfig. + * @implements IPscConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.IPscConfig=} [properties] Properties to set + */ + function PscConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscConfig pscEnabled. + * @member {boolean} pscEnabled + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @instance + */ + PscConfig.prototype.pscEnabled = false; + + /** + * PscConfig serviceOwnedProjectNumber. + * @member {number|Long} serviceOwnedProjectNumber + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @instance + */ + PscConfig.prototype.serviceOwnedProjectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PscConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IPscConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig instance + */ + PscConfig.create = function create(properties) { + return new PscConfig(properties); + }; + + /** + * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IPscConfig} message PscConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); + if (message.serviceOwnedProjectNumber != null && Object.hasOwnProperty.call(message, "serviceOwnedProjectNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.serviceOwnedProjectNumber); + return writer; + }; + + /** + * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IPscConfig} message PscConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.PscConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pscEnabled = reader.bool(); + break; + } + case 3: { + message.serviceOwnedProjectNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (typeof message.pscEnabled !== "boolean") + return "pscEnabled: boolean expected"; + if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) + if (!$util.isInteger(message.serviceOwnedProjectNumber) && !(message.serviceOwnedProjectNumber && $util.isInteger(message.serviceOwnedProjectNumber.low) && $util.isInteger(message.serviceOwnedProjectNumber.high))) + return "serviceOwnedProjectNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig + */ + PscConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.PscConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.PscConfig(); + if (object.pscEnabled != null) + message.pscEnabled = Boolean(object.pscEnabled); + if (object.serviceOwnedProjectNumber != null) + if ($util.Long) + (message.serviceOwnedProjectNumber = $util.Long.fromValue(object.serviceOwnedProjectNumber)).unsigned = false; + else if (typeof object.serviceOwnedProjectNumber === "string") + message.serviceOwnedProjectNumber = parseInt(object.serviceOwnedProjectNumber, 10); + else if (typeof object.serviceOwnedProjectNumber === "number") + message.serviceOwnedProjectNumber = object.serviceOwnedProjectNumber; + else if (typeof object.serviceOwnedProjectNumber === "object") + message.serviceOwnedProjectNumber = new $util.LongBits(object.serviceOwnedProjectNumber.low >>> 0, object.serviceOwnedProjectNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PscConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.PscConfig} message PscConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pscEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.serviceOwnedProjectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.serviceOwnedProjectNumber = options.longs === String ? "0" : 0; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) + if (typeof message.serviceOwnedProjectNumber === "number") + object.serviceOwnedProjectNumber = options.longs === String ? String(message.serviceOwnedProjectNumber) : message.serviceOwnedProjectNumber; + else + object.serviceOwnedProjectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.serviceOwnedProjectNumber) : options.longs === Number ? new $util.LongBits(message.serviceOwnedProjectNumber.low >>> 0, message.serviceOwnedProjectNumber.high >>> 0).toNumber() : message.serviceOwnedProjectNumber; + return object; + }; + + /** + * Converts this PscConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @instance + * @returns {Object.} JSON object + */ + PscConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.PscConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.PscConfig"; + }; + + return PscConfig; + })(); + + Cluster.TrialMetadata = (function() { + + /** + * Properties of a TrialMetadata. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface ITrialMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] TrialMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TrialMetadata endTime + * @property {google.protobuf.ITimestamp|null} [upgradeTime] TrialMetadata upgradeTime + * @property {google.protobuf.ITimestamp|null} [graceEndTime] TrialMetadata graceEndTime + */ + + /** + * Constructs a new TrialMetadata. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a TrialMetadata. + * @implements ITrialMetadata + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata=} [properties] Properties to set + */ + function TrialMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.startTime = null; + + /** + * TrialMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.endTime = null; + + /** + * TrialMetadata upgradeTime. + * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.upgradeTime = null; + + /** + * TrialMetadata graceEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} graceEndTime + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.graceEndTime = null; + + /** + * Creates a new TrialMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata instance + */ + TrialMetadata.create = function create(properties) { + return new TrialMetadata(properties); + }; + + /** + * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) + $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.graceEndTime != null && Object.hasOwnProperty.call(message, "graceEndTime")) + $root.google.protobuf.Timestamp.encode(message.graceEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.TrialMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.graceEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); + if (error) + return "upgradeTime." + error; + } + if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.graceEndTime); + if (error) + return "graceEndTime." + error; + } + return null; + }; + + /** + * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata + */ + TrialMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.TrialMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.TrialMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.upgradeTime != null) { + if (typeof object.upgradeTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.upgradeTime: object expected"); + message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); + } + if (object.graceEndTime != null) { + if (typeof object.graceEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.graceEndTime: object expected"); + message.graceEndTime = $root.google.protobuf.Timestamp.fromObject(object.graceEndTime); + } + return message; + }; + + /** + * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1.Cluster.TrialMetadata} message TrialMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.upgradeTime = null; + object.graceEndTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) + object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); + if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) + object.graceEndTime = $root.google.protobuf.Timestamp.toObject(message.graceEndTime, options); + return object; + }; + + /** + * Converts this TrialMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @instance + * @returns {Object.} JSON object + */ + TrialMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.TrialMetadata"; + }; + + return TrialMetadata; + })(); + + Cluster.DataplexConfig = (function() { + + /** + * Properties of a DataplexConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface IDataplexConfig + * @property {boolean|null} [enabled] DataplexConfig enabled + */ + + /** + * Constructs a new DataplexConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a DataplexConfig. + * @implements IDataplexConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig=} [properties] Properties to set + */ + function DataplexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataplexConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @instance + */ + DataplexConfig.prototype.enabled = false; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig instance + */ + DataplexConfig.create = function create(properties) { + return new DataplexConfig(properties); + }; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.DataplexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataplexConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataplexConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig + */ + DataplexConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.DataplexConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.DataplexConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.DataplexConfig} message DataplexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataplexConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this DataplexConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @instance + * @returns {Object.} JSON object + */ + DataplexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataplexConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.DataplexConfig"; + }; + + return DataplexConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} EMPTY=3 EMPTY value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value + * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} PROMOTING=9 PROMOTING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "EMPTY"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "BOOTSTRAPPING"] = 7; + values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * ClusterType enum. + * @name google.cloud.alloydb.v1.Cluster.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} SECONDARY=2 SECONDARY value + */ + Cluster.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "SECONDARY"] = 2; + return values; + })(); + + return Cluster; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.alloydb.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [uid] Instance uid + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {Object.|null} [labels] Instance labels + * @property {google.cloud.alloydb.v1.Instance.State|null} [state] Instance state + * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {google.cloud.alloydb.v1.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig + * @property {google.cloud.alloydb.v1.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType + * @property {string|null} [gceZone] Instance gceZone + * @property {Object.|null} [databaseFlags] Instance databaseFlags + * @property {google.cloud.alloydb.v1.Instance.INode|null} [writableNode] Instance writableNode + * @property {Array.|null} [nodes] Instance nodes + * @property {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig + * @property {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null} [observabilityConfig] Instance observabilityConfig + * @property {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig + * @property {string|null} [ipAddress] Instance ipAddress + * @property {string|null} [publicIpAddress] Instance publicIpAddress + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig + * @property {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig + * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses + * @property {google.cloud.alloydb.v1.Instance.ActivationPolicy|null} [activationPolicy] Instance activationPolicy + * @property {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null} [connectionPoolConfig] Instance connectionPoolConfig + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.databaseFlags = {}; + this.nodes = []; + this.annotations = {}; + this.outboundPublicIpAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance state. + * @member {google.cloud.alloydb.v1.Instance.State} state + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance instanceType. + * @member {google.cloud.alloydb.v1.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.instanceType = 0; + + /** + * Instance machineConfig. + * @member {google.cloud.alloydb.v1.Instance.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.machineConfig = null; + + /** + * Instance availabilityType. + * @member {google.cloud.alloydb.v1.Instance.AvailabilityType} availabilityType + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.availabilityType = 0; + + /** + * Instance gceZone. + * @member {string} gceZone + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.gceZone = ""; + + /** + * Instance databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.databaseFlags = $util.emptyObject; + + /** + * Instance writableNode. + * @member {google.cloud.alloydb.v1.Instance.INode|null|undefined} writableNode + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.writableNode = null; + + /** + * Instance nodes. + * @member {Array.} nodes + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.nodes = $util.emptyArray; + + /** + * Instance queryInsightsConfig. + * @member {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.queryInsightsConfig = null; + + /** + * Instance observabilityConfig. + * @member {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null|undefined} observabilityConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.observabilityConfig = null; + + /** + * Instance readPoolConfig. + * @member {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null|undefined} readPoolConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.readPoolConfig = null; + + /** + * Instance ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.ipAddress = ""; + + /** + * Instance publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.publicIpAddress = ""; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.etag = ""; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + + /** + * Instance satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = false; + + /** + * Instance pscInstanceConfig. + * @member {google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null|undefined} pscInstanceConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.pscInstanceConfig = null; + + /** + * Instance networkConfig. + * @member {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.networkConfig = null; + + /** + * Instance outboundPublicIpAddresses. + * @member {Array.} outboundPublicIpAddresses + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; + + /** + * Instance activationPolicy. + * @member {google.cloud.alloydb.v1.Instance.ActivationPolicy} activationPolicy + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.activationPolicy = 0; + + /** + * Instance connectionPoolConfig. + * @member {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null|undefined} connectionPoolConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.connectionPoolConfig = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.alloydb.v1.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) + $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) + $root.google.cloud.alloydb.v1.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.alloydb.v1.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) + $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); + if (message.observabilityConfig != null && Object.hasOwnProperty.call(message, "observabilityConfig")) + $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.encode(message.observabilityConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.publicIpAddress); + if (message.pscInstanceConfig != null && Object.hasOwnProperty.call(message, "pscInstanceConfig")) + $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) + writer.uint32(/* id 35, wireType 0 =*/280).int32(message.activationPolicy); + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) + $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.instanceType = reader.int32(); + break; + } + case 10: { + message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.availabilityType = reader.int32(); + break; + } + case 12: { + message.gceZone = reader.string(); + break; + } + case 13: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.databaseFlags[key] = value; + break; + } + case 19: { + message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 26: { + message.observabilityConfig = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ipAddress = reader.string(); + break; + } + case 27: { + message.publicIpAddress = reader.string(); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 18: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } + case 24: { + message.satisfiesPzs = reader.bool(); + break; + } + case 28: { + message.pscInstanceConfig = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); + break; + } + case 34: { + if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) + message.outboundPublicIpAddresses = []; + message.outboundPublicIpAddresses.push(reader.string()); + break; + } + case 35: { + message.activationPolicy = reader.int32(); + break; + } + case 37: { + message.connectionPoolConfig = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.MachineConfig.verify(message.machineConfig); + if (error) + return "machineConfig." + error; + } + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (!$util.isString(message.gceZone)) + return "gceZone: string expected"; + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) { + var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.writableNode); + if (error) + return "writableNode." + error; + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (error) + return "queryInsightsConfig." + error; + } + if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify(message.observabilityConfig); + if (error) + return "observabilityConfig." + error; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (error) + return "readPoolConfig." + error; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify(message.pscInstanceConfig); + if (error) + return "pscInstanceConfig." + error; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { + if (!Array.isArray(message.outboundPublicIpAddresses)) + return "outboundPublicIpAddresses: array expected"; + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + if (!$util.isString(message.outboundPublicIpAddresses[i])) + return "outboundPublicIpAddresses: string[] expected"; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + switch (message.activationPolicy) { + default: + return "activationPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify(message.connectionPoolConfig); + if (error) + return "connectionPoolConfig." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "MAINTENANCE": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.fromObject(object.machineConfig); + } + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + if (object.gceZone != null) + message.gceZone = String(object.gceZone); + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.writableNode != null) { + if (typeof object.writableNode !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.writableNode: object expected"); + message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.writableNode); + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: object expected"); + message.nodes[i] = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.nodes[i]); + } + } + if (object.queryInsightsConfig != null) { + if (typeof object.queryInsightsConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.queryInsightsConfig: object expected"); + message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); + } + if (object.observabilityConfig != null) { + if (typeof object.observabilityConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.observabilityConfig: object expected"); + message.observabilityConfig = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.fromObject(object.observabilityConfig); + } + if (object.readPoolConfig != null) { + if (typeof object.readPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.readPoolConfig: object expected"); + message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); + } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.pscInstanceConfig != null) { + if (typeof object.pscInstanceConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.pscInstanceConfig: object expected"); + message.pscInstanceConfig = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.fromObject(object.pscInstanceConfig); + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); + } + if (object.outboundPublicIpAddresses) { + if (!Array.isArray(object.outboundPublicIpAddresses)) + throw TypeError(".google.cloud.alloydb.v1.Instance.outboundPublicIpAddresses: array expected"); + message.outboundPublicIpAddresses = []; + for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) + message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); + } + switch (object.activationPolicy) { + default: + if (typeof object.activationPolicy === "number") { + message.activationPolicy = object.activationPolicy; + break; + } + break; + case "ACTIVATION_POLICY_UNSPECIFIED": + case 0: + message.activationPolicy = 0; + break; + case "ALWAYS": + case 1: + message.activationPolicy = 1; + break; + case "NEVER": + case 2: + message.activationPolicy = 2; + break; + } + if (object.connectionPoolConfig != null) { + if (typeof object.connectionPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.connectionPoolConfig: object expected"); + message.connectionPoolConfig = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.fromObject(object.connectionPoolConfig); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {google.cloud.alloydb.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nodes = []; + object.outboundPublicIpAddresses = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.databaseFlags = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.machineConfig = null; + object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.gceZone = ""; + object.readPoolConfig = null; + object.ipAddress = ""; + object.reconciling = false; + object.etag = ""; + object.writableNode = null; + object.queryInsightsConfig = null; + object.clientConnectionConfig = null; + object.satisfiesPzs = false; + object.observabilityConfig = null; + object.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = null; + object.activationPolicy = options.enums === String ? "ACTIVATION_POLICY_UNSPECIFIED" : 0; + object.connectionPoolConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Instance.State[message.state] : message.state; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.toObject(message.machineConfig, options); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + object.gceZone = message.gceZone; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) + object.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) + object.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.writableNode, options); + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.nodes[j], options); + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) + object.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) + object.observabilityConfig = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.toObject(message.observabilityConfig, options); + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) + object.pscInstanceConfig = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); + if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { + object.outboundPublicIpAddresses = []; + for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) + object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + object.activationPolicy = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.ActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.alloydb.v1.Instance.ActivationPolicy[message.activationPolicy] : message.activationPolicy; + if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) + object.connectionPoolConfig = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance"; + }; + + Instance.MachineConfig = (function() { + + /** + * Properties of a MachineConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + * @property {string|null} [machineType] MachineConfig machineType + */ + + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; + + /** + * MachineConfig machineType. + * @member {string} machineType + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.machineType = ""; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 4: { + message.machineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + return null; + }; + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig + */ + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.MachineConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.MachineConfig} message MachineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.machineType = ""; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; + + /** + * Converts this MachineConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @instance + * @returns {Object.} JSON object + */ + MachineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.MachineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.MachineConfig"; + }; + + return MachineConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.alloydb.v1.Instance + * @interface INode + * @property {string|null} [zoneId] Node zoneId + * @property {string|null} [id] Node id + * @property {string|null} [ip] Node ip + * @property {string|null} [state] Node state + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node zoneId. + * @member {string} zoneId + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + */ + Node.prototype.zoneId = ""; + + /** + * Node id. + * @member {string} id + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + */ + Node.prototype.id = ""; + + /** + * Node ip. + * @member {string} ip + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + */ + Node.prototype.ip = ""; + + /** + * Node state. + * @member {string} state + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + */ + Node.prototype.state = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.ip = reader.string(); + break; + } + case 4: { + message.state = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.Node) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.Node(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.state != null) + message.state = String(object.state); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {google.cloud.alloydb.v1.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zoneId = ""; + object.id = ""; + object.ip = ""; + object.state = ""; + } + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.Node"; + }; + + return Node; + })(); + + Instance.QueryInsightsInstanceConfig = (function() { + + /** + * Properties of a QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IQueryInsightsInstanceConfig + * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags + * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress + * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength + * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + */ + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a QueryInsightsInstanceConfig. + * @implements IQueryInsightsInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + */ + function QueryInsightsInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInsightsInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; + + /** + * QueryInsightsInstanceConfig recordClientAddress. + * @member {boolean|null|undefined} recordClientAddress + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordClientAddress = null; + + /** + * QueryInsightsInstanceConfig queryStringLength. + * @member {number} queryStringLength + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryStringLength = 0; + + /** + * QueryInsightsInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + */ + QueryInsightsInstanceConfig.create = function create(properties) { + return new QueryInsightsInstanceConfig(properties); + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + return writer; + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.recordApplicationTags = reader.bool(); + break; + } + case 3: { + message.recordClientAddress = reader.bool(); + break; + } + case 4: { + message.queryStringLength = reader.uint32(); + break; + } + case 5: { + message.queryPlansPerMinute = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInsightsInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + properties._recordClientAddress = 1; + if (typeof message.recordClientAddress !== "boolean") + return "recordClientAddress: boolean expected"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + if (!$util.isInteger(message.queryStringLength)) + return "queryStringLength: integer expected"; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + return null; + }; + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + */ + QueryInsightsInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.recordClientAddress != null) + message.recordClientAddress = Boolean(object.recordClientAddress); + if (object.queryStringLength != null) + message.queryStringLength = object.queryStringLength >>> 0; + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + return message; + }; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryStringLength = 0; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + object.recordClientAddress = message.recordClientAddress; + if (options.oneofs) + object._recordClientAddress = "recordClientAddress"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + object.queryStringLength = message.queryStringLength; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + return object; + }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig"; + }; + + return QueryInsightsInstanceConfig; + })(); + + Instance.ObservabilityInstanceConfig = (function() { + + /** + * Properties of an ObservabilityInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IObservabilityInstanceConfig + * @property {boolean|null} [enabled] ObservabilityInstanceConfig enabled + * @property {boolean|null} [preserveComments] ObservabilityInstanceConfig preserveComments + * @property {boolean|null} [trackWaitEvents] ObservabilityInstanceConfig trackWaitEvents + * @property {boolean|null} [trackWaitEventTypes] ObservabilityInstanceConfig trackWaitEventTypes + * @property {number|null} [maxQueryStringLength] ObservabilityInstanceConfig maxQueryStringLength + * @property {boolean|null} [recordApplicationTags] ObservabilityInstanceConfig recordApplicationTags + * @property {number|null} [queryPlansPerMinute] ObservabilityInstanceConfig queryPlansPerMinute + * @property {boolean|null} [trackActiveQueries] ObservabilityInstanceConfig trackActiveQueries + */ + + /** + * Constructs a new ObservabilityInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents an ObservabilityInstanceConfig. + * @implements IObservabilityInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig=} [properties] Properties to set + */ + function ObservabilityInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObservabilityInstanceConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.enabled = null; + + /** + * ObservabilityInstanceConfig preserveComments. + * @member {boolean|null|undefined} preserveComments + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.preserveComments = null; + + /** + * ObservabilityInstanceConfig trackWaitEvents. + * @member {boolean|null|undefined} trackWaitEvents + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackWaitEvents = null; + + /** + * ObservabilityInstanceConfig trackWaitEventTypes. + * @member {boolean|null|undefined} trackWaitEventTypes + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackWaitEventTypes = null; + + /** + * ObservabilityInstanceConfig maxQueryStringLength. + * @member {number|null|undefined} maxQueryStringLength + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.maxQueryStringLength = null; + + /** + * ObservabilityInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.recordApplicationTags = null; + + /** + * ObservabilityInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.queryPlansPerMinute = null; + + /** + * ObservabilityInstanceConfig trackActiveQueries. + * @member {boolean|null|undefined} trackActiveQueries + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackActiveQueries = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_preserveComments", { + get: $util.oneOfGetter($oneOfFields = ["preserveComments"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEvents", { + get: $util.oneOfGetter($oneOfFields = ["trackWaitEvents"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEventTypes", { + get: $util.oneOfGetter($oneOfFields = ["trackWaitEventTypes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_maxQueryStringLength", { + get: $util.oneOfGetter($oneOfFields = ["maxQueryStringLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackActiveQueries", { + get: $util.oneOfGetter($oneOfFields = ["trackActiveQueries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObservabilityInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig instance + */ + ObservabilityInstanceConfig.create = function create(properties) { + return new ObservabilityInstanceConfig(properties); + }; + + /** + * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservabilityInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.preserveComments != null && Object.hasOwnProperty.call(message, "preserveComments")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.preserveComments); + if (message.trackWaitEvents != null && Object.hasOwnProperty.call(message, "trackWaitEvents")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trackWaitEvents); + if (message.trackWaitEventTypes != null && Object.hasOwnProperty.call(message, "trackWaitEventTypes")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.trackWaitEventTypes); + if (message.maxQueryStringLength != null && Object.hasOwnProperty.call(message, "maxQueryStringLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxQueryStringLength); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recordApplicationTags); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryPlansPerMinute); + if (message.trackActiveQueries != null && Object.hasOwnProperty.call(message, "trackActiveQueries")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.trackActiveQueries); + return writer; + }; + + /** + * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservabilityInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservabilityInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.preserveComments = reader.bool(); + break; + } + case 3: { + message.trackWaitEvents = reader.bool(); + break; + } + case 4: { + message.trackWaitEventTypes = reader.bool(); + break; + } + case 5: { + message.maxQueryStringLength = reader.int32(); + break; + } + case 6: { + message.recordApplicationTags = reader.bool(); + break; + } + case 7: { + message.queryPlansPerMinute = reader.int32(); + break; + } + case 8: { + message.trackActiveQueries = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservabilityInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObservabilityInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObservabilityInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { + properties._preserveComments = 1; + if (typeof message.preserveComments !== "boolean") + return "preserveComments: boolean expected"; + } + if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { + properties._trackWaitEvents = 1; + if (typeof message.trackWaitEvents !== "boolean") + return "trackWaitEvents: boolean expected"; + } + if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { + properties._trackWaitEventTypes = 1; + if (typeof message.trackWaitEventTypes !== "boolean") + return "trackWaitEventTypes: boolean expected"; + } + if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { + properties._maxQueryStringLength = 1; + if (!$util.isInteger(message.maxQueryStringLength)) + return "maxQueryStringLength: integer expected"; + } + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { + properties._trackActiveQueries = 1; + if (typeof message.trackActiveQueries !== "boolean") + return "trackActiveQueries: boolean expected"; + } + return null; + }; + + /** + * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + */ + ObservabilityInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.preserveComments != null) + message.preserveComments = Boolean(object.preserveComments); + if (object.trackWaitEvents != null) + message.trackWaitEvents = Boolean(object.trackWaitEvents); + if (object.trackWaitEventTypes != null) + message.trackWaitEventTypes = Boolean(object.trackWaitEventTypes); + if (object.maxQueryStringLength != null) + message.maxQueryStringLength = object.maxQueryStringLength | 0; + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute | 0; + if (object.trackActiveQueries != null) + message.trackActiveQueries = Boolean(object.trackActiveQueries); + return message; + }; + + /** + * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} message ObservabilityInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObservabilityInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { + object.preserveComments = message.preserveComments; + if (options.oneofs) + object._preserveComments = "preserveComments"; + } + if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { + object.trackWaitEvents = message.trackWaitEvents; + if (options.oneofs) + object._trackWaitEvents = "trackWaitEvents"; + } + if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { + object.trackWaitEventTypes = message.trackWaitEventTypes; + if (options.oneofs) + object._trackWaitEventTypes = "trackWaitEventTypes"; + } + if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { + object.maxQueryStringLength = message.maxQueryStringLength; + if (options.oneofs) + object._maxQueryStringLength = "maxQueryStringLength"; + } + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { + object.trackActiveQueries = message.trackActiveQueries; + if (options.oneofs) + object._trackActiveQueries = "trackActiveQueries"; + } + return object; + }; + + /** + * Converts this ObservabilityInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ObservabilityInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObservabilityInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObservabilityInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig"; + }; + + return ObservabilityInstanceConfig; + })(); + + Instance.ReadPoolConfig = (function() { + + /** + * Properties of a ReadPoolConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IReadPoolConfig + * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + */ + + /** + * Constructs a new ReadPoolConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a ReadPoolConfig. + * @implements IReadPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set + */ + function ReadPoolConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadPoolConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @instance + */ + ReadPoolConfig.prototype.nodeCount = 0; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig instance + */ + ReadPoolConfig.create = function create(properties) { + return new ReadPoolConfig(properties); + }; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + return null; + }; + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + */ + ReadPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ReadPoolConfig} message ReadPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeCount = 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + return object; + }; + + /** + * Converts this ReadPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ReadPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ReadPoolConfig"; + }; + + return ReadPoolConfig; + })(); + + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + + Instance.PscInterfaceConfig = (function() { + + /** + * Properties of a PscInterfaceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IPscInterfaceConfig + * @property {string|null} [networkAttachmentResource] PscInterfaceConfig networkAttachmentResource + */ + + /** + * Constructs a new PscInterfaceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a PscInterfaceConfig. + * @implements IPscInterfaceConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig=} [properties] Properties to set + */ + function PscInterfaceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscInterfaceConfig networkAttachmentResource. + * @member {string} networkAttachmentResource + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.networkAttachmentResource = ""; + + /** + * Creates a new PscInterfaceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig instance + */ + PscInterfaceConfig.create = function create(properties) { + return new PscInterfaceConfig(properties); + }; + + /** + * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInterfaceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkAttachmentResource != null && Object.hasOwnProperty.call(message, "networkAttachmentResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkAttachmentResource); + return writer; + }; + + /** + * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInterfaceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInterfaceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.networkAttachmentResource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInterfaceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscInterfaceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscInterfaceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) + if (!$util.isString(message.networkAttachmentResource)) + return "networkAttachmentResource: string expected"; + return null; + }; + + /** + * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig + */ + PscInterfaceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig(); + if (object.networkAttachmentResource != null) + message.networkAttachmentResource = String(object.networkAttachmentResource); + return message; + }; + + /** + * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} message PscInterfaceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscInterfaceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.networkAttachmentResource = ""; + if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) + object.networkAttachmentResource = message.networkAttachmentResource; + return object; + }; + + /** + * Converts this PscInterfaceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @instance + * @returns {Object.} JSON object + */ + PscInterfaceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscInterfaceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscInterfaceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscInterfaceConfig"; + }; + + return PscInterfaceConfig; + })(); + + Instance.PscAutoConnectionConfig = (function() { + + /** + * Properties of a PscAutoConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IPscAutoConnectionConfig + * @property {string|null} [consumerProject] PscAutoConnectionConfig consumerProject + * @property {string|null} [consumerNetwork] PscAutoConnectionConfig consumerNetwork + * @property {string|null} [ipAddress] PscAutoConnectionConfig ipAddress + * @property {string|null} [status] PscAutoConnectionConfig status + * @property {string|null} [consumerNetworkStatus] PscAutoConnectionConfig consumerNetworkStatus + */ + + /** + * Constructs a new PscAutoConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a PscAutoConnectionConfig. + * @implements IPscAutoConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig=} [properties] Properties to set + */ + function PscAutoConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscAutoConnectionConfig consumerProject. + * @member {string} consumerProject + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerProject = ""; + + /** + * PscAutoConnectionConfig consumerNetwork. + * @member {string} consumerNetwork + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerNetwork = ""; + + /** + * PscAutoConnectionConfig ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.ipAddress = ""; + + /** + * PscAutoConnectionConfig status. + * @member {string} status + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.status = ""; + + /** + * PscAutoConnectionConfig consumerNetworkStatus. + * @member {string} consumerNetworkStatus + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerNetworkStatus = ""; + + /** + * Creates a new PscAutoConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig instance + */ + PscAutoConnectionConfig.create = function create(properties) { + return new PscAutoConnectionConfig(properties); + }; + + /** + * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscAutoConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNetwork); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.consumerNetworkStatus); + return writer; + }; + + /** + * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscAutoConnectionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consumerProject = reader.string(); + break; + } + case 2: { + message.consumerNetwork = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + case 4: { + message.status = reader.string(); + break; + } + case 5: { + message.consumerNetworkStatus = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscAutoConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscAutoConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscAutoConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (!$util.isString(message.consumerProject)) + return "consumerProject: string expected"; + if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (!$util.isString(message.consumerNetwork)) + return "consumerNetwork: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) + if (!$util.isString(message.consumerNetworkStatus)) + return "consumerNetworkStatus: string expected"; + return null; + }; + + /** + * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + */ + PscAutoConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig(); + if (object.consumerProject != null) + message.consumerProject = String(object.consumerProject); + if (object.consumerNetwork != null) + message.consumerNetwork = String(object.consumerNetwork); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.status != null) + message.status = String(object.status); + if (object.consumerNetworkStatus != null) + message.consumerNetworkStatus = String(object.consumerNetworkStatus); + return message; + }; + + /** + * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} message PscAutoConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscAutoConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.consumerProject = ""; + object.consumerNetwork = ""; + object.ipAddress = ""; + object.status = ""; + object.consumerNetworkStatus = ""; + } + if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + object.consumerProject = message.consumerProject; + if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + object.consumerNetwork = message.consumerNetwork; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) + object.consumerNetworkStatus = message.consumerNetworkStatus; + return object; + }; + + /** + * Converts this PscAutoConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + PscAutoConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscAutoConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscAutoConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig"; + }; + + return PscAutoConnectionConfig; + })(); + + Instance.PscInstanceConfig = (function() { + + /** + * Properties of a PscInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IPscInstanceConfig + * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink + * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects + * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName + * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs + * @property {Array.|null} [pscAutoConnections] PscInstanceConfig pscAutoConnections + */ + + /** + * Constructs a new PscInstanceConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a PscInstanceConfig. + * @implements IPscInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig=} [properties] Properties to set + */ + function PscInstanceConfig(properties) { + this.allowedConsumerProjects = []; + this.pscInterfaceConfigs = []; + this.pscAutoConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscInstanceConfig serviceAttachmentLink. + * @member {string} serviceAttachmentLink + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.serviceAttachmentLink = ""; + + /** + * PscInstanceConfig allowedConsumerProjects. + * @member {Array.} allowedConsumerProjects + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.allowedConsumerProjects = $util.emptyArray; + + /** + * PscInstanceConfig pscDnsName. + * @member {string} pscDnsName + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscDnsName = ""; + + /** + * PscInstanceConfig pscInterfaceConfigs. + * @member {Array.} pscInterfaceConfigs + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; + + /** + * PscInstanceConfig pscAutoConnections. + * @member {Array.} pscAutoConnections + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscAutoConnections = $util.emptyArray; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig instance + */ + PscInstanceConfig.create = function create(properties) { + return new PscInstanceConfig(properties); + }; + + /** + * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAttachmentLink != null && Object.hasOwnProperty.call(message, "serviceAttachmentLink")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachmentLink); + if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) + for (var i = 0; i < message.allowedConsumerProjects.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); + if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscDnsName); + if (message.pscInterfaceConfigs != null && message.pscInterfaceConfigs.length) + for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) + $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.encode(message.pscInterfaceConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.pscAutoConnections != null && message.pscAutoConnections.length) + for (var i = 0; i < message.pscAutoConnections.length; ++i) + $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAttachmentLink = reader.string(); + break; + } + case 2: { + if (!(message.allowedConsumerProjects && message.allowedConsumerProjects.length)) + message.allowedConsumerProjects = []; + message.allowedConsumerProjects.push(reader.string()); + break; + } + case 7: { + message.pscDnsName = reader.string(); + break; + } + case 8: { + if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) + message.pscInterfaceConfigs = []; + message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.pscAutoConnections && message.pscAutoConnections.length)) + message.pscAutoConnections = []; + message.pscAutoConnections.push($root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) + if (!$util.isString(message.serviceAttachmentLink)) + return "serviceAttachmentLink: string expected"; + if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { + if (!Array.isArray(message.allowedConsumerProjects)) + return "allowedConsumerProjects: array expected"; + for (var i = 0; i < message.allowedConsumerProjects.length; ++i) + if (!$util.isString(message.allowedConsumerProjects[i])) + return "allowedConsumerProjects: string[] expected"; + } + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + if (!$util.isString(message.pscDnsName)) + return "pscDnsName: string expected"; + if (message.pscInterfaceConfigs != null && message.hasOwnProperty("pscInterfaceConfigs")) { + if (!Array.isArray(message.pscInterfaceConfigs)) + return "pscInterfaceConfigs: array expected"; + for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify(message.pscInterfaceConfigs[i]); + if (error) + return "pscInterfaceConfigs." + error; + } + } + if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (!Array.isArray(message.pscAutoConnections)) + return "pscAutoConnections: array expected"; + for (var i = 0; i < message.pscAutoConnections.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify(message.pscAutoConnections[i]); + if (error) + return "pscAutoConnections." + error; + } + } + return null; + }; + + /** + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig + */ + PscInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig(); + if (object.serviceAttachmentLink != null) + message.serviceAttachmentLink = String(object.serviceAttachmentLink); + if (object.allowedConsumerProjects) { + if (!Array.isArray(object.allowedConsumerProjects)) + throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.allowedConsumerProjects: array expected"); + message.allowedConsumerProjects = []; + for (var i = 0; i < object.allowedConsumerProjects.length; ++i) + message.allowedConsumerProjects[i] = String(object.allowedConsumerProjects[i]); + } + if (object.pscDnsName != null) + message.pscDnsName = String(object.pscDnsName); + if (object.pscInterfaceConfigs) { + if (!Array.isArray(object.pscInterfaceConfigs)) + throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscInterfaceConfigs: array expected"); + message.pscInterfaceConfigs = []; + for (var i = 0; i < object.pscInterfaceConfigs.length; ++i) { + if (typeof object.pscInterfaceConfigs[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscInterfaceConfigs: object expected"); + message.pscInterfaceConfigs[i] = $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.fromObject(object.pscInterfaceConfigs[i]); + } + } + if (object.pscAutoConnections) { + if (!Array.isArray(object.pscAutoConnections)) + throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscAutoConnections: array expected"); + message.pscAutoConnections = []; + for (var i = 0; i < object.pscAutoConnections.length; ++i) { + if (typeof object.pscAutoConnections[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscAutoConnections: object expected"); + message.pscAutoConnections[i] = $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.PscInstanceConfig} message PscInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedConsumerProjects = []; + object.pscInterfaceConfigs = []; + object.pscAutoConnections = []; + } + if (options.defaults) { + object.serviceAttachmentLink = ""; + object.pscDnsName = ""; + } + if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) + object.serviceAttachmentLink = message.serviceAttachmentLink; + if (message.allowedConsumerProjects && message.allowedConsumerProjects.length) { + object.allowedConsumerProjects = []; + for (var j = 0; j < message.allowedConsumerProjects.length; ++j) + object.allowedConsumerProjects[j] = message.allowedConsumerProjects[j]; + } + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + object.pscDnsName = message.pscDnsName; + if (message.pscInterfaceConfigs && message.pscInterfaceConfigs.length) { + object.pscInterfaceConfigs = []; + for (var j = 0; j < message.pscInterfaceConfigs.length; ++j) + object.pscInterfaceConfigs[j] = $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.toObject(message.pscInterfaceConfigs[j], options); + } + if (message.pscAutoConnections && message.pscAutoConnections.length) { + object.pscAutoConnections = []; + for (var j = 0; j < message.pscAutoConnections.length; ++j) + object.pscAutoConnections[j] = $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + } + return object; + }; + + /** + * Converts this PscInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + PscInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscInstanceConfig"; + }; + + return PscInstanceConfig; + })(); + + Instance.InstanceNetworkConfig = (function() { + + /** + * Properties of an InstanceNetworkConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IInstanceNetworkConfig + * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks + * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp + * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp + * @property {string|null} [network] InstanceNetworkConfig network + * @property {string|null} [allocatedIpRangeOverride] InstanceNetworkConfig allocatedIpRangeOverride + */ + + /** + * Constructs a new InstanceNetworkConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents an InstanceNetworkConfig. + * @implements IInstanceNetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig=} [properties] Properties to set + */ + function InstanceNetworkConfig(properties) { + this.authorizedExternalNetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceNetworkConfig authorizedExternalNetworks. + * @member {Array.} authorizedExternalNetworks + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; + + /** + * InstanceNetworkConfig enablePublicIp. + * @member {boolean} enablePublicIp + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enablePublicIp = false; + + /** + * InstanceNetworkConfig enableOutboundPublicIp. + * @member {boolean} enableOutboundPublicIp + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; + + /** + * InstanceNetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.network = ""; + + /** + * InstanceNetworkConfig allocatedIpRangeOverride. + * @member {string} allocatedIpRangeOverride + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.allocatedIpRangeOverride = ""; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance + */ + InstanceNetworkConfig.create = function create(properties) { + return new InstanceNetworkConfig(properties); + }; + + /** + * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceNetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedExternalNetworks != null && message.authorizedExternalNetworks.length) + for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) + $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); + if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); + if (message.allocatedIpRangeOverride != null && Object.hasOwnProperty.call(message, "allocatedIpRangeOverride")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRangeOverride); + return writer; + }; + + /** + * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceNetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.authorizedExternalNetworks && message.authorizedExternalNetworks.length)) + message.authorizedExternalNetworks = []; + message.authorizedExternalNetworks.push($root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.decode(reader, reader.uint32())); + break; + } + case 2: { + message.enablePublicIp = reader.bool(); + break; + } + case 3: { + message.enableOutboundPublicIp = reader.bool(); + break; + } + case 4: { + message.network = reader.string(); + break; + } + case 5: { + message.allocatedIpRangeOverride = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceNetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceNetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedExternalNetworks != null && message.hasOwnProperty("authorizedExternalNetworks")) { + if (!Array.isArray(message.authorizedExternalNetworks)) + return "authorizedExternalNetworks: array expected"; + for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify(message.authorizedExternalNetworks[i]); + if (error) + return "authorizedExternalNetworks." + error; + } + } + if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) + if (typeof message.enablePublicIp !== "boolean") + return "enablePublicIp: boolean expected"; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + if (typeof message.enableOutboundPublicIp !== "boolean") + return "enableOutboundPublicIp: boolean expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) + if (!$util.isString(message.allocatedIpRangeOverride)) + return "allocatedIpRangeOverride: string expected"; + return null; + }; + + /** + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig + */ + InstanceNetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig(); + if (object.authorizedExternalNetworks) { + if (!Array.isArray(object.authorizedExternalNetworks)) + throw TypeError(".google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.authorizedExternalNetworks: array expected"); + message.authorizedExternalNetworks = []; + for (var i = 0; i < object.authorizedExternalNetworks.length; ++i) { + if (typeof object.authorizedExternalNetworks[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.authorizedExternalNetworks: object expected"); + message.authorizedExternalNetworks[i] = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.fromObject(object.authorizedExternalNetworks[i]); + } + } + if (object.enablePublicIp != null) + message.enablePublicIp = Boolean(object.enablePublicIp); + if (object.enableOutboundPublicIp != null) + message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRangeOverride != null) + message.allocatedIpRangeOverride = String(object.allocatedIpRangeOverride); + return message; + }; + + /** + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} message InstanceNetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceNetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedExternalNetworks = []; + if (options.defaults) { + object.enablePublicIp = false; + object.enableOutboundPublicIp = false; + object.network = ""; + object.allocatedIpRangeOverride = ""; + } + if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { + object.authorizedExternalNetworks = []; + for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) + object.authorizedExternalNetworks[j] = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.toObject(message.authorizedExternalNetworks[j], options); + } + if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) + object.enablePublicIp = message.enablePublicIp; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + object.enableOutboundPublicIp = message.enableOutboundPublicIp; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) + object.allocatedIpRangeOverride = message.allocatedIpRangeOverride; + return object; + }; + + /** + * Converts this InstanceNetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceNetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceNetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceNetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.InstanceNetworkConfig"; + }; + + InstanceNetworkConfig.AuthorizedNetwork = (function() { + + /** + * Properties of an AuthorizedNetwork. + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @interface IAuthorizedNetwork + * @property {string|null} [cidrRange] AuthorizedNetwork cidrRange + */ + + /** + * Constructs a new AuthorizedNetwork. + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @classdesc Represents an AuthorizedNetwork. + * @implements IAuthorizedNetwork + * @constructor + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set + */ + function AuthorizedNetwork(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedNetwork cidrRange. + * @member {string} cidrRange + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @instance + */ + AuthorizedNetwork.prototype.cidrRange = ""; + + /** + * Creates a new AuthorizedNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork instance + */ + AuthorizedNetwork.create = function create(properties) { + return new AuthorizedNetwork(properties); + }; + + /** + * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedNetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cidrRange != null && Object.hasOwnProperty.call(message, "cidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cidrRange); + return writer; + }; + + /** + * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedNetwork.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cidrRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedNetwork message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedNetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) + if (!$util.isString(message.cidrRange)) + return "cidrRange: string expected"; + return null; + }; + + /** + * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + */ + AuthorizedNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork(); + if (object.cidrRange != null) + message.cidrRange = String(object.cidrRange); + return message; + }; + + /** + * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} message AuthorizedNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cidrRange = ""; + if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) + object.cidrRange = message.cidrRange; + return object; + }; + + /** + * Converts this AuthorizedNetwork to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @instance + * @returns {Object.} JSON object + */ + AuthorizedNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedNetwork + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork"; + }; + + return AuthorizedNetwork; + })(); + + return InstanceNetworkConfig; + })(); + + Instance.ConnectionPoolConfig = (function() { + + /** + * Properties of a ConnectionPoolConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IConnectionPoolConfig + * @property {boolean|null} [enabled] ConnectionPoolConfig enabled + * @property {Object.|null} [flags] ConnectionPoolConfig flags + * @property {number|null} [poolerCount] ConnectionPoolConfig poolerCount + */ + + /** + * Constructs a new ConnectionPoolConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a ConnectionPoolConfig. + * @implements IConnectionPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig=} [properties] Properties to set + */ + function ConnectionPoolConfig(properties) { + this.flags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionPoolConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.enabled = false; + + /** + * ConnectionPoolConfig flags. + * @member {Object.} flags + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.flags = $util.emptyObject; + + /** + * ConnectionPoolConfig poolerCount. + * @member {number} poolerCount + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.poolerCount = 0; + + /** + * Creates a new ConnectionPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig instance + */ + ConnectionPoolConfig.create = function create(properties) { + return new ConnectionPoolConfig(properties); + }; + + /** + * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enabled); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + for (var keys = Object.keys(message.flags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.flags[keys[i]]).ldelim(); + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.poolerCount); + return writer; + }; + + /** + * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 12: { + message.enabled = reader.bool(); + break; + } + case 13: { + if (message.flags === $util.emptyObject) + message.flags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.flags[key] = value; + break; + } + case 14: { + message.poolerCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isObject(message.flags)) + return "flags: object expected"; + var key = Object.keys(message.flags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.flags[key[i]])) + return "flags: string{k:string} expected"; + } + if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) + if (!$util.isInteger(message.poolerCount)) + return "poolerCount: integer expected"; + return null; + }; + + /** + * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig + */ + ConnectionPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.flags) { + if (typeof object.flags !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.flags: object expected"); + message.flags = {}; + for (var keys = Object.keys(object.flags), i = 0; i < keys.length; ++i) + message.flags[keys[i]] = String(object.flags[keys[i]]); + } + if (object.poolerCount != null) + message.poolerCount = object.poolerCount | 0; + return message; + }; + + /** + * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} message ConnectionPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.flags = {}; + if (options.defaults) { + object.enabled = false; + object.poolerCount = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + var keys2; + if (message.flags && (keys2 = Object.keys(message.flags)).length) { + object.flags = {}; + for (var j = 0; j < keys2.length; ++j) + object.flags[keys2[j]] = message.flags[keys2[j]]; + } + if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) + object.poolerCount = message.poolerCount; + return object; + }; + + /** + * Converts this ConnectionPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ConnectionPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ConnectionPoolConfig"; + }; + + return ConnectionPoolConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value + * @property {number} PROMOTING=9 PROMOTING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * InstanceType enum. + * @name google.cloud.alloydb.v1.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} READ_POOL=2 READ_POOL value + * @property {number} SECONDARY=3 SECONDARY value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "READ_POOL"] = 2; + values[valuesById[3] = "SECONDARY"] = 3; + return values; + })(); + + /** + * AvailabilityType enum. + * @name google.cloud.alloydb.v1.Instance.AvailabilityType + * @enum {number} + * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + Instance.AvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + /** + * ActivationPolicy enum. + * @name google.cloud.alloydb.v1.Instance.ActivationPolicy + * @enum {number} + * @property {number} ACTIVATION_POLICY_UNSPECIFIED=0 ACTIVATION_POLICY_UNSPECIFIED value + * @property {number} ALWAYS=1 ALWAYS value + * @property {number} NEVER=2 NEVER value + */ + Instance.ActivationPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVATION_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALWAYS"] = 1; + values[valuesById[2] = "NEVER"] = 2; + return values; + })(); + + return Instance; + })(); + + v1.ConnectionInfo = (function() { + + /** + * Properties of a ConnectionInfo. + * @memberof google.cloud.alloydb.v1 + * @interface IConnectionInfo + * @property {string|null} [name] ConnectionInfo name + * @property {string|null} [ipAddress] ConnectionInfo ipAddress + * @property {string|null} [publicIpAddress] ConnectionInfo publicIpAddress + * @property {string|null} [instanceUid] ConnectionInfo instanceUid + */ + + /** + * Constructs a new ConnectionInfo. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ConnectionInfo. + * @implements IConnectionInfo + * @constructor + * @param {google.cloud.alloydb.v1.IConnectionInfo=} [properties] Properties to set + */ + function ConnectionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionInfo name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.name = ""; + + /** + * ConnectionInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.ipAddress = ""; + + /** + * ConnectionInfo publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.publicIpAddress = ""; + + /** + * ConnectionInfo instanceUid. + * @member {string} instanceUid + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.instanceUid = ""; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1.IConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo instance + */ + ConnectionInfo.create = function create(properties) { + return new ConnectionInfo(properties); + }; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicIpAddress); + return writer; + }; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ConnectionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ipAddress = reader.string(); + break; + } + case 5: { + message.publicIpAddress = reader.string(); + break; + } + case 4: { + message.instanceUid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + if (!$util.isString(message.instanceUid)) + return "instanceUid: string expected"; + return null; + }; + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo + */ + ConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ConnectionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1.ConnectionInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.instanceUid != null) + message.instanceUid = String(object.instanceUid); + return message; + }; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1.ConnectionInfo} message ConnectionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ipAddress = ""; + object.instanceUid = ""; + object.publicIpAddress = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + object.instanceUid = message.instanceUid; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + return object; + }; + + /** + * Converts this ConnectionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @instance + * @returns {Object.} JSON object + */ + ConnectionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ConnectionInfo"; + }; + + return ConnectionInfo; + })(); + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.alloydb.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [displayName] Backup displayName + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime + * @property {google.protobuf.ITimestamp|null} [createCompletionTime] Backup createCompletionTime + * @property {Object.|null} [labels] Backup labels + * @property {google.cloud.alloydb.v1.Backup.State|null} [state] Backup state + * @property {google.cloud.alloydb.v1.Backup.Type|null} [type] Backup type + * @property {string|null} [description] Backup description + * @property {string|null} [clusterUid] Backup clusterUid + * @property {string|null} [clusterName] Backup clusterName + * @property {boolean|null} [reconciling] Backup reconciling + * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig + * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {string|null} [etag] Backup etag + * @property {Object.|null} [annotations] Backup annotations + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * @property {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity + * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Backup databaseVersion + * @property {Object.|null} [tags] Backup tags + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + this.annotations = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.displayName = ""; + + /** + * Backup uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.uid = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.deleteTime = null; + + /** + * Backup createCompletionTime. + * @member {google.protobuf.ITimestamp|null|undefined} createCompletionTime + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.createCompletionTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup state. + * @member {google.cloud.alloydb.v1.Backup.State} state + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup type. + * @member {google.cloud.alloydb.v1.Backup.Type} type + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.type = 0; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup clusterUid. + * @member {string} clusterUid + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.clusterUid = ""; + + /** + * Backup clusterName. + * @member {string} clusterName + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.clusterName = ""; + + /** + * Backup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.reconciling = false; + + /** + * Backup encryptionConfig. + * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.encryptionConfig = null; + + /** + * Backup encryptionInfo. + * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.etag = ""; + + /** + * Backup annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.annotations = $util.emptyObject; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.expiryTime = null; + + /** + * Backup expiryQuantity. + * @member {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.expiryQuantity = null; + + /** + * Backup satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = false; + + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + + /** + * Backup tags. + * @member {Object.} tags + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.tags = $util.emptyObject; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); + if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) + $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + if (message.createCompletionTime != null && Object.hasOwnProperty.call(message, "createCompletionTime")) + $root.google.protobuf.Timestamp.encode(message.createCompletionTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.createCompletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 18: { + message.clusterUid = reader.string(); + break; + } + case 10: { + message.clusterName = reader.string(); + break; + } + case 11: { + message.reconciling = reader.bool(); + break; + } + case 12: { + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 16: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 17: { + message.sizeBytes = reader.int64(); + break; + } + case 19: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); + break; + } + case 21: { + message.satisfiesPzs = reader.bool(); + break; + } + case 22: { + message.databaseVersion = reader.int32(); + break; + } + case 25: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createCompletionTime); + if (error) + return "createCompletionTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + if (!$util.isString(message.clusterUid)) + return "clusterUid: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { + var error = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); + if (error) + return "expiryQuantity." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Backup) + return object; + var message = new $root.google.cloud.alloydb.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.createCompletionTime != null) { + if (typeof object.createCompletionTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.createCompletionTime: object expected"); + message.createCompletionTime = $root.google.protobuf.Timestamp.fromObject(object.createCompletionTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ON_DEMAND": + case 1: + message.type = 1; + break; + case "AUTOMATED": + case 2: + message.type = 2; + break; + case "CONTINUOUS": + case 3: + message.type = 3; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.clusterUid != null) + message.clusterUid = String(object.clusterUid); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } + if (object.expiryQuantity != null) { + if (typeof object.expiryQuantity !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.expiryQuantity: object expected"); + message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {google.cloud.alloydb.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.clusterName = ""; + object.reconciling = false; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.etag = ""; + object.deleteTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.clusterUid = ""; + object.expiryTime = null; + object.expiryQuantity = null; + object.satisfiesPzs = false; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.createCompletionTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Backup.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Backup.Type[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + object.clusterUid = message.clusterUid; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) + object.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) + object.createCompletionTime = $root.google.protobuf.Timestamp.toObject(message.createCompletionTime, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; + }; + + Backup.QuantityBasedExpiry = (function() { + + /** + * Properties of a QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1.Backup + * @interface IQuantityBasedExpiry + * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount + * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount + */ + + /** + * Constructs a new QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1.Backup + * @classdesc Represents a QuantityBasedExpiry. + * @implements IQuantityBasedExpiry + * @constructor + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + */ + function QuantityBasedExpiry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedExpiry retentionCount. + * @member {number} retentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.retentionCount = 0; + + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + */ + QuantityBasedExpiry.create = function create(properties) { + return new QuantityBasedExpiry(properties); + }; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); + if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); + return writer; + }; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionCount = reader.int32(); + break; + } + case 2: { + message.totalRetentionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedExpiry message. + * @function verify + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedExpiry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + if (!$util.isInteger(message.retentionCount)) + return "retentionCount: integer expected"; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + if (!$util.isInteger(message.totalRetentionCount)) + return "totalRetentionCount: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + */ + QuantityBasedExpiry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry) + return object; + var message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); + if (object.retentionCount != null) + message.retentionCount = object.retentionCount | 0; + if (object.totalRetentionCount != null) + message.totalRetentionCount = object.totalRetentionCount | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedExpiry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionCount = 0; + object.totalRetentionCount = 0; + } + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + object.retentionCount = message.retentionCount; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + object.totalRetentionCount = message.totalRetentionCount; + return object; + }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedExpiry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup.QuantityBasedExpiry"; + }; + + return QuantityBasedExpiry; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.alloydb.v1.Backup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} AUTOMATED=2 AUTOMATED value + * @property {number} CONTINUOUS=3 CONTINUOUS value + */ + Backup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "AUTOMATED"] = 2; + values[valuesById[3] = "CONTINUOUS"] = 3; + return values; + })(); + + return Backup; + })(); + + v1.SupportedDatabaseFlag = (function() { + + /** + * Properties of a SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1 + * @interface ISupportedDatabaseFlag + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions + * @property {string|null} [recommendedStringValue] SupportedDatabaseFlag recommendedStringValue + * @property {google.protobuf.IInt64Value|null} [recommendedIntegerValue] SupportedDatabaseFlag recommendedIntegerValue + * @property {string|null} [name] SupportedDatabaseFlag name + * @property {string|null} [flagName] SupportedDatabaseFlag flagName + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType + * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues + * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions + * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null} [scope] SupportedDatabaseFlag scope + */ + + /** + * Constructs a new SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SupportedDatabaseFlag. + * @implements ISupportedDatabaseFlag + * @constructor + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set + */ + function SupportedDatabaseFlag(properties) { + this.supportedDbVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.stringRestrictions = null; + + /** + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.integerRestrictions = null; + + /** + * SupportedDatabaseFlag recommendedStringValue. + * @member {string|null|undefined} recommendedStringValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.recommendedStringValue = null; + + /** + * SupportedDatabaseFlag recommendedIntegerValue. + * @member {google.protobuf.IInt64Value|null|undefined} recommendedIntegerValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.recommendedIntegerValue = null; + + /** + * SupportedDatabaseFlag name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.name = ""; + + /** + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.flagName = ""; + + /** + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.valueType = 0; + + /** + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; + + /** + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + + /** + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.requiresDbRestart = false; + + /** + * SupportedDatabaseFlag scope. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} scope + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.scope = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SupportedDatabaseFlag recommendedValue. + * @member {"recommendedStringValue"|"recommendedIntegerValue"|undefined} recommendedValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "recommendedValue", { + get: $util.oneOfGetter($oneOfFields = ["recommendedStringValue", "recommendedIntegerValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag instance + */ + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); + }; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); + if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); + if (message.supportedDbVersions != null && message.supportedDbVersions.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedDbVersions.length; ++i) + writer.int32(message.supportedDbVersions[i]); + writer.ldelim(); + } + if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); + if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) + $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) + $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recommendedStringValue); + if (message.recommendedIntegerValue != null && Object.hasOwnProperty.call(message, "recommendedIntegerValue")) + $root.google.protobuf.Int64Value.encode(message.recommendedIntegerValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.recommendedStringValue = reader.string(); + break; + } + case 11: { + message.recommendedIntegerValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flagName = reader.string(); + break; + } + case 3: { + message.valueType = reader.int32(); + break; + } + case 4: { + message.acceptsMultipleValues = reader.bool(); + break; + } + case 5: { + if (!(message.supportedDbVersions && message.supportedDbVersions.length)) + message.supportedDbVersions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedDbVersions.push(reader.int32()); + } else + message.supportedDbVersions.push(reader.int32()); + break; + } + case 6: { + message.requiresDbRestart = reader.bool(); + break; + } + case 9: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedDatabaseFlag message. + * @function verify + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedDatabaseFlag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); + if (error) + return "stringRestrictions." + error; + } + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + if (properties.restrictions === 1) + return "restrictions: multiple values"; + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); + if (error) + return "integerRestrictions." + error; + } + } + if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + properties.recommendedValue = 1; + if (!$util.isString(message.recommendedStringValue)) + return "recommendedStringValue: string expected"; + } + if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { + if (properties.recommendedValue === 1) + return "recommendedValue: multiple values"; + properties.recommendedValue = 1; + { + var error = $root.google.protobuf.Int64Value.verify(message.recommendedIntegerValue); + if (error) + return "recommendedIntegerValue." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flagName != null && message.hasOwnProperty("flagName")) + if (!$util.isString(message.flagName)) + return "flagName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + if (typeof message.acceptsMultipleValues !== "boolean") + return "acceptsMultipleValues: boolean expected"; + if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { + if (!Array.isArray(message.supportedDbVersions)) + return "supportedDbVersions: array expected"; + for (var i = 0; i < message.supportedDbVersions.length; ++i) + switch (message.supportedDbVersions[i]) { + default: + return "supportedDbVersions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag + */ + SupportedDatabaseFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag) + return object; + var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); + if (object.stringRestrictions != null) { + if (typeof object.stringRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.stringRestrictions: object expected"); + message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); + } + if (object.integerRestrictions != null) { + if (typeof object.integerRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.integerRestrictions: object expected"); + message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + } + if (object.recommendedStringValue != null) + message.recommendedStringValue = String(object.recommendedStringValue); + if (object.recommendedIntegerValue != null) { + if (typeof object.recommendedIntegerValue !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.recommendedIntegerValue: object expected"); + message.recommendedIntegerValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntegerValue); + } + if (object.name != null) + message.name = String(object.name); + if (object.flagName != null) + message.flagName = String(object.flagName); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INTEGER": + case 2: + message.valueType = 2; + break; + case "FLOAT": + case 3: + message.valueType = 3; + break; + case "NONE": + case 4: + message.valueType = 4; + break; + } + if (object.acceptsMultipleValues != null) + message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); + if (object.supportedDbVersions) { + if (!Array.isArray(object.supportedDbVersions)) + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.supportedDbVersions: array expected"); + message.supportedDbVersions = []; + for (var i = 0; i < object.supportedDbVersions.length; ++i) + switch (object.supportedDbVersions[i]) { + default: + if (typeof object.supportedDbVersions[i] === "number") { + message.supportedDbVersions[i] = object.supportedDbVersions[i]; + break; + } + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.supportedDbVersions[i] = 0; + break; + case "POSTGRES_13": + case 1: + message.supportedDbVersions[i] = 1; + break; + case "POSTGRES_14": + case 2: + message.supportedDbVersions[i] = 2; + break; + case "POSTGRES_15": + case 3: + message.supportedDbVersions[i] = 3; + break; + case "POSTGRES_16": + case 4: + message.supportedDbVersions[i] = 4; + break; + case "POSTGRES_17": + case 5: + message.supportedDbVersions[i] = 5; + break; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "DATABASE": + case 1: + message.scope = 1; + break; + case "CONNECTION_POOL": + case 2: + message.scope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedDatabaseFlag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDbVersions = []; + if (options.defaults) { + object.name = ""; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flagName != null && message.hasOwnProperty("flagName")) + object.flagName = message.flagName; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + object.acceptsMultipleValues = message.acceptsMultipleValues; + if (message.supportedDbVersions && message.supportedDbVersions.length) { + object.supportedDbVersions = []; + for (var j = 0; j < message.supportedDbVersions.length; ++j) + object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + object.requiresDbRestart = message.requiresDbRestart; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + object.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); + if (options.oneofs) + object.restrictions = "stringRestrictions"; + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + object.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); + if (options.oneofs) + object.restrictions = "integerRestrictions"; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] : message.scope; + if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + object.recommendedStringValue = message.recommendedStringValue; + if (options.oneofs) + object.recommendedValue = "recommendedStringValue"; + } + if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { + object.recommendedIntegerValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntegerValue, options); + if (options.oneofs) + object.recommendedValue = "recommendedIntegerValue"; + } + return object; + }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @instance + * @returns {Object.} JSON object + */ + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag"; + }; + + SupportedDatabaseFlag.StringRestrictions = (function() { + + /** + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues + */ + + /** + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions + * @constructor + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + */ + function StringRestrictions(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @instance + */ + StringRestrictions.prototype.allowedValues = $util.emptyArray; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance + */ + StringRestrictions.create = function create(properties) { + return new StringRestrictions(properties); + }; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + return writer; + }; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + return null; + }; + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + */ + StringRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + return object; + }; + + /** + * Converts this StringRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @instance + * @returns {Object.} JSON object + */ + StringRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions"; + }; + + return StringRestrictions; + })(); + + SupportedDatabaseFlag.IntegerRestrictions = (function() { + + /** + * Properties of an IntegerRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @interface IIntegerRestrictions + * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue + * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue + */ + + /** + * Constructs a new IntegerRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @classdesc Represents an IntegerRestrictions. + * @implements IIntegerRestrictions + * @constructor + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + */ + function IntegerRestrictions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntegerRestrictions minValue. + * @member {google.protobuf.IInt64Value|null|undefined} minValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.minValue = null; + + /** + * IntegerRestrictions maxValue. + * @member {google.protobuf.IInt64Value|null|undefined} maxValue + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.maxValue = null; + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance + */ + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); + }; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + return null; + }; + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + */ + IntegerRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); + message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); + message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + } + return message; + }; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + return object; + }; + + /** + * Converts this IntegerRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @instance + * @returns {Object.} JSON object + */ + IntegerRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions"; + }; + + return IntegerRestrictions; + })(); + + /** + * ValueType enum. + * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} FLOAT=3 FLOAT value + * @property {number} NONE=4 NONE value + */ + SupportedDatabaseFlag.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "FLOAT"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} DATABASE=1 DATABASE value + * @property {number} CONNECTION_POOL=2 CONNECTION_POOL value + */ + SupportedDatabaseFlag.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATABASE"] = 1; + values[valuesById[2] = "CONNECTION_POOL"] = 2; + return values; + })(); + + return SupportedDatabaseFlag; + })(); + + v1.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.alloydb.v1 + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [password] User password + * @property {Array.|null} [databaseRoles] User databaseRoles + * @property {google.cloud.alloydb.v1.User.UserType|null} [userType] User userType + * @property {boolean|null} [keepExtraRoles] User keepExtraRoles + */ + + /** + * Constructs a new User. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set + */ + function User(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.User + * @instance + */ + User.prototype.name = ""; + + /** + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1.User + * @instance + */ + User.prototype.password = ""; + + /** + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1.User + * @instance + */ + User.prototype.databaseRoles = $util.emptyArray; + + /** + * User userType. + * @member {google.cloud.alloydb.v1.User.UserType} userType + * @memberof google.cloud.alloydb.v1.User + * @instance + */ + User.prototype.userType = 0; + + /** + * User keepExtraRoles. + * @member {boolean} keepExtraRoles + * @memberof google.cloud.alloydb.v1.User + * @instance + */ + User.prototype.keepExtraRoles = false; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {google.cloud.alloydb.v1.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); + if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); + if (message.keepExtraRoles != null && Object.hasOwnProperty.call(message, "keepExtraRoles")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.keepExtraRoles); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {google.cloud.alloydb.v1.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 4: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push(reader.string()); + break; + } + case 5: { + message.userType = reader.int32(); + break; + } + case 6: { + message.keepExtraRoles = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) + if (!$util.isString(message.databaseRoles[i])) + return "databaseRoles: string[] expected"; + } + if (message.userType != null && message.hasOwnProperty("userType")) + switch (message.userType) { + default: + return "userType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) + if (typeof message.keepExtraRoles !== "boolean") + return "keepExtraRoles: boolean expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.User) + return object; + var message = new $root.google.cloud.alloydb.v1.User(); + if (object.name != null) + message.name = String(object.name); + if (object.password != null) + message.password = String(object.password); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.cloud.alloydb.v1.User.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) + message.databaseRoles[i] = String(object.databaseRoles[i]); + } + switch (object.userType) { + default: + if (typeof object.userType === "number") { + message.userType = object.userType; + break; + } + break; + case "USER_TYPE_UNSPECIFIED": + case 0: + message.userType = 0; + break; + case "ALLOYDB_BUILT_IN": + case 1: + message.userType = 1; + break; + case "ALLOYDB_IAM_USER": + case 2: + message.userType = 2; + break; + } + if (object.keepExtraRoles != null) + message.keepExtraRoles = Boolean(object.keepExtraRoles); + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {google.cloud.alloydb.v1.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; + if (options.defaults) { + object.name = ""; + object.password = ""; + object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; + object.keepExtraRoles = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = message.databaseRoles[j]; + } + if (message.userType != null && message.hasOwnProperty("userType")) + object.userType = options.enums === String ? $root.google.cloud.alloydb.v1.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1.User.UserType[message.userType] : message.userType; + if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) + object.keepExtraRoles = message.keepExtraRoles; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.User"; + }; + + /** + * UserType enum. + * @name google.cloud.alloydb.v1.User.UserType + * @enum {number} + * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value + * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value + * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value + */ + User.UserType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; + values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; + return values; + })(); + + return User; + })(); + + v1.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.alloydb.v1 + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {string|null} [charset] Database charset + * @property {string|null} [collation] Database collation + * @property {string|null} [characterType] Database characterType + * @property {string|null} [databaseTemplate] Database databaseTemplate + * @property {boolean|null} [isTemplateDatabase] Database isTemplateDatabase + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.alloydb.v1.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database charset. + * @member {string} charset + * @memberof google.cloud.alloydb.v1.Database + * @instance + */ + Database.prototype.charset = ""; + + /** + * Database collation. + * @member {string} collation + * @memberof google.cloud.alloydb.v1.Database + * @instance + */ + Database.prototype.collation = ""; + + /** + * Database characterType. + * @member {string} characterType + * @memberof google.cloud.alloydb.v1.Database + * @instance + */ + Database.prototype.characterType = ""; + + /** + * Database databaseTemplate. + * @member {string} databaseTemplate + * @memberof google.cloud.alloydb.v1.Database + * @instance + */ + Database.prototype.databaseTemplate = ""; + + /** + * Database isTemplateDatabase. + * @member {boolean|null|undefined} isTemplateDatabase + * @memberof google.cloud.alloydb.v1.Database + * @instance + */ + Database.prototype.isTemplateDatabase = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Database.prototype, "_isTemplateDatabase", { + get: $util.oneOfGetter($oneOfFields = ["isTemplateDatabase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {google.cloud.alloydb.v1.IDatabase=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {google.cloud.alloydb.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.charset); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.collation); + if (message.characterType != null && Object.hasOwnProperty.call(message, "characterType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.characterType); + if (message.databaseTemplate != null && Object.hasOwnProperty.call(message, "databaseTemplate")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseTemplate); + if (message.isTemplateDatabase != null && Object.hasOwnProperty.call(message, "isTemplateDatabase")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isTemplateDatabase); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {google.cloud.alloydb.v1.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.charset = reader.string(); + break; + } + case 3: { + message.collation = reader.string(); + break; + } + case 4: { + message.characterType = reader.string(); + break; + } + case 6: { + message.databaseTemplate = reader.string(); + break; + } + case 7: { + message.isTemplateDatabase = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.charset != null && message.hasOwnProperty("charset")) + if (!$util.isString(message.charset)) + return "charset: string expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isString(message.collation)) + return "collation: string expected"; + if (message.characterType != null && message.hasOwnProperty("characterType")) + if (!$util.isString(message.characterType)) + return "characterType: string expected"; + if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) + if (!$util.isString(message.databaseTemplate)) + return "databaseTemplate: string expected"; + if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { + properties._isTemplateDatabase = 1; + if (typeof message.isTemplateDatabase !== "boolean") + return "isTemplateDatabase: boolean expected"; + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Database) + return object; + var message = new $root.google.cloud.alloydb.v1.Database(); + if (object.name != null) + message.name = String(object.name); + if (object.charset != null) + message.charset = String(object.charset); + if (object.collation != null) + message.collation = String(object.collation); + if (object.characterType != null) + message.characterType = String(object.characterType); + if (object.databaseTemplate != null) + message.databaseTemplate = String(object.databaseTemplate); + if (object.isTemplateDatabase != null) + message.isTemplateDatabase = Boolean(object.isTemplateDatabase); + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {google.cloud.alloydb.v1.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.charset = ""; + object.collation = ""; + object.characterType = ""; + object.databaseTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.charset != null && message.hasOwnProperty("charset")) + object.charset = message.charset; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.characterType != null && message.hasOwnProperty("characterType")) + object.characterType = message.characterType; + if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) + object.databaseTemplate = message.databaseTemplate; + if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { + object.isTemplateDatabase = message.isTemplateDatabase; + if (options.oneofs) + object._isTemplateDatabase = "isTemplateDatabase"; + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Database"; + }; + + return Database; + })(); + + v1.AlloyDBAdmin = (function() { + + /** + * Constructs a new AlloyDBAdmin service. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an AlloyDBAdmin + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1.ListClustersRequest, $root.google.cloud.alloydb.v1.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1.GetClusterRequest, $root.google.cloud.alloydb.v1.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|exportCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ExportClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportCluster. + * @function exportCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IExportClusterRequest} request ExportClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ExportClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.exportCluster = function exportCluster(request, callback) { + return this.rpcCall(exportCluster, $root.google.cloud.alloydb.v1.ExportClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportCluster" }); + + /** + * Calls ExportCluster. + * @function exportCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IExportClusterRequest} request ExportClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|importCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ImportClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportCluster. + * @function importCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IImportClusterRequest} request ImportClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ImportClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.importCluster = function importCluster(request, callback) { + return this.rpcCall(importCluster, $root.google.cloud.alloydb.v1.ImportClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportCluster" }); + + /** + * Calls ImportCluster. + * @function importCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IImportClusterRequest} request ImportClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|upgradeCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpgradeClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpgradeCluster. + * @function upgradeCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.upgradeCluster = function upgradeCluster(request, callback) { + return this.rpcCall(upgradeCluster, $root.google.cloud.alloydb.v1.UpgradeClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpgradeCluster" }); + + /** + * Calls UpgradeCluster. + * @function upgradeCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|promoteCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef PromoteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { + return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteCluster" }); + + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|switchoverCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef SwitchoverClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SwitchoverCluster. + * @function switchoverCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.switchoverCluster = function switchoverCluster(request, callback) { + return this.rpcCall(switchoverCluster, $root.google.cloud.alloydb.v1.SwitchoverClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SwitchoverCluster" }); + + /** + * Calls SwitchoverCluster. + * @function switchoverCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef RestoreClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { + return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCluster" }); + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryCluster}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateSecondaryClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { + return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryCluster" }); + + /** + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1.ListInstancesRequest, $root.google.cloud.alloydb.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1.GetInstanceRequest, $root.google.cloud.alloydb.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateSecondaryInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { + return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryInstance" }); + + /** + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef BatchCreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { + return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateInstances" }); + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|failoverInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef FailoverInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { + return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FailoverInstance" }); + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|injectFault}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef InjectFaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { + return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InjectFault" }); + + /** + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|executeSql}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ExecuteSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ExecuteSqlResponse} [response] ExecuteSqlResponse + */ + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ExecuteSqlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.executeSql = function executeSql(request, callback) { + return this.rpcCall(executeSql, $root.google.cloud.alloydb.v1.ExecuteSqlRequest, $root.google.cloud.alloydb.v1.ExecuteSqlResponse, request, callback); + }, "name", { value: "ExecuteSql" }); + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listBackups}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1.ListBackupsRequest, $root.google.cloud.alloydb.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1.GetBackupRequest, $root.google.cloud.alloydb.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListSupportedDatabaseFlagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse + */ + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { + return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse, request, callback); + }, "name", { value: "ListSupportedDatabaseFlags" }); + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|generateClientCertificate}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GenerateClientCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse + */ + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { + return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse, request, callback); + }, "name", { value: "GenerateClientCertificate" }); + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getConnectionInfo}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetConnectionInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ConnectionInfo} [response] ConnectionInfo + */ + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { + return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1.ConnectionInfo, request, callback); + }, "name", { value: "GetConnectionInfo" }); + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListUsersResponse} [response] ListUsersResponse + */ + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1.ListUsersRequest, $root.google.cloud.alloydb.v1.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.User} [response] User + */ + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.cloud.alloydb.v1.GetUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); + }, "name", { value: "GetUser" }); + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.User} [response] User + */ + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.cloud.alloydb.v1.CreateUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1.UpdateUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); + }, "name", { value: "UpdateUser" }); + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteUser}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listDatabases}. + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @typedef ListDatabasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1.ListDatabasesResponse} [response] ListDatabasesResponse + */ + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listDatabases = function listDatabases(request, callback) { + return this.rpcCall(listDatabases, $root.google.cloud.alloydb.v1.ListDatabasesRequest, $root.google.cloud.alloydb.v1.ListDatabasesResponse, request, callback); + }, "name", { value: "ListDatabases" }); + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBAdmin; + })(); + + v1.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListClustersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.alloydb.v1.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListClustersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.clusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.alloydb.v1.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + * @property {google.cloud.alloydb.v1.ClusterView|null} [view] GetClusterRequest view + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1.ClusterView} view + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.view = 0; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CLUSTER_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CLUSTER_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CLUSTER_VIEW_CONTINUOUS_BACKUP": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.ClusterView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1.CreateSecondaryClusterRequest = (function() { + + /** + * Properties of a CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateSecondaryClusterRequest + * @property {string|null} [parent] CreateSecondaryClusterRequest parent + * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster + * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly + */ + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateSecondaryClusterRequest. + * @implements ICreateSecondaryClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set + */ + function CreateSecondaryClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecondaryClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.parent = ""; + + /** + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.clusterId = ""; + + /** + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.cluster = null; + + /** + * CreateSecondaryClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.requestId = ""; + + /** + * CreateSecondaryClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance + */ + CreateSecondaryClusterRequest.create = function create(properties) { + return new CreateSecondaryClusterRequest(properties); + }; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecondaryClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + */ + CreateSecondaryClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateSecondaryClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecondaryClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryClusterRequest"; + }; + + return CreateSecondaryClusterRequest; + })(); + + v1.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.validateOnly = false; + + /** + * UpdateClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.alloydb.v1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.alloydb.v1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.alloydb.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {google.cloud.alloydb.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {google.cloud.alloydb.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {google.cloud.alloydb.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GcsDestination) + return object; + var message = new $root.google.cloud.alloydb.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {google.cloud.alloydb.v1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1.ExportClusterRequest = (function() { + + /** + * Properties of an ExportClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IExportClusterRequest + * @property {google.cloud.alloydb.v1.IGcsDestination|null} [gcsDestination] ExportClusterRequest gcsDestination + * @property {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null} [csvExportOptions] ExportClusterRequest csvExportOptions + * @property {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null} [sqlExportOptions] ExportClusterRequest sqlExportOptions + * @property {string|null} [name] ExportClusterRequest name + * @property {string|null} [database] ExportClusterRequest database + */ + + /** + * Constructs a new ExportClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ExportClusterRequest. + * @implements IExportClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IExportClusterRequest=} [properties] Properties to set + */ + function ExportClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportClusterRequest gcsDestination. + * @member {google.cloud.alloydb.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.gcsDestination = null; + + /** + * ExportClusterRequest csvExportOptions. + * @member {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null|undefined} csvExportOptions + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.csvExportOptions = null; + + /** + * ExportClusterRequest sqlExportOptions. + * @member {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null|undefined} sqlExportOptions + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.sqlExportOptions = null; + + /** + * ExportClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.name = ""; + + /** + * ExportClusterRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.database = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportClusterRequest destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + Object.defineProperty(ExportClusterRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExportClusterRequest exportOptions. + * @member {"csvExportOptions"|"sqlExportOptions"|undefined} exportOptions + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + */ + Object.defineProperty(ExportClusterRequest.prototype, "exportOptions", { + get: $util.oneOfGetter($oneOfFields = ["csvExportOptions", "sqlExportOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IExportClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest instance + */ + ExportClusterRequest.create = function create(properties) { + return new ExportClusterRequest(properties); + }; + + /** + * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IExportClusterRequest} message ExportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.alloydb.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) + $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) + $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IExportClusterRequest} message ExportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.csvExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sqlExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.alloydb.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + properties.exportOptions = 1; + { + var error = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify(message.csvExportOptions); + if (error) + return "csvExportOptions." + error; + } + } + if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + if (properties.exportOptions === 1) + return "exportOptions: multiple values"; + properties.exportOptions = 1; + { + var error = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify(message.sqlExportOptions); + if (error) + return "sqlExportOptions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest + */ + ExportClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ExportClusterRequest(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.csvExportOptions != null) { + if (typeof object.csvExportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.csvExportOptions: object expected"); + message.csvExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.fromObject(object.csvExportOptions); + } + if (object.sqlExportOptions != null) { + if (typeof object.sqlExportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.sqlExportOptions: object expected"); + message.sqlExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.fromObject(object.sqlExportOptions); + } + if (object.name != null) + message.name = String(object.name); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest} message ExportClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.database = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + object.csvExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.toObject(message.csvExportOptions, options); + if (options.oneofs) + object.exportOptions = "csvExportOptions"; + } + if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + object.sqlExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.toObject(message.sqlExportOptions, options); + if (options.oneofs) + object.exportOptions = "sqlExportOptions"; + } + return object; + }; + + /** + * Converts this ExportClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @instance + * @returns {Object.} JSON object + */ + ExportClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterRequest"; + }; + + ExportClusterRequest.CsvExportOptions = (function() { + + /** + * Properties of a CsvExportOptions. + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @interface ICsvExportOptions + * @property {string|null} [selectQuery] CsvExportOptions selectQuery + * @property {string|null} [fieldDelimiter] CsvExportOptions fieldDelimiter + * @property {string|null} [quoteCharacter] CsvExportOptions quoteCharacter + * @property {string|null} [escapeCharacter] CsvExportOptions escapeCharacter + */ + + /** + * Constructs a new CsvExportOptions. + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @classdesc Represents a CsvExportOptions. + * @implements ICsvExportOptions + * @constructor + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set + */ + function CsvExportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvExportOptions selectQuery. + * @member {string} selectQuery + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.selectQuery = ""; + + /** + * CsvExportOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.fieldDelimiter = ""; + + /** + * CsvExportOptions quoteCharacter. + * @member {string} quoteCharacter + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.quoteCharacter = ""; + + /** + * CsvExportOptions escapeCharacter. + * @member {string} escapeCharacter + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.escapeCharacter = ""; + + /** + * Creates a new CsvExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions instance + */ + CsvExportOptions.create = function create(properties) { + return new CsvExportOptions(properties); + }; + + /** + * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldDelimiter); + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.quoteCharacter); + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.escapeCharacter); + return writer; + }; + + /** + * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvExportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selectQuery = reader.string(); + break; + } + case 2: { + message.fieldDelimiter = reader.string(); + break; + } + case 3: { + message.quoteCharacter = reader.string(); + break; + } + case 4: { + message.escapeCharacter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvExportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (!$util.isString(message.selectQuery)) + return "selectQuery: string expected"; + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (!$util.isString(message.quoteCharacter)) + return "quoteCharacter: string expected"; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (!$util.isString(message.escapeCharacter)) + return "escapeCharacter: string expected"; + return null; + }; + + /** + * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions + */ + CsvExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions(); + if (object.selectQuery != null) + message.selectQuery = String(object.selectQuery); + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.quoteCharacter != null) + message.quoteCharacter = String(object.quoteCharacter); + if (object.escapeCharacter != null) + message.escapeCharacter = String(object.escapeCharacter); + return message; + }; + + /** + * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} message CsvExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selectQuery = ""; + object.fieldDelimiter = ""; + object.quoteCharacter = ""; + object.escapeCharacter = ""; + } + if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + object.selectQuery = message.selectQuery; + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + object.quoteCharacter = message.quoteCharacter; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + object.escapeCharacter = message.escapeCharacter; + return object; + }; + + /** + * Converts this CsvExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @instance + * @returns {Object.} JSON object + */ + CsvExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvExportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions"; + }; + + return CsvExportOptions; + })(); + + ExportClusterRequest.SqlExportOptions = (function() { + + /** + * Properties of a SqlExportOptions. + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @interface ISqlExportOptions + * @property {Array.|null} [tables] SqlExportOptions tables + * @property {boolean|null} [schemaOnly] SqlExportOptions schemaOnly + * @property {boolean|null} [cleanTargetObjects] SqlExportOptions cleanTargetObjects + * @property {boolean|null} [ifExistTargetObjects] SqlExportOptions ifExistTargetObjects + */ + + /** + * Constructs a new SqlExportOptions. + * @memberof google.cloud.alloydb.v1.ExportClusterRequest + * @classdesc Represents a SqlExportOptions. + * @implements ISqlExportOptions + * @constructor + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set + */ + function SqlExportOptions(properties) { + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlExportOptions tables. + * @member {Array.} tables + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.tables = $util.emptyArray; + + /** + * SqlExportOptions schemaOnly. + * @member {boolean|null|undefined} schemaOnly + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.schemaOnly = null; + + /** + * SqlExportOptions cleanTargetObjects. + * @member {boolean|null|undefined} cleanTargetObjects + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.cleanTargetObjects = null; + + /** + * SqlExportOptions ifExistTargetObjects. + * @member {boolean|null|undefined} ifExistTargetObjects + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.ifExistTargetObjects = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_schemaOnly", { + get: $util.oneOfGetter($oneOfFields = ["schemaOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_cleanTargetObjects", { + get: $util.oneOfGetter($oneOfFields = ["cleanTargetObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_ifExistTargetObjects", { + get: $util.oneOfGetter($oneOfFields = ["ifExistTargetObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions instance + */ + SqlExportOptions.create = function create(properties) { + return new SqlExportOptions(properties); + }; + + /** + * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.schemaOnly); + if (message.cleanTargetObjects != null && Object.hasOwnProperty.call(message, "cleanTargetObjects")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanTargetObjects); + if (message.ifExistTargetObjects != null && Object.hasOwnProperty.call(message, "ifExistTargetObjects")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ifExistTargetObjects); + return writer; + }; + + /** + * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlExportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push(reader.string()); + break; + } + case 2: { + message.schemaOnly = reader.bool(); + break; + } + case 3: { + message.cleanTargetObjects = reader.bool(); + break; + } + case 4: { + message.ifExistTargetObjects = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlExportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) + if (!$util.isString(message.tables[i])) + return "tables: string[] expected"; + } + if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + properties._schemaOnly = 1; + if (typeof message.schemaOnly !== "boolean") + return "schemaOnly: boolean expected"; + } + if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { + properties._cleanTargetObjects = 1; + if (typeof message.cleanTargetObjects !== "boolean") + return "cleanTargetObjects: boolean expected"; + } + if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { + properties._ifExistTargetObjects = 1; + if (typeof message.ifExistTargetObjects !== "boolean") + return "ifExistTargetObjects: boolean expected"; + } + return null; + }; + + /** + * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions + */ + SqlExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions(); + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) + message.tables[i] = String(object.tables[i]); + } + if (object.schemaOnly != null) + message.schemaOnly = Boolean(object.schemaOnly); + if (object.cleanTargetObjects != null) + message.cleanTargetObjects = Boolean(object.cleanTargetObjects); + if (object.ifExistTargetObjects != null) + message.ifExistTargetObjects = Boolean(object.ifExistTargetObjects); + return message; + }; + + /** + * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} message SqlExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tables = []; + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = message.tables[j]; + } + if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + object.schemaOnly = message.schemaOnly; + if (options.oneofs) + object._schemaOnly = "schemaOnly"; + } + if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { + object.cleanTargetObjects = message.cleanTargetObjects; + if (options.oneofs) + object._cleanTargetObjects = "cleanTargetObjects"; + } + if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { + object.ifExistTargetObjects = message.ifExistTargetObjects; + if (options.oneofs) + object._ifExistTargetObjects = "ifExistTargetObjects"; + } + return object; + }; + + /** + * Converts this SqlExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @instance + * @returns {Object.} JSON object + */ + SqlExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlExportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions"; + }; + + return SqlExportOptions; + })(); + + return ExportClusterRequest; + })(); + + v1.ExportClusterResponse = (function() { + + /** + * Properties of an ExportClusterResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IExportClusterResponse + * @property {google.cloud.alloydb.v1.IGcsDestination|null} [gcsDestination] ExportClusterResponse gcsDestination + */ + + /** + * Constructs a new ExportClusterResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ExportClusterResponse. + * @implements IExportClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1.IExportClusterResponse=} [properties] Properties to set + */ + function ExportClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportClusterResponse gcsDestination. + * @member {google.cloud.alloydb.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @instance + */ + ExportClusterResponse.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportClusterResponse destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @instance + */ + Object.defineProperty(ExportClusterResponse.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IExportClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse instance + */ + ExportClusterResponse.create = function create(properties) { + return new ExportClusterResponse(properties); + }; + + /** + * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IExportClusterResponse} message ExportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.alloydb.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IExportClusterResponse} message ExportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.alloydb.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse + */ + ExportClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ExportClusterResponse(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExportClusterResponse.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.ExportClusterResponse} message ExportClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this ExportClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @instance + * @returns {Object.} JSON object + */ + ExportClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExportClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterResponse"; + }; + + return ExportClusterResponse; + })(); + + v1.ImportClusterRequest = (function() { + + /** + * Properties of an ImportClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IImportClusterRequest + * @property {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null} [sqlImportOptions] ImportClusterRequest sqlImportOptions + * @property {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null} [csvImportOptions] ImportClusterRequest csvImportOptions + * @property {string|null} [name] ImportClusterRequest name + * @property {string|null} [gcsUri] ImportClusterRequest gcsUri + * @property {string|null} [database] ImportClusterRequest database + * @property {string|null} [user] ImportClusterRequest user + */ + + /** + * Constructs a new ImportClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ImportClusterRequest. + * @implements IImportClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IImportClusterRequest=} [properties] Properties to set + */ + function ImportClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportClusterRequest sqlImportOptions. + * @member {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null|undefined} sqlImportOptions + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.sqlImportOptions = null; + + /** + * ImportClusterRequest csvImportOptions. + * @member {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null|undefined} csvImportOptions + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.csvImportOptions = null; + + /** + * ImportClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.name = ""; + + /** + * ImportClusterRequest gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.gcsUri = ""; + + /** + * ImportClusterRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.database = ""; + + /** + * ImportClusterRequest user. + * @member {string} user + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.user = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportClusterRequest importOptions. + * @member {"sqlImportOptions"|"csvImportOptions"|undefined} importOptions + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + */ + Object.defineProperty(ImportClusterRequest.prototype, "importOptions", { + get: $util.oneOfGetter($oneOfFields = ["sqlImportOptions", "csvImportOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IImportClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest instance + */ + ImportClusterRequest.create = function create(properties) { + return new ImportClusterRequest(properties); + }; + + /** + * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IImportClusterRequest} message ImportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) + $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.user); + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) + $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IImportClusterRequest} message ImportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.sqlImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.csvImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.database = reader.string(); + break; + } + case 5: { + message.user = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + properties.importOptions = 1; + { + var error = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify(message.sqlImportOptions); + if (error) + return "sqlImportOptions." + error; + } + } + if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + if (properties.importOptions === 1) + return "importOptions: multiple values"; + properties.importOptions = 1; + { + var error = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify(message.csvImportOptions); + if (error) + return "csvImportOptions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + return null; + }; + + /** + * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest + */ + ImportClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ImportClusterRequest(); + if (object.sqlImportOptions != null) { + if (typeof object.sqlImportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1.ImportClusterRequest.sqlImportOptions: object expected"); + message.sqlImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.fromObject(object.sqlImportOptions); + } + if (object.csvImportOptions != null) { + if (typeof object.csvImportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1.ImportClusterRequest.csvImportOptions: object expected"); + message.csvImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.fromObject(object.csvImportOptions); + } + if (object.name != null) + message.name = String(object.name); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.database != null) + message.database = String(object.database); + if (object.user != null) + message.user = String(object.user); + return message; + }; + + /** + * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest} message ImportClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gcsUri = ""; + object.database = ""; + object.user = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + object.sqlImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.toObject(message.sqlImportOptions, options); + if (options.oneofs) + object.importOptions = "sqlImportOptions"; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + object.csvImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.toObject(message.csvImportOptions, options); + if (options.oneofs) + object.importOptions = "csvImportOptions"; + } + return object; + }; + + /** + * Converts this ImportClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @instance + * @returns {Object.} JSON object + */ + ImportClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterRequest"; + }; + + ImportClusterRequest.SqlImportOptions = (function() { + + /** + * Properties of a SqlImportOptions. + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @interface ISqlImportOptions + */ + + /** + * Constructs a new SqlImportOptions. + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @classdesc Represents a SqlImportOptions. + * @implements ISqlImportOptions + * @constructor + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set + */ + function SqlImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SqlImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions instance + */ + SqlImportOptions.create = function create(properties) { + return new SqlImportOptions(properties); + }; + + /** + * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlImportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions + */ + SqlImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions) + return object; + return new $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions(); + }; + + /** + * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} message SqlImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlImportOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SqlImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @instance + * @returns {Object.} JSON object + */ + SqlImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlImportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions"; + }; + + return SqlImportOptions; + })(); + + ImportClusterRequest.CsvImportOptions = (function() { + + /** + * Properties of a CsvImportOptions. + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @interface ICsvImportOptions + * @property {string|null} [table] CsvImportOptions table + * @property {Array.|null} [columns] CsvImportOptions columns + * @property {string|null} [fieldDelimiter] CsvImportOptions fieldDelimiter + * @property {string|null} [quoteCharacter] CsvImportOptions quoteCharacter + * @property {string|null} [escapeCharacter] CsvImportOptions escapeCharacter + */ + + /** + * Constructs a new CsvImportOptions. + * @memberof google.cloud.alloydb.v1.ImportClusterRequest + * @classdesc Represents a CsvImportOptions. + * @implements ICsvImportOptions + * @constructor + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set + */ + function CsvImportOptions(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvImportOptions table. + * @member {string} table + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.table = ""; + + /** + * CsvImportOptions columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.columns = $util.emptyArray; + + /** + * CsvImportOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.fieldDelimiter = ""; + + /** + * CsvImportOptions quoteCharacter. + * @member {string} quoteCharacter + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.quoteCharacter = ""; + + /** + * CsvImportOptions escapeCharacter. + * @member {string} escapeCharacter + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.escapeCharacter = ""; + + /** + * Creates a new CsvImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions instance + */ + CsvImportOptions.create = function create(properties) { + return new CsvImportOptions(properties); + }; + + /** + * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldDelimiter); + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.quoteCharacter); + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.escapeCharacter); + return writer; + }; + + /** + * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 3: { + message.fieldDelimiter = reader.string(); + break; + } + case 4: { + message.quoteCharacter = reader.string(); + break; + } + case 5: { + message.escapeCharacter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvImportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (!$util.isString(message.quoteCharacter)) + return "quoteCharacter: string expected"; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (!$util.isString(message.escapeCharacter)) + return "escapeCharacter: string expected"; + return null; + }; + + /** + * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions + */ + CsvImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions(); + if (object.table != null) + message.table = String(object.table); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.quoteCharacter != null) + message.quoteCharacter = String(object.quoteCharacter); + if (object.escapeCharacter != null) + message.escapeCharacter = String(object.escapeCharacter); + return message; + }; + + /** + * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} message CsvImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.table = ""; + object.fieldDelimiter = ""; + object.quoteCharacter = ""; + object.escapeCharacter = ""; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + object.quoteCharacter = message.quoteCharacter; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + object.escapeCharacter = message.escapeCharacter; + return object; + }; + + /** + * Converts this CsvImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @instance + * @returns {Object.} JSON object + */ + CsvImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvImportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions"; + }; + + return CsvImportOptions; + })(); + + return ImportClusterRequest; + })(); + + v1.ImportClusterResponse = (function() { + + /** + * Properties of an ImportClusterResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IImportClusterResponse + * @property {number|Long|null} [bytesDownloaded] ImportClusterResponse bytesDownloaded + */ + + /** + * Constructs a new ImportClusterResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ImportClusterResponse. + * @implements IImportClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1.IImportClusterResponse=} [properties] Properties to set + */ + function ImportClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportClusterResponse bytesDownloaded. + * @member {number|Long} bytesDownloaded + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @instance + */ + ImportClusterResponse.prototype.bytesDownloaded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IImportClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse instance + */ + ImportClusterResponse.create = function create(properties) { + return new ImportClusterResponse(properties); + }; + + /** + * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IImportClusterResponse} message ImportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesDownloaded != null && Object.hasOwnProperty.call(message, "bytesDownloaded")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bytesDownloaded); + return writer; + }; + + /** + * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IImportClusterResponse} message ImportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesDownloaded = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) + if (!$util.isInteger(message.bytesDownloaded) && !(message.bytesDownloaded && $util.isInteger(message.bytesDownloaded.low) && $util.isInteger(message.bytesDownloaded.high))) + return "bytesDownloaded: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse + */ + ImportClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ImportClusterResponse(); + if (object.bytesDownloaded != null) + if ($util.Long) + (message.bytesDownloaded = $util.Long.fromValue(object.bytesDownloaded)).unsigned = false; + else if (typeof object.bytesDownloaded === "string") + message.bytesDownloaded = parseInt(object.bytesDownloaded, 10); + else if (typeof object.bytesDownloaded === "number") + message.bytesDownloaded = object.bytesDownloaded; + else if (typeof object.bytesDownloaded === "object") + message.bytesDownloaded = new $util.LongBits(object.bytesDownloaded.low >>> 0, object.bytesDownloaded.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1.ImportClusterResponse} message ImportClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDownloaded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDownloaded = options.longs === String ? "0" : 0; + if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) + if (typeof message.bytesDownloaded === "number") + object.bytesDownloaded = options.longs === String ? String(message.bytesDownloaded) : message.bytesDownloaded; + else + object.bytesDownloaded = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDownloaded) : options.longs === Number ? new $util.LongBits(message.bytesDownloaded.low >>> 0, message.bytesDownloaded.high >>> 0).toNumber() : message.bytesDownloaded; + return object; + }; + + /** + * Converts this ImportClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @instance + * @returns {Object.} JSON object + */ + ImportClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ImportClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterResponse"; + }; + + return ImportClusterResponse; + })(); + + v1.UpgradeClusterRequest = (function() { + + /** + * Properties of an UpgradeClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpgradeClusterRequest + * @property {string|null} [name] UpgradeClusterRequest name + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [version] UpgradeClusterRequest version + * @property {string|null} [requestId] UpgradeClusterRequest requestId + * @property {boolean|null} [validateOnly] UpgradeClusterRequest validateOnly + * @property {string|null} [etag] UpgradeClusterRequest etag + */ + + /** + * Constructs a new UpgradeClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpgradeClusterRequest. + * @implements IUpgradeClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest=} [properties] Properties to set + */ + function UpgradeClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.name = ""; + + /** + * UpgradeClusterRequest version. + * @member {google.cloud.alloydb.v1.DatabaseVersion} version + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.version = 0; + + /** + * UpgradeClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.requestId = ""; + + /** + * UpgradeClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.validateOnly = false; + + /** + * UpgradeClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.etag = ""; + + /** + * Creates a new UpgradeClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest instance + */ + UpgradeClusterRequest.create = function create(properties) { + return new UpgradeClusterRequest(properties); + }; + + /** + * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.int32(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest + */ + UpgradeClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.version) { + default: + if (typeof object.version === "number") { + message.version = object.version; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.version = 0; + break; + case "POSTGRES_13": + case 1: + message.version = 1; + break; + case "POSTGRES_14": + case 2: + message.version = 2; + break; + case "POSTGRES_15": + case 3: + message.version = 3; + break; + case "POSTGRES_16": + case 4: + message.version = 4; + break; + case "POSTGRES_17": + case 5: + message.version = 5; + break; + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterRequest} message UpgradeClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.version] === undefined ? message.version : $root.google.cloud.alloydb.v1.DatabaseVersion[message.version] : message.version; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this UpgradeClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterRequest"; + }; + + return UpgradeClusterRequest; + })(); + + v1.UpgradeClusterResponse = (function() { + + /** + * Properties of an UpgradeClusterResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IUpgradeClusterResponse + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [status] UpgradeClusterResponse status + * @property {string|null} [message] UpgradeClusterResponse message + * @property {Array.|null} [clusterUpgradeDetails] UpgradeClusterResponse clusterUpgradeDetails + */ + + /** + * Constructs a new UpgradeClusterResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpgradeClusterResponse. + * @implements IUpgradeClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse=} [properties] Properties to set + */ + function UpgradeClusterResponse(properties) { + this.clusterUpgradeDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterResponse status. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} status + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.status = 0; + + /** + * UpgradeClusterResponse message. + * @member {string} message + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.message = ""; + + /** + * UpgradeClusterResponse clusterUpgradeDetails. + * @member {Array.} clusterUpgradeDetails + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.clusterUpgradeDetails = $util.emptyArray; + + /** + * Creates a new UpgradeClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse instance + */ + UpgradeClusterResponse.create = function create(properties) { + return new UpgradeClusterResponse(properties); + }; + + /** + * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.clusterUpgradeDetails != null && message.clusterUpgradeDetails.length) + for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) + $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.encode(message.clusterUpgradeDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.clusterUpgradeDetails && message.clusterUpgradeDetails.length)) + message.clusterUpgradeDetails = []; + message.clusterUpgradeDetails.push($root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.clusterUpgradeDetails != null && message.hasOwnProperty("clusterUpgradeDetails")) { + if (!Array.isArray(message.clusterUpgradeDetails)) + return "clusterUpgradeDetails: array expected"; + for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify(message.clusterUpgradeDetails[i]); + if (error) + return "clusterUpgradeDetails." + error; + } + } + return null; + }; + + /** + * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse + */ + UpgradeClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse(); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 4: + message.status = 4; + break; + case "IN_PROGRESS": + case 5: + message.status = 5; + break; + case "SUCCESS": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.status = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.clusterUpgradeDetails) { + if (!Array.isArray(object.clusterUpgradeDetails)) + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.clusterUpgradeDetails: array expected"); + message.clusterUpgradeDetails = []; + for (var i = 0; i < object.clusterUpgradeDetails.length; ++i) { + if (typeof object.clusterUpgradeDetails[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.clusterUpgradeDetails: object expected"); + message.clusterUpgradeDetails[i] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.fromObject(object.clusterUpgradeDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse} message UpgradeClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clusterUpgradeDetails = []; + if (options.defaults) { + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] : message.status; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.clusterUpgradeDetails && message.clusterUpgradeDetails.length) { + object.clusterUpgradeDetails = []; + for (var j = 0; j < message.clusterUpgradeDetails.length; ++j) + object.clusterUpgradeDetails[j] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.toObject(message.clusterUpgradeDetails[j], options); + } + return object; + }; + + /** + * Converts this UpgradeClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse"; + }; + + UpgradeClusterResponse.StageInfo = (function() { + + /** + * Properties of a StageInfo. + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @interface IStageInfo + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null} [stage] StageInfo stage + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [status] StageInfo status + * @property {string|null} [logsUrl] StageInfo logsUrl + */ + + /** + * Constructs a new StageInfo. + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @classdesc Represents a StageInfo. + * @implements IStageInfo + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set + */ + function StageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageInfo stage. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage} stage + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.stage = 0; + + /** + * StageInfo status. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} status + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.status = 0; + + /** + * StageInfo logsUrl. + * @member {string} logsUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.logsUrl = ""; + + /** + * Creates a new StageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo instance + */ + StageInfo.create = function create(properties) { + return new StageInfo(properties); + }; + + /** + * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); + if (message.logsUrl != null && Object.hasOwnProperty.call(message, "logsUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.logsUrl); + return writer; + }; + + /** + * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stage = reader.int32(); + break; + } + case 2: { + message.status = reader.int32(); + break; + } + case 3: { + message.logsUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stage != null && message.hasOwnProperty("stage")) + switch (message.stage) { + default: + return "stage: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) + if (!$util.isString(message.logsUrl)) + return "logsUrl: string expected"; + return null; + }; + + /** + * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo + */ + StageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo(); + switch (object.stage) { + default: + if (typeof object.stage === "number") { + message.stage = object.stage; + break; + } + break; + case "STAGE_UNSPECIFIED": + case 0: + message.stage = 0; + break; + case "ALLOYDB_PRECHECK": + case 1: + message.stage = 1; + break; + case "PG_UPGRADE_CHECK": + case 2: + message.stage = 2; + break; + case "PREPARE_FOR_UPGRADE": + case 5: + message.stage = 5; + break; + case "PRIMARY_INSTANCE_UPGRADE": + case 3: + message.stage = 3; + break; + case "READ_POOL_INSTANCES_UPGRADE": + case 4: + message.stage = 4; + break; + case "ROLLBACK": + case 6: + message.stage = 6; + break; + case "CLEANUP": + case 7: + message.stage = 7; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 4: + message.status = 4; + break; + case "IN_PROGRESS": + case 5: + message.status = 5; + break; + case "SUCCESS": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.status = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + } + if (object.logsUrl != null) + message.logsUrl = String(object.logsUrl); + return message; + }; + + /** + * Creates a plain object from a StageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} message StageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.logsUrl = ""; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] : message.stage; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] : message.status; + if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) + object.logsUrl = message.logsUrl; + return object; + }; + + /** + * Converts this StageInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @instance + * @returns {Object.} JSON object + */ + StageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo"; + }; + + return StageInfo; + })(); + + UpgradeClusterResponse.InstanceUpgradeDetails = (function() { + + /** + * Properties of an InstanceUpgradeDetails. + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @interface IInstanceUpgradeDetails + * @property {string|null} [name] InstanceUpgradeDetails name + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [upgradeStatus] InstanceUpgradeDetails upgradeStatus + * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [instanceType] InstanceUpgradeDetails instanceType + */ + + /** + * Constructs a new InstanceUpgradeDetails. + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @classdesc Represents an InstanceUpgradeDetails. + * @implements IInstanceUpgradeDetails + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set + */ + function InstanceUpgradeDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceUpgradeDetails name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.name = ""; + + /** + * InstanceUpgradeDetails upgradeStatus. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} upgradeStatus + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.upgradeStatus = 0; + + /** + * InstanceUpgradeDetails instanceType. + * @member {google.cloud.alloydb.v1.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.instanceType = 0; + + /** + * Creates a new InstanceUpgradeDetails instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails instance + */ + InstanceUpgradeDetails.create = function create(properties) { + return new InstanceUpgradeDetails(properties); + }; + + /** + * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceUpgradeDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.instanceType); + return writer; + }; + + /** + * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceUpgradeDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.upgradeStatus = reader.int32(); + break; + } + case 3: { + message.instanceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceUpgradeDetails message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceUpgradeDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + switch (message.upgradeStatus) { + default: + return "upgradeStatus: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + */ + InstanceUpgradeDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails(); + if (object.name != null) + message.name = String(object.name); + switch (object.upgradeStatus) { + default: + if (typeof object.upgradeStatus === "number") { + message.upgradeStatus = object.upgradeStatus; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.upgradeStatus = 0; + break; + case "NOT_STARTED": + case 4: + message.upgradeStatus = 4; + break; + case "IN_PROGRESS": + case 5: + message.upgradeStatus = 5; + break; + case "SUCCESS": + case 1: + message.upgradeStatus = 1; + break; + case "FAILED": + case 2: + message.upgradeStatus = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.upgradeStatus = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.upgradeStatus = 6; + break; + case "CANCELLED": + case 7: + message.upgradeStatus = 7; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} message InstanceUpgradeDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceUpgradeDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] : message.instanceType; + return object; + }; + + /** + * Converts this InstanceUpgradeDetails to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + * @returns {Object.} JSON object + */ + InstanceUpgradeDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceUpgradeDetails + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails"; + }; + + return InstanceUpgradeDetails; + })(); + + UpgradeClusterResponse.ClusterUpgradeDetails = (function() { + + /** + * Properties of a ClusterUpgradeDetails. + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @interface IClusterUpgradeDetails + * @property {string|null} [name] ClusterUpgradeDetails name + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [upgradeStatus] ClusterUpgradeDetails upgradeStatus + * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] ClusterUpgradeDetails clusterType + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] ClusterUpgradeDetails databaseVersion + * @property {Array.|null} [stageInfo] ClusterUpgradeDetails stageInfo + * @property {Array.|null} [instanceUpgradeDetails] ClusterUpgradeDetails instanceUpgradeDetails + */ + + /** + * Constructs a new ClusterUpgradeDetails. + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse + * @classdesc Represents a ClusterUpgradeDetails. + * @implements IClusterUpgradeDetails + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set + */ + function ClusterUpgradeDetails(properties) { + this.stageInfo = []; + this.instanceUpgradeDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterUpgradeDetails name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.name = ""; + + /** + * ClusterUpgradeDetails upgradeStatus. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} upgradeStatus + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.upgradeStatus = 0; + + /** + * ClusterUpgradeDetails clusterType. + * @member {google.cloud.alloydb.v1.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.clusterType = 0; + + /** + * ClusterUpgradeDetails databaseVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.databaseVersion = 0; + + /** + * ClusterUpgradeDetails stageInfo. + * @member {Array.} stageInfo + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.stageInfo = $util.emptyArray; + + /** + * ClusterUpgradeDetails instanceUpgradeDetails. + * @member {Array.} instanceUpgradeDetails + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.instanceUpgradeDetails = $util.emptyArray; + + /** + * Creates a new ClusterUpgradeDetails instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails instance + */ + ClusterUpgradeDetails.create = function create(properties) { + return new ClusterUpgradeDetails(properties); + }; + + /** + * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUpgradeDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.clusterType); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.databaseVersion); + if (message.stageInfo != null && message.stageInfo.length) + for (var i = 0; i < message.stageInfo.length; ++i) + $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.encode(message.stageInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.instanceUpgradeDetails != null && message.instanceUpgradeDetails.length) + for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) + $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.encode(message.instanceUpgradeDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUpgradeDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.upgradeStatus = reader.int32(); + break; + } + case 3: { + message.clusterType = reader.int32(); + break; + } + case 4: { + message.databaseVersion = reader.int32(); + break; + } + case 5: { + if (!(message.stageInfo && message.stageInfo.length)) + message.stageInfo = []; + message.stageInfo.push($root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.instanceUpgradeDetails && message.instanceUpgradeDetails.length)) + message.instanceUpgradeDetails = []; + message.instanceUpgradeDetails.push($root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterUpgradeDetails message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterUpgradeDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + switch (message.upgradeStatus) { + default: + return "upgradeStatus: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stageInfo != null && message.hasOwnProperty("stageInfo")) { + if (!Array.isArray(message.stageInfo)) + return "stageInfo: array expected"; + for (var i = 0; i < message.stageInfo.length; ++i) { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify(message.stageInfo[i]); + if (error) + return "stageInfo." + error; + } + } + if (message.instanceUpgradeDetails != null && message.hasOwnProperty("instanceUpgradeDetails")) { + if (!Array.isArray(message.instanceUpgradeDetails)) + return "instanceUpgradeDetails: array expected"; + for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify(message.instanceUpgradeDetails[i]); + if (error) + return "instanceUpgradeDetails." + error; + } + } + return null; + }; + + /** + * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + */ + ClusterUpgradeDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails(); + if (object.name != null) + message.name = String(object.name); + switch (object.upgradeStatus) { + default: + if (typeof object.upgradeStatus === "number") { + message.upgradeStatus = object.upgradeStatus; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.upgradeStatus = 0; + break; + case "NOT_STARTED": + case 4: + message.upgradeStatus = 4; + break; + case "IN_PROGRESS": + case 5: + message.upgradeStatus = 5; + break; + case "SUCCESS": + case 1: + message.upgradeStatus = 1; + break; + case "FAILED": + case 2: + message.upgradeStatus = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.upgradeStatus = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.upgradeStatus = 6; + break; + case "CANCELLED": + case 7: + message.upgradeStatus = 7; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + } + if (object.stageInfo) { + if (!Array.isArray(object.stageInfo)) + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: array expected"); + message.stageInfo = []; + for (var i = 0; i < object.stageInfo.length; ++i) { + if (typeof object.stageInfo[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: object expected"); + message.stageInfo[i] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.fromObject(object.stageInfo[i]); + } + } + if (object.instanceUpgradeDetails) { + if (!Array.isArray(object.instanceUpgradeDetails)) + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: array expected"); + message.instanceUpgradeDetails = []; + for (var i = 0; i < object.instanceUpgradeDetails.length; ++i) { + if (typeof object.instanceUpgradeDetails[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: object expected"); + message.instanceUpgradeDetails[i] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.fromObject(object.instanceUpgradeDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} message ClusterUpgradeDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterUpgradeDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.stageInfo = []; + object.instanceUpgradeDetails = []; + } + if (options.defaults) { + object.name = ""; + object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.stageInfo && message.stageInfo.length) { + object.stageInfo = []; + for (var j = 0; j < message.stageInfo.length; ++j) + object.stageInfo[j] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.toObject(message.stageInfo[j], options); + } + if (message.instanceUpgradeDetails && message.instanceUpgradeDetails.length) { + object.instanceUpgradeDetails = []; + for (var j = 0; j < message.instanceUpgradeDetails.length; ++j) + object.instanceUpgradeDetails[j] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.toObject(message.instanceUpgradeDetails[j], options); + } + return object; + }; + + /** + * Converts this ClusterUpgradeDetails to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + * @returns {Object.} JSON object + */ + ClusterUpgradeDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterUpgradeDetails + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails"; + }; + + return ClusterUpgradeDetails; + })(); + + /** + * Status enum. + * @name google.cloud.alloydb.v1.UpgradeClusterResponse.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} NOT_STARTED=4 NOT_STARTED value + * @property {number} IN_PROGRESS=5 IN_PROGRESS value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} FAILED=2 FAILED value + * @property {number} PARTIAL_SUCCESS=3 PARTIAL_SUCCESS value + * @property {number} CANCEL_IN_PROGRESS=6 CANCEL_IN_PROGRESS value + * @property {number} CANCELLED=7 CANCELLED value + */ + UpgradeClusterResponse.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[4] = "NOT_STARTED"] = 4; + values[valuesById[5] = "IN_PROGRESS"] = 5; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "PARTIAL_SUCCESS"] = 3; + values[valuesById[6] = "CANCEL_IN_PROGRESS"] = 6; + values[valuesById[7] = "CANCELLED"] = 7; + return values; + })(); + + /** + * Stage enum. + * @name google.cloud.alloydb.v1.UpgradeClusterResponse.Stage + * @enum {number} + * @property {number} STAGE_UNSPECIFIED=0 STAGE_UNSPECIFIED value + * @property {number} ALLOYDB_PRECHECK=1 ALLOYDB_PRECHECK value + * @property {number} PG_UPGRADE_CHECK=2 PG_UPGRADE_CHECK value + * @property {number} PREPARE_FOR_UPGRADE=5 PREPARE_FOR_UPGRADE value + * @property {number} PRIMARY_INSTANCE_UPGRADE=3 PRIMARY_INSTANCE_UPGRADE value + * @property {number} READ_POOL_INSTANCES_UPGRADE=4 READ_POOL_INSTANCES_UPGRADE value + * @property {number} ROLLBACK=6 ROLLBACK value + * @property {number} CLEANUP=7 CLEANUP value + */ + UpgradeClusterResponse.Stage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_PRECHECK"] = 1; + values[valuesById[2] = "PG_UPGRADE_CHECK"] = 2; + values[valuesById[5] = "PREPARE_FOR_UPGRADE"] = 5; + values[valuesById[3] = "PRIMARY_INSTANCE_UPGRADE"] = 3; + values[valuesById[4] = "READ_POOL_INSTANCES_UPGRADE"] = 4; + values[valuesById[6] = "ROLLBACK"] = 6; + values[valuesById[7] = "CLEANUP"] = 7; + return values; + })(); + + return UpgradeClusterResponse; + })(); + + v1.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + * @property {string|null} [etag] DeleteClusterRequest etag + * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly + * @property {boolean|null} [force] DeleteClusterRequest force + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * DeleteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.etag = ""; + + /** + * DeleteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.validateOnly = false; + + /** + * DeleteClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.force = false; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1.SwitchoverClusterRequest = (function() { + + /** + * Properties of a SwitchoverClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ISwitchoverClusterRequest + * @property {string|null} [name] SwitchoverClusterRequest name + * @property {string|null} [requestId] SwitchoverClusterRequest requestId + * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly + */ + + /** + * Constructs a new SwitchoverClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SwitchoverClusterRequest. + * @implements ISwitchoverClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest=} [properties] Properties to set + */ + function SwitchoverClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SwitchoverClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.name = ""; + + /** + * SwitchoverClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.requestId = ""; + + /** + * SwitchoverClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new SwitchoverClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest instance + */ + SwitchoverClusterRequest.create = function create(properties) { + return new SwitchoverClusterRequest(properties); + }; + + /** + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchoverClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchoverClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SwitchoverClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SwitchoverClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SwitchoverClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest + */ + SwitchoverClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SwitchoverClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.SwitchoverClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1.SwitchoverClusterRequest} message SwitchoverClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwitchoverClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this SwitchoverClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @instance + * @returns {Object.} JSON object + */ + SwitchoverClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SwitchoverClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SwitchoverClusterRequest"; + }; + + return SwitchoverClusterRequest; + })(); + + v1.PromoteClusterRequest = (function() { + + /** + * Properties of a PromoteClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IPromoteClusterRequest + * @property {string|null} [name] PromoteClusterRequest name + * @property {string|null} [requestId] PromoteClusterRequest requestId + * @property {string|null} [etag] PromoteClusterRequest etag + * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly + */ + + /** + * Constructs a new PromoteClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set + */ + function PromoteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromoteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.name = ""; + + /** + * PromoteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.requestId = ""; + + /** + * PromoteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.etag = ""; + + /** + * PromoteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest instance + */ + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); + }; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.PromoteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromoteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromoteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest + */ + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.PromoteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.PromoteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1.PromoteClusterRequest} message PromoteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromoteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PromoteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromoteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.PromoteClusterRequest"; + }; + + return PromoteClusterRequest; + })(); + + v1.RestoreClusterRequest = (function() { + + /** + * Properties of a RestoreClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IRestoreClusterRequest + * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource + * @property {google.cloud.alloydb.v1.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource + * @property {string|null} [parent] RestoreClusterRequest parent + * @property {string|null} [clusterId] RestoreClusterRequest clusterId + * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] RestoreClusterRequest cluster + * @property {string|null} [requestId] RestoreClusterRequest requestId + * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly + */ + + /** + * Constructs a new RestoreClusterRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set + */ + function RestoreClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.backupSource = null; + + /** + * RestoreClusterRequest continuousBackupSource. + * @member {google.cloud.alloydb.v1.IContinuousBackupSource|null|undefined} continuousBackupSource + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.continuousBackupSource = null; + + /** + * RestoreClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.parent = ""; + + /** + * RestoreClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.clusterId = ""; + + /** + * RestoreClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.cluster = null; + + /** + * RestoreClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.requestId = ""; + + /** + * RestoreClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + */ + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest instance + */ + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); + }; + + /** + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) + $root.google.cloud.alloydb.v1.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1.ContinuousBackupSource.verify(message.continuousBackupSource); + if (error) + return "continuousBackupSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest + */ + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestoreClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); + } + if (object.continuousBackupSource != null) { + if (typeof object.continuousBackupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.continuousBackupSource: object expected"); + message.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.fromObject(object.continuousBackupSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1.RestoreClusterRequest} message RestoreClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + object.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.toObject(message.continuousBackupSource, options); + if (options.oneofs) + object.source = "continuousBackupSource"; + } + return object; + }; + + /** + * Converts this RestoreClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreClusterRequest"; + }; + + return RestoreClusterRequest; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1.InstanceView|null} [view] GetInstanceRequest view + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1.InstanceView} view + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.view = 0; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INSTANCE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "INSTANCE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "INSTANCE_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.InstanceView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.requestId = ""; + + /** + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.CreateSecondaryInstanceRequest = (function() { + + /** + * Properties of a CreateSecondaryInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateSecondaryInstanceRequest + * @property {string|null} [parent] CreateSecondaryInstanceRequest parent + * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId + * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateSecondaryInstanceRequest instance + * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set + */ + function CreateSecondaryInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecondaryInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.parent = ""; + + /** + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.instanceId = ""; + + /** + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.instance = null; + + /** + * CreateSecondaryInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.requestId = ""; + + /** + * CreateSecondaryInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance + */ + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecondaryInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + */ + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryInstanceRequest"; + }; + + return CreateSecondaryInstanceRequest; + })(); + + v1.CreateInstanceRequests = (function() { + + /** + * Properties of a CreateInstanceRequests. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + */ + + /** + * Constructs a new CreateInstanceRequests. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests + * @constructor + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set + */ + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @instance + */ + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + + /** + * Creates a new CreateInstanceRequests instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests instance + */ + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); + }; + + /** + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequests.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createInstanceRequests != null && message.createInstanceRequests.length) + for (var i = 0; i < message.createInstanceRequests.length; ++i) + $root.google.cloud.alloydb.v1.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequests.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1.CreateInstanceRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequests message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequests.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { + if (!Array.isArray(message.createInstanceRequests)) + return "createInstanceRequests: array expected"; + for (var i = 0; i < message.createInstanceRequests.length; ++i) { + var error = $root.google.cloud.alloydb.v1.CreateInstanceRequest.verify(message.createInstanceRequests[i]); + if (error) + return "createInstanceRequests." + error; + } + } + return null; + }; + + /** + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + */ + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequests) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); + if (object.createInstanceRequests) { + if (!Array.isArray(object.createInstanceRequests)) + throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: array expected"); + message.createInstanceRequests = []; + for (var i = 0; i < object.createInstanceRequests.length; ++i) { + if (typeof object.createInstanceRequests[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: object expected"); + message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1.CreateInstanceRequests} message CreateInstanceRequests + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequests.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.createInstanceRequests = []; + if (message.createInstanceRequests && message.createInstanceRequests.length) { + object.createInstanceRequests = []; + for (var j = 0; j < message.createInstanceRequests.length; ++j) + object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); + } + return object; + }; + + /** + * Converts this CreateInstanceRequests to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequests.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequests + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequests"; + }; + + return CreateInstanceRequests; + })(); + + v1.BatchCreateInstancesRequest = (function() { + + /** + * Properties of a BatchCreateInstancesRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IBatchCreateInstancesRequest + * @property {string|null} [parent] BatchCreateInstancesRequest parent + * @property {google.cloud.alloydb.v1.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests + * @property {string|null} [requestId] BatchCreateInstancesRequest requestId + */ + + /** + * Constructs a new BatchCreateInstancesRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest + * @constructor + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set + */ + function BatchCreateInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.parent = ""; + + /** + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requests = null; + + /** + * BatchCreateInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requestId = ""; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + */ + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.alloydb.v1.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1.CreateInstanceRequests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + */ + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesRequest.requests: object expected"); + message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.fromObject(object.requests); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requests = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.toObject(message.requests, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this BatchCreateInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesRequest"; + }; + + return BatchCreateInstancesRequest; + })(); + + v1.BatchCreateInstancesResponse = (function() { + + /** + * Properties of a BatchCreateInstancesResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + */ + + /** + * Constructs a new BatchCreateInstancesResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse + * @constructor + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set + */ + function BatchCreateInstancesResponse(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @instance + */ + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + */ + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + */ + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesResponse"; + }; + + return BatchCreateInstancesResponse; + })(); + + v1.BatchCreateInstancesMetadata = (function() { + + /** + * Properties of a BatchCreateInstancesMetadata. + * @memberof google.cloud.alloydb.v1 + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + */ + + /** + * Constructs a new BatchCreateInstancesMetadata. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata + * @constructor + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set + */ + function BatchCreateInstancesMetadata(properties) { + this.instanceTargets = []; + this.instanceStatuses = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @instance + */ + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + + /** + * BatchCreateInstancesMetadata instanceStatuses. + * @member {Object.} instanceStatuses + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @instance + */ + BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + + /** + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + */ + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTargets != null && message.instanceTargets.length) + for (var i = 0; i < message.instanceTargets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); + if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) + for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instanceTargets && message.instanceTargets.length)) + message.instanceTargets = []; + message.instanceTargets.push(reader.string()); + break; + } + case 2: { + if (message.instanceStatuses === $util.emptyObject) + message.instanceStatuses = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.instanceStatuses[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { + if (!Array.isArray(message.instanceTargets)) + return "instanceTargets: array expected"; + for (var i = 0; i < message.instanceTargets.length; ++i) + if (!$util.isString(message.instanceTargets[i])) + return "instanceTargets: string[] expected"; + } + if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { + if (!$util.isObject(message.instanceStatuses)) + return "instanceStatuses: object expected"; + var key = Object.keys(message.instanceStatuses); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); + if (error) + return "instanceStatuses." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + */ + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(); + if (object.instanceTargets) { + if (!Array.isArray(object.instanceTargets)) + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceTargets: array expected"); + message.instanceTargets = []; + for (var i = 0; i < object.instanceTargets.length; ++i) + message.instanceTargets[i] = String(object.instanceTargets[i]); + } + if (object.instanceStatuses) { + if (typeof object.instanceStatuses !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses = {}; + for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { + if (typeof object.instanceStatuses[keys[i]] !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceTargets = []; + if (options.objects || options.defaults) + object.instanceStatuses = {}; + if (message.instanceTargets && message.instanceTargets.length) { + object.instanceTargets = []; + for (var j = 0; j < message.instanceTargets.length; ++j) + object.instanceTargets[j] = message.instanceTargets[j]; + } + var keys2; + if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { + object.instanceStatuses = {}; + for (var j = 0; j < keys2.length; ++j) + object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); + } + return object; + }; + + /** + * Converts this BatchCreateInstancesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesMetadata"; + }; + + return BatchCreateInstancesMetadata; + })(); + + v1.BatchCreateInstanceStatus = (function() { + + /** + * Properties of a BatchCreateInstanceStatus. + * @memberof google.cloud.alloydb.v1 + * @interface IBatchCreateInstanceStatus + * @property {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state + * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg + * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error + * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type + */ + + /** + * Constructs a new BatchCreateInstanceStatus. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus + * @constructor + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set + */ + function BatchCreateInstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.state = 0; + + /** + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.errorMsg = ""; + + /** + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.error = null; + + /** + * BatchCreateInstanceStatus type. + * @member {google.cloud.alloydb.v1.Instance.InstanceType} type + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.type = 0; + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + */ + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); + }; + + /** + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstanceStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.errorMsg = reader.string(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstanceStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + if (!$util.isString(message.errorMsg)) + return "errorMsg: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + */ + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus) + return object; + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING_CREATE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ROLLED_BACK": + case 6: + message.state = 6; + break; + } + if (object.errorMsg != null) + message.errorMsg = String(object.errorMsg); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstanceStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "READ_POOL": + case 2: + message.type = 2; + break; + case "SECONDARY": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] : message.state; + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + object.errorMsg = message.errorMsg; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] : message.type; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstanceStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstanceStatus"; + }; + + /** + * State enum. + * @name google.cloud.alloydb.v1.BatchCreateInstanceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING_CREATE=1 PENDING_CREATE value + * @property {number} READY=2 READY value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED=5 FAILED value + * @property {number} ROLLED_BACK=6 ROLLED_BACK value + */ + BatchCreateInstanceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_CREATE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ROLLED_BACK"] = 6; + return values; + })(); + + return BatchCreateInstanceStatus; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.alloydb.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.requestId = ""; + + /** + * UpdateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.validateOnly = false; + + /** + * UpdateInstanceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [etag] DeleteInstanceRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.requestId = ""; + + /** + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.FailoverInstanceRequest = (function() { + + /** + * Properties of a FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly + */ + + /** + * Constructs a new FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set + */ + function FailoverInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.name = ""; + + /** + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.requestId = ""; + + /** + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest instance + */ + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); + }; + + /** + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailoverInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailoverInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FailoverInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FailoverInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + */ + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.FailoverInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FailoverInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this FailoverInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + FailoverInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FailoverInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.FailoverInstanceRequest"; + }; + + return FailoverInstanceRequest; + })(); + + v1.InjectFaultRequest = (function() { + + /** + * Properties of an InjectFaultRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IInjectFaultRequest + * @property {google.cloud.alloydb.v1.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType + * @property {string|null} [name] InjectFaultRequest name + * @property {string|null} [requestId] InjectFaultRequest requestId + * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly + */ + + /** + * Constructs a new InjectFaultRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest + * @constructor + * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set + */ + function InjectFaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.faultType = 0; + + /** + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.name = ""; + + /** + * InjectFaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.requestId = ""; + + /** + * InjectFaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.validateOnly = false; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest instance + */ + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); + }; + + /** + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectFaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectFaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.InjectFaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.faultType = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InjectFaultRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InjectFaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faultType != null && message.hasOwnProperty("faultType")) + switch (message.faultType) { + default: + return "faultType: enum value expected"; + case 0: + case 1: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest + */ + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.InjectFaultRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.InjectFaultRequest(); + switch (object.faultType) { + default: + if (typeof object.faultType === "number") { + message.faultType = object.faultType; + break; + } + break; + case "FAULT_TYPE_UNSPECIFIED": + case 0: + message.faultType = 0; + break; + case "STOP_VM": + case 1: + message.faultType = 1; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1.InjectFaultRequest} message InjectFaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InjectFaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.faultType != null && message.hasOwnProperty("faultType")) + object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1.InjectFaultRequest.FaultType[message.faultType] : message.faultType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this InjectFaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @instance + * @returns {Object.} JSON object + */ + InjectFaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InjectFaultRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.InjectFaultRequest"; + }; + + /** + * FaultType enum. + * @name google.cloud.alloydb.v1.InjectFaultRequest.FaultType + * @enum {number} + * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value + * @property {number} STOP_VM=1 STOP_VM value + */ + InjectFaultRequest.FaultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP_VM"] = 1; + return values; + })(); + + return InjectFaultRequest; + })(); + + v1.RestartInstanceRequest = (function() { + + /** + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + * @property {string|null} [requestId] RestartInstanceRequest requestId + * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly + * @property {Array.|null} [nodeIds] RestartInstanceRequest nodeIds + */ + + /** + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set + */ + function RestartInstanceRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.name = ""; + + /** + * RestartInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.requestId = ""; + + /** + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.validateOnly = false; + + /** + * RestartInstanceRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest instance + */ + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); + }; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeIds[i]); + return writer; + }; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + */ + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestartInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.alloydb.v1.RestartInstanceRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1.RestartInstanceRequest} message RestartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + return object; + }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestartInstanceRequest"; + }; + + return RestartInstanceRequest; + })(); + + v1.ExecuteSqlRequest = (function() { + + /** + * Properties of an ExecuteSqlRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IExecuteSqlRequest + * @property {string|null} [password] ExecuteSqlRequest password + * @property {string|null} [instance] ExecuteSqlRequest instance + * @property {string|null} [database] ExecuteSqlRequest database + * @property {string|null} [user] ExecuteSqlRequest user + * @property {string|null} [sqlStatement] ExecuteSqlRequest sqlStatement + * @property {boolean|null} [validateOnly] ExecuteSqlRequest validateOnly + */ + + /** + * Constructs a new ExecuteSqlRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest + * @constructor + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest=} [properties] Properties to set + */ + function ExecuteSqlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlRequest password. + * @member {string|null|undefined} password + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.password = null; + + /** + * ExecuteSqlRequest instance. + * @member {string} instance + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.instance = ""; + + /** + * ExecuteSqlRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.database = ""; + + /** + * ExecuteSqlRequest user. + * @member {string} user + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.user = ""; + + /** + * ExecuteSqlRequest sqlStatement. + * @member {string} sqlStatement + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.sqlStatement = ""; + + /** + * ExecuteSqlRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteSqlRequest userCredential. + * @member {"password"|undefined} userCredential + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + */ + Object.defineProperty(ExecuteSqlRequest.prototype, "userCredential", { + get: $util.oneOfGetter($oneOfFields = ["password"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest instance + */ + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); + }; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlStatement); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.password); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExecuteSqlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.password = reader.string(); + break; + } + case 1: { + message.instance = reader.string(); + break; + } + case 2: { + message.database = reader.string(); + break; + } + case 3: { + message.user = reader.string(); + break; + } + case 4: { + message.sqlStatement = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.password != null && message.hasOwnProperty("password")) { + properties.userCredential = 1; + if (!$util.isString(message.password)) + return "password: string expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (!$util.isString(message.sqlStatement)) + return "sqlStatement: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest + */ + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ExecuteSqlRequest(); + if (object.password != null) + message.password = String(object.password); + if (object.instance != null) + message.instance = String(object.instance); + if (object.database != null) + message.database = String(object.database); + if (object.user != null) + message.user = String(object.user); + if (object.sqlStatement != null) + message.sqlStatement = String(object.sqlStatement); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = ""; + object.database = ""; + object.user = ""; + object.sqlStatement = ""; + object.validateOnly = false; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + object.sqlStatement = message.sqlStatement; + if (message.password != null && message.hasOwnProperty("password")) { + object.password = message.password; + if (options.oneofs) + object.userCredential = "password"; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlRequest"; + }; + + return ExecuteSqlRequest; + })(); + + v1.ExecuteSqlResponse = (function() { + + /** + * Properties of an ExecuteSqlResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IExecuteSqlResponse + * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults + * @property {google.cloud.alloydb.v1.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata + */ + + /** + * Constructs a new ExecuteSqlResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ExecuteSqlResponse. + * @implements IExecuteSqlResponse + * @constructor + * @param {google.cloud.alloydb.v1.IExecuteSqlResponse=} [properties] Properties to set + */ + function ExecuteSqlResponse(properties) { + this.sqlResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlResponse sqlResults. + * @member {Array.} sqlResults + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @instance + */ + ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; + + /** + * ExecuteSqlResponse metadata. + * @member {google.cloud.alloydb.v1.IExecuteSqlMetadata|null|undefined} metadata + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @instance + */ + ExecuteSqlResponse.prototype.metadata = null; + + /** + * Creates a new ExecuteSqlResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse instance + */ + ExecuteSqlResponse.create = function create(properties) { + return new ExecuteSqlResponse(properties); + }; + + /** + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sqlResults != null && message.sqlResults.length) + for (var i = 0; i < message.sqlResults.length; ++i) + $root.google.cloud.alloydb.v1.SqlResult.encode(message.sqlResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExecuteSqlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sqlResults && message.sqlResults.length)) + message.sqlResults = []; + message.sqlResults.push($root.google.cloud.alloydb.v1.SqlResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sqlResults != null && message.hasOwnProperty("sqlResults")) { + if (!Array.isArray(message.sqlResults)) + return "sqlResults: array expected"; + for (var i = 0; i < message.sqlResults.length; ++i) { + var error = $root.google.cloud.alloydb.v1.SqlResult.verify(message.sqlResults[i]); + if (error) + return "sqlResults." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse + */ + ExecuteSqlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ExecuteSqlResponse(); + if (object.sqlResults) { + if (!Array.isArray(object.sqlResults)) + throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlResponse.sqlResults: array expected"); + message.sqlResults = []; + for (var i = 0; i < object.sqlResults.length; ++i) { + if (typeof object.sqlResults[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlResponse.sqlResults: object expected"); + message.sqlResults[i] = $root.google.cloud.alloydb.v1.SqlResult.fromObject(object.sqlResults[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlResponse.metadata: object expected"); + message.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1.ExecuteSqlResponse} message ExecuteSqlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sqlResults = []; + if (options.defaults) + object.metadata = null; + if (message.sqlResults && message.sqlResults.length) { + object.sqlResults = []; + for (var j = 0; j < message.sqlResults.length; ++j) + object.sqlResults[j] = $root.google.cloud.alloydb.v1.SqlResult.toObject(message.sqlResults[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ExecuteSqlResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlResponse"; + }; + + return ExecuteSqlResponse; + })(); + + v1.ExecuteSqlMetadata = (function() { + + /** + * Properties of an ExecuteSqlMetadata. + * @memberof google.cloud.alloydb.v1 + * @interface IExecuteSqlMetadata + * @property {string|null} [message] ExecuteSqlMetadata message + * @property {boolean|null} [partialResult] ExecuteSqlMetadata partialResult + * @property {google.protobuf.IDuration|null} [sqlStatementExecutionDuration] ExecuteSqlMetadata sqlStatementExecutionDuration + * @property {google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|null} [status] ExecuteSqlMetadata status + */ + + /** + * Constructs a new ExecuteSqlMetadata. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an ExecuteSqlMetadata. + * @implements IExecuteSqlMetadata + * @constructor + * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata=} [properties] Properties to set + */ + function ExecuteSqlMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlMetadata message. + * @member {string} message + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.message = ""; + + /** + * ExecuteSqlMetadata partialResult. + * @member {boolean} partialResult + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.partialResult = false; + + /** + * ExecuteSqlMetadata sqlStatementExecutionDuration. + * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; + + /** + * ExecuteSqlMetadata status. + * @member {google.cloud.alloydb.v1.ExecuteSqlMetadata.Status} status + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.status = 0; + + /** + * Creates a new ExecuteSqlMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata instance + */ + ExecuteSqlMetadata.create = function create(properties) { + return new ExecuteSqlMetadata(properties); + }; + + /** + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialResult); + if (message.sqlStatementExecutionDuration != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionDuration")) + $root.google.protobuf.Duration.encode(message.sqlStatementExecutionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExecuteSqlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.partialResult = reader.bool(); + break; + } + case 3: { + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.partialResult != null && message.hasOwnProperty("partialResult")) + if (typeof message.partialResult !== "boolean") + return "partialResult: boolean expected"; + if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionDuration); + if (error) + return "sqlStatementExecutionDuration." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata + */ + ExecuteSqlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1.ExecuteSqlMetadata(); + if (object.message != null) + message.message = String(object.message); + if (object.partialResult != null) + message.partialResult = Boolean(object.partialResult); + if (object.sqlStatementExecutionDuration != null) { + if (typeof object.sqlStatementExecutionDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlMetadata.sqlStatementExecutionDuration: object expected"); + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionDuration); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "OK": + case 1: + message.status = 1; + break; + case "PARTIAL": + case 2: + message.status = 2; + break; + case "ERROR": + case 3: + message.status = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1.ExecuteSqlMetadata} message ExecuteSqlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.partialResult = false; + object.sqlStatementExecutionDuration = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.partialResult != null && message.hasOwnProperty("partialResult")) + object.partialResult = message.partialResult; + if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) + object.sqlStatementExecutionDuration = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionDuration, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.Status[message.status] : message.status; + return object; + }; + + /** + * Converts this ExecuteSqlMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlMetadata"; + }; + + /** + * Status enum. + * @name google.cloud.alloydb.v1.ExecuteSqlMetadata.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} PARTIAL=2 PARTIAL value + * @property {number} ERROR=3 ERROR value + */ + ExecuteSqlMetadata.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "PARTIAL"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return ExecuteSqlMetadata; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.alloydb.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.alloydb.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.cloud.alloydb.v1.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [requestId] CreateBackupRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.requestId = ""; + + /** + * CreateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.alloydb.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; + + /** + * UpdateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.validateOnly = false; + + /** + * UpdateBackupRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly + * @property {string|null} [etag] DeleteBackupRequest etag + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; + + /** + * DeleteBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.validateOnly = false; + + /** + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.ListSupportedDatabaseFlagsRequest = (function() { + + /** + * Properties of a ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListSupportedDatabaseFlagsRequest + * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent + * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize + * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken + * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null} [scope] ListSupportedDatabaseFlagsRequest scope + */ + + /** + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListSupportedDatabaseFlagsRequest. + * @implements IListSupportedDatabaseFlagsRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + */ + function ListSupportedDatabaseFlagsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSupportedDatabaseFlagsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.parent = ""; + + /** + * ListSupportedDatabaseFlagsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; + + /** + * ListSupportedDatabaseFlagsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + + /** + * ListSupportedDatabaseFlagsRequest scope. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} scope + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.scope = 0; + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance + */ + ListSupportedDatabaseFlagsRequest.create = function create(properties) { + return new ListSupportedDatabaseFlagsRequest(properties); + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); + return writer; + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSupportedDatabaseFlagsRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSupportedDatabaseFlagsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + */ + ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "DATABASE": + case 1: + message.scope = 1; + break; + case "CONNECTION_POOL": + case 2: + message.scope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] : message.scope; + return object; + }; + + /** + * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest"; + }; + + return ListSupportedDatabaseFlagsRequest; + })(); + + v1.ListSupportedDatabaseFlagsResponse = (function() { + + /** + * Properties of a ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListSupportedDatabaseFlagsResponse + * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags + * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken + */ + + /** + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListSupportedDatabaseFlagsResponse. + * @implements IListSupportedDatabaseFlagsResponse + * @constructor + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + */ + function ListSupportedDatabaseFlagsResponse(properties) { + this.supportedDatabaseFlags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. + * @member {Array.} supportedDatabaseFlags + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @instance + */ + ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; + + /** + * ListSupportedDatabaseFlagsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @instance + */ + ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance + */ + ListSupportedDatabaseFlagsResponse.create = function create(properties) { + return new ListSupportedDatabaseFlagsResponse(properties); + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) + $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) + message.supportedDatabaseFlags = []; + message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1.SupportedDatabaseFlag.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSupportedDatabaseFlagsResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSupportedDatabaseFlagsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { + if (!Array.isArray(message.supportedDatabaseFlags)) + return "supportedDatabaseFlags: array expected"; + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { + var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (error) + return "supportedDatabaseFlags." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + */ + ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); + if (object.supportedDatabaseFlags) { + if (!Array.isArray(object.supportedDatabaseFlags)) + throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); + message.supportedDatabaseFlags = []; + for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { + if (typeof object.supportedDatabaseFlags[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); + message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDatabaseFlags = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { + object.supportedDatabaseFlags = []; + for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) + object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse"; + }; + + return ListSupportedDatabaseFlagsResponse; + })(); + + v1.GenerateClientCertificateRequest = (function() { + + /** + * Properties of a GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGenerateClientCertificateRequest + * @property {string|null} [parent] GenerateClientCertificateRequest parent + * @property {string|null} [requestId] GenerateClientCertificateRequest requestId + * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey + * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange + */ + + /** + * Constructs a new GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GenerateClientCertificateRequest. + * @implements IGenerateClientCertificateRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest=} [properties] Properties to set + */ + function GenerateClientCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateClientCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.parent = ""; + + /** + * GenerateClientCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.requestId = ""; + + /** + * GenerateClientCertificateRequest certDuration. + * @member {google.protobuf.IDuration|null|undefined} certDuration + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.certDuration = null; + + /** + * GenerateClientCertificateRequest publicKey. + * @member {string} publicKey + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.publicKey = ""; + + /** + * GenerateClientCertificateRequest useMetadataExchange. + * @member {boolean} useMetadataExchange + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.useMetadataExchange = false; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance + */ + GenerateClientCertificateRequest.create = function create(properties) { + return new GenerateClientCertificateRequest(properties); + }; + + /** + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) + $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); + if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); + return writer; + }; + + /** + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 4: { + message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.publicKey = reader.string(); + break; + } + case 6: { + message.useMetadataExchange = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateClientCertificateRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateClientCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) { + var error = $root.google.protobuf.Duration.verify(message.certDuration); + if (error) + return "certDuration." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: string expected"; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + if (typeof message.useMetadataExchange !== "boolean") + return "useMetadataExchange: boolean expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest + */ + GenerateClientCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.certDuration != null) { + if (typeof object.certDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1.GenerateClientCertificateRequest.certDuration: object expected"); + message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); + } + if (object.publicKey != null) + message.publicKey = String(object.publicKey); + if (object.useMetadataExchange != null) + message.useMetadataExchange = Boolean(object.useMetadataExchange); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1.GenerateClientCertificateRequest} message GenerateClientCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + object.certDuration = null; + object.publicKey = ""; + object.useMetadataExchange = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) + object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + object.useMetadataExchange = message.useMetadataExchange; + return object; + }; + + /** + * Converts this GenerateClientCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GenerateClientCertificateRequest"; + }; + + return GenerateClientCertificateRequest; + })(); + + v1.GenerateClientCertificateResponse = (function() { + + /** + * Properties of a GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IGenerateClientCertificateResponse + * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @property {string|null} [caCert] GenerateClientCertificateResponse caCert + */ + + /** + * Constructs a new GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GenerateClientCertificateResponse. + * @implements IGenerateClientCertificateResponse + * @constructor + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse=} [properties] Properties to set + */ + function GenerateClientCertificateResponse(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateClientCertificateResponse pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; + + /** + * GenerateClientCertificateResponse caCert. + * @member {string} caCert + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.caCert = ""; + + /** + * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance + */ + GenerateClientCertificateResponse.create = function create(properties) { + return new GenerateClientCertificateResponse(properties); + }; + + /** + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); + return writer; + }; + + /** + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 3: { + message.caCert = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateClientCertificateResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateClientCertificateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + if (!$util.isString(message.caCert)) + return "caCert: string expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse + */ + GenerateClientCertificateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse(); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1.GenerateClientCertificateResponse.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.caCert != null) + message.caCert = String(object.caCert); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1.GenerateClientCertificateResponse} message GenerateClientCertificateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) + object.caCert = ""; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + object.caCert = message.caCert; + return object; + }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GenerateClientCertificateResponse"; + }; + + return GenerateClientCertificateResponse; + })(); + + v1.GetConnectionInfoRequest = (function() { + + /** + * Properties of a GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetConnectionInfoRequest + * @property {string|null} [parent] GetConnectionInfoRequest parent + * @property {string|null} [requestId] GetConnectionInfoRequest requestId + */ + + /** + * Constructs a new GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetConnectionInfoRequest. + * @implements IGetConnectionInfoRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest=} [properties] Properties to set + */ + function GetConnectionInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionInfoRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.parent = ""; + + /** + * GetConnectionInfoRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.requestId = ""; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest instance + */ + GetConnectionInfoRequest.create = function create(properties) { + return new GetConnectionInfoRequest(properties); + }; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetConnectionInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionInfoRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest + */ + GetConnectionInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetConnectionInfoRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GetConnectionInfoRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1.GetConnectionInfoRequest} message GetConnectionInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetConnectionInfoRequest"; + }; + + return GetConnectionInfoRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.alloydb.v1 + * @interface IOperationMetadata + * @property {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata + * @property {google.cloud.alloydb.v1.IUpgradeClusterStatus|null} [upgradeClusterStatus] OperationMetadata upgradeClusterStatus + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata batchCreateInstancesMetadata. + * @member {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchCreateInstancesMetadata = null; + + /** + * OperationMetadata upgradeClusterStatus. + * @member {google.cloud.alloydb.v1.IUpgradeClusterStatus|null|undefined} upgradeClusterStatus + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.upgradeClusterStatus = null; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata requestSpecific. + * @member {"batchCreateInstancesMetadata"|"upgradeClusterStatus"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata", "upgradeClusterStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) + $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.upgradeClusterStatus != null && Object.hasOwnProperty.call(message, "upgradeClusterStatus")) + $root.google.cloud.alloydb.v1.UpgradeClusterStatus.encode(message.upgradeClusterStatus, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.upgradeClusterStatus = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.decode(reader, reader.uint32()); + break; + } + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); + if (error) + return "batchCreateInstancesMetadata." + error; + } + } + if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { + if (properties.requestSpecific === 1) + return "requestSpecific: multiple values"; + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.verify(message.upgradeClusterStatus); + if (error) + return "upgradeClusterStatus." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1.OperationMetadata(); + if (object.batchCreateInstancesMetadata != null) { + if (typeof object.batchCreateInstancesMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.batchCreateInstancesMetadata: object expected"); + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); + } + if (object.upgradeClusterStatus != null) { + if (typeof object.upgradeClusterStatus !== "object") + throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.upgradeClusterStatus: object expected"); + message.upgradeClusterStatus = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.fromObject(object.upgradeClusterStatus); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); + if (options.oneofs) + object.requestSpecific = "batchCreateInstancesMetadata"; + } + if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { + object.upgradeClusterStatus = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.toObject(message.upgradeClusterStatus, options); + if (options.oneofs) + object.requestSpecific = "upgradeClusterStatus"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.UpgradeClusterStatus = (function() { + + /** + * Properties of an UpgradeClusterStatus. + * @memberof google.cloud.alloydb.v1 + * @interface IUpgradeClusterStatus + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [state] UpgradeClusterStatus state + * @property {boolean|null} [cancellable] UpgradeClusterStatus cancellable + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [sourceVersion] UpgradeClusterStatus sourceVersion + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [targetVersion] UpgradeClusterStatus targetVersion + * @property {Array.|null} [stages] UpgradeClusterStatus stages + */ + + /** + * Constructs a new UpgradeClusterStatus. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpgradeClusterStatus. + * @implements IUpgradeClusterStatus + * @constructor + * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus=} [properties] Properties to set + */ + function UpgradeClusterStatus(properties) { + this.stages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterStatus state. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} state + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.state = 0; + + /** + * UpgradeClusterStatus cancellable. + * @member {boolean} cancellable + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.cancellable = false; + + /** + * UpgradeClusterStatus sourceVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} sourceVersion + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.sourceVersion = 0; + + /** + * UpgradeClusterStatus targetVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} targetVersion + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.targetVersion = 0; + + /** + * UpgradeClusterStatus stages. + * @member {Array.} stages + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.stages = $util.emptyArray; + + /** + * Creates a new UpgradeClusterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus instance + */ + UpgradeClusterStatus.create = function create(properties) { + return new UpgradeClusterStatus(properties); + }; + + /** + * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.cancellable != null && Object.hasOwnProperty.call(message, "cancellable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cancellable); + if (message.sourceVersion != null && Object.hasOwnProperty.call(message, "sourceVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceVersion); + if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.targetVersion); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.cancellable = reader.bool(); + break; + } + case 3: { + message.sourceVersion = reader.int32(); + break; + } + case 4: { + message.targetVersion = reader.int32(); + break; + } + case 5: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.cancellable != null && message.hasOwnProperty("cancellable")) + if (typeof message.cancellable !== "boolean") + return "cancellable: boolean expected"; + if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) + switch (message.sourceVersion) { + default: + return "sourceVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + switch (message.targetVersion) { + default: + return "targetVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + return null; + }; + + /** + * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus + */ + UpgradeClusterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "IN_PROGRESS": + case 5: + message.state = 5; + break; + case "SUCCESS": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.state = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.cancellable != null) + message.cancellable = Boolean(object.cancellable); + switch (object.sourceVersion) { + default: + if (typeof object.sourceVersion === "number") { + message.sourceVersion = object.sourceVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.sourceVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.sourceVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.sourceVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.sourceVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.sourceVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.sourceVersion = 5; + break; + } + switch (object.targetVersion) { + default: + if (typeof object.targetVersion === "number") { + message.targetVersion = object.targetVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.targetVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.targetVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.targetVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.targetVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.targetVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.targetVersion = 5; + break; + } + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.stages: object expected"); + message.stages[i] = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.fromObject(object.stages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus} message UpgradeClusterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stages = []; + if (options.defaults) { + object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.cancellable = false; + object.sourceVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.targetVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] : message.state; + if (message.cancellable != null && message.hasOwnProperty("cancellable")) + object.cancellable = message.cancellable; + if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) + object.sourceVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.sourceVersion] === undefined ? message.sourceVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.sourceVersion] : message.sourceVersion; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + object.targetVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.targetVersion] === undefined ? message.targetVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.targetVersion] : message.targetVersion; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.toObject(message.stages[j], options); + } + return object; + }; + + /** + * Converts this UpgradeClusterStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus"; + }; + + UpgradeClusterStatus.StageStatus = (function() { + + /** + * Properties of a StageStatus. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @interface IStageStatus + * @property {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null} [readPoolInstancesUpgrade] StageStatus readPoolInstancesUpgrade + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null} [stage] StageStatus stage + * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [state] StageStatus state + * @property {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null} [schedule] StageStatus schedule + */ + + /** + * Constructs a new StageStatus. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @classdesc Represents a StageStatus. + * @implements IStageStatus + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set + */ + function StageStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageStatus readPoolInstancesUpgrade. + * @member {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null|undefined} readPoolInstancesUpgrade + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.readPoolInstancesUpgrade = null; + + /** + * StageStatus stage. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage} stage + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.stage = 0; + + /** + * StageStatus state. + * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} state + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.state = 0; + + /** + * StageStatus schedule. + * @member {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null|undefined} schedule + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StageStatus stageSpecificStatus. + * @member {"readPoolInstancesUpgrade"|undefined} stageSpecificStatus + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @instance + */ + Object.defineProperty(StageStatus.prototype, "stageSpecificStatus", { + get: $util.oneOfGetter($oneOfFields = ["readPoolInstancesUpgrade"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StageStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus instance + */ + StageStatus.create = function create(properties) { + return new StageStatus(properties); + }; + + /** + * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.encode(message.schedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readPoolInstancesUpgrade != null && Object.hasOwnProperty.call(message, "readPoolInstancesUpgrade")) + $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.encode(message.readPoolInstancesUpgrade, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 11: { + message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.decode(reader, reader.uint32()); + break; + } + case 1: { + message.stage = reader.int32(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.schedule = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { + properties.stageSpecificStatus = 1; + { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify(message.readPoolInstancesUpgrade); + if (error) + return "readPoolInstancesUpgrade." + error; + } + } + if (message.stage != null && message.hasOwnProperty("stage")) + switch (message.stage) { + default: + return "stage: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + return null; + }; + + /** + * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus + */ + StageStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus(); + if (object.readPoolInstancesUpgrade != null) { + if (typeof object.readPoolInstancesUpgrade !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.readPoolInstancesUpgrade: object expected"); + message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.fromObject(object.readPoolInstancesUpgrade); + } + switch (object.stage) { + default: + if (typeof object.stage === "number") { + message.stage = object.stage; + break; + } + break; + case "STAGE_UNSPECIFIED": + case 0: + message.stage = 0; + break; + case "ALLOYDB_PRECHECK": + case 1: + message.stage = 1; + break; + case "PG_UPGRADE_CHECK": + case 2: + message.stage = 2; + break; + case "PREPARE_FOR_UPGRADE": + case 5: + message.stage = 5; + break; + case "PRIMARY_INSTANCE_UPGRADE": + case 3: + message.stage = 3; + break; + case "READ_POOL_INSTANCES_UPGRADE": + case 4: + message.stage = 4; + break; + case "ROLLBACK": + case 6: + message.stage = 6; + break; + case "CLEANUP": + case 7: + message.stage = 7; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "IN_PROGRESS": + case 5: + message.state = 5; + break; + case "SUCCESS": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.state = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.schedule: object expected"); + message.schedule = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.fromObject(object.schedule); + } + return message; + }; + + /** + * Creates a plain object from a StageStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} message StageStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.schedule = null; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] : message.stage; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] : message.state; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.toObject(message.schedule, options); + if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { + object.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.toObject(message.readPoolInstancesUpgrade, options); + if (options.oneofs) + object.stageSpecificStatus = "readPoolInstancesUpgrade"; + } + return object; + }; + + /** + * Converts this StageStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @instance + * @returns {Object.} JSON object + */ + StageStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus"; + }; + + StageStatus.StageSchedule = (function() { + + /** + * Properties of a StageSchedule. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @interface IStageSchedule + * @property {google.protobuf.ITimestamp|null} [estimatedStartTime] StageSchedule estimatedStartTime + * @property {google.protobuf.ITimestamp|null} [actualStartTime] StageSchedule actualStartTime + * @property {google.protobuf.ITimestamp|null} [estimatedEndTime] StageSchedule estimatedEndTime + * @property {google.protobuf.ITimestamp|null} [actualEndTime] StageSchedule actualEndTime + */ + + /** + * Constructs a new StageSchedule. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus + * @classdesc Represents a StageSchedule. + * @implements IStageSchedule + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set + */ + function StageSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageSchedule estimatedStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedStartTime + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.estimatedStartTime = null; + + /** + * StageSchedule actualStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} actualStartTime + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.actualStartTime = null; + + /** + * StageSchedule estimatedEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedEndTime + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.estimatedEndTime = null; + + /** + * StageSchedule actualEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} actualEndTime + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.actualEndTime = null; + + /** + * Creates a new StageSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule instance + */ + StageSchedule.create = function create(properties) { + return new StageSchedule(properties); + }; + + /** + * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedStartTime != null && Object.hasOwnProperty.call(message, "estimatedStartTime")) + $root.google.protobuf.Timestamp.encode(message.estimatedStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actualStartTime != null && Object.hasOwnProperty.call(message, "actualStartTime")) + $root.google.protobuf.Timestamp.encode(message.actualStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.estimatedEndTime != null && Object.hasOwnProperty.call(message, "estimatedEndTime")) + $root.google.protobuf.Timestamp.encode(message.estimatedEndTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.actualEndTime != null && Object.hasOwnProperty.call(message, "actualEndTime")) + $root.google.protobuf.Timestamp.encode(message.actualEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.estimatedStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.actualStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.estimatedEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.actualEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedStartTime); + if (error) + return "estimatedStartTime." + error; + } + if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.actualStartTime); + if (error) + return "actualStartTime." + error; + } + if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedEndTime); + if (error) + return "estimatedEndTime." + error; + } + if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.actualEndTime); + if (error) + return "actualEndTime." + error; + } + return null; + }; + + /** + * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + */ + StageSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule(); + if (object.estimatedStartTime != null) { + if (typeof object.estimatedStartTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedStartTime: object expected"); + message.estimatedStartTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedStartTime); + } + if (object.actualStartTime != null) { + if (typeof object.actualStartTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.actualStartTime: object expected"); + message.actualStartTime = $root.google.protobuf.Timestamp.fromObject(object.actualStartTime); + } + if (object.estimatedEndTime != null) { + if (typeof object.estimatedEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedEndTime: object expected"); + message.estimatedEndTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedEndTime); + } + if (object.actualEndTime != null) { + if (typeof object.actualEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.actualEndTime: object expected"); + message.actualEndTime = $root.google.protobuf.Timestamp.fromObject(object.actualEndTime); + } + return message; + }; + + /** + * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} message StageSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.estimatedStartTime = null; + object.actualStartTime = null; + object.estimatedEndTime = null; + object.actualEndTime = null; + } + if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) + object.estimatedStartTime = $root.google.protobuf.Timestamp.toObject(message.estimatedStartTime, options); + if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) + object.actualStartTime = $root.google.protobuf.Timestamp.toObject(message.actualStartTime, options); + if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) + object.estimatedEndTime = $root.google.protobuf.Timestamp.toObject(message.estimatedEndTime, options); + if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) + object.actualEndTime = $root.google.protobuf.Timestamp.toObject(message.actualEndTime, options); + return object; + }; + + /** + * Converts this StageSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + * @returns {Object.} JSON object + */ + StageSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule"; + }; + + return StageSchedule; + })(); + + return StageStatus; + })(); + + UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus = (function() { + + /** + * Properties of a ReadPoolInstancesUpgradeStageStatus. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @interface IReadPoolInstancesUpgradeStageStatus + * @property {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null} [upgradeStats] ReadPoolInstancesUpgradeStageStatus upgradeStats + */ + + /** + * Constructs a new ReadPoolInstancesUpgradeStageStatus. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus + * @classdesc Represents a ReadPoolInstancesUpgradeStageStatus. + * @implements IReadPoolInstancesUpgradeStageStatus + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set + */ + function ReadPoolInstancesUpgradeStageStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadPoolInstancesUpgradeStageStatus upgradeStats. + * @member {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null|undefined} upgradeStats + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @instance + */ + ReadPoolInstancesUpgradeStageStatus.prototype.upgradeStats = null; + + /** + * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus instance + */ + ReadPoolInstancesUpgradeStageStatus.create = function create(properties) { + return new ReadPoolInstancesUpgradeStageStatus(properties); + }; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolInstancesUpgradeStageStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upgradeStats != null && Object.hasOwnProperty.call(message, "upgradeStats")) + $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.encode(message.upgradeStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolInstancesUpgradeStageStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolInstancesUpgradeStageStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.upgradeStats = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolInstancesUpgradeStageStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolInstancesUpgradeStageStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolInstancesUpgradeStageStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) { + var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify(message.upgradeStats); + if (error) + return "upgradeStats." + error; + } + return null; + }; + + /** + * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + */ + ReadPoolInstancesUpgradeStageStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); + if (object.upgradeStats != null) { + if (typeof object.upgradeStats !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.upgradeStats: object expected"); + message.upgradeStats = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.fromObject(object.upgradeStats); + } + return message; + }; + + /** + * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolInstancesUpgradeStageStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.upgradeStats = null; + if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) + object.upgradeStats = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.toObject(message.upgradeStats, options); + return object; + }; + + /** + * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @instance + * @returns {Object.} JSON object + */ + ReadPoolInstancesUpgradeStageStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolInstancesUpgradeStageStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolInstancesUpgradeStageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus"; + }; + + ReadPoolInstancesUpgradeStageStatus.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @interface IStats + * @property {number|null} [notStarted] Stats notStarted + * @property {number|null} [ongoing] Stats ongoing + * @property {number|null} [success] Stats success + * @property {number|null} [failed] Stats failed + */ + + /** + * Constructs a new Stats. + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set + */ + function Stats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stats notStarted. + * @member {number} notStarted + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.notStarted = 0; + + /** + * Stats ongoing. + * @member {number} ongoing + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.ongoing = 0; + + /** + * Stats success. + * @member {number} success + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.success = 0; + + /** + * Stats failed. + * @member {number} failed + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.failed = 0; + + /** + * Creates a new Stats instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats instance + */ + Stats.create = function create(properties) { + return new Stats(properties); + }; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notStarted != null && Object.hasOwnProperty.call(message, "notStarted")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.notStarted); + if (message.ongoing != null && Object.hasOwnProperty.call(message, "ongoing")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ongoing); + if (message.success != null && Object.hasOwnProperty.call(message, "success")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.success); + if (message.failed != null && Object.hasOwnProperty.call(message, "failed")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failed); + return writer; + }; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notStarted = reader.int32(); + break; + } + case 2: { + message.ongoing = reader.int32(); + break; + } + case 3: { + message.success = reader.int32(); + break; + } + case 4: { + message.failed = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stats message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notStarted != null && message.hasOwnProperty("notStarted")) + if (!$util.isInteger(message.notStarted)) + return "notStarted: integer expected"; + if (message.ongoing != null && message.hasOwnProperty("ongoing")) + if (!$util.isInteger(message.ongoing)) + return "ongoing: integer expected"; + if (message.success != null && message.hasOwnProperty("success")) + if (!$util.isInteger(message.success)) + return "success: integer expected"; + if (message.failed != null && message.hasOwnProperty("failed")) + if (!$util.isInteger(message.failed)) + return "failed: integer expected"; + return null; + }; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + */ + Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats) + return object; + var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); + if (object.notStarted != null) + message.notStarted = object.notStarted | 0; + if (object.ongoing != null) + message.ongoing = object.ongoing | 0; + if (object.success != null) + message.success = object.success | 0; + if (object.failed != null) + message.failed = object.failed | 0; + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notStarted = 0; + object.ongoing = 0; + object.success = 0; + object.failed = 0; + } + if (message.notStarted != null && message.hasOwnProperty("notStarted")) + object.notStarted = message.notStarted; + if (message.ongoing != null && message.hasOwnProperty("ongoing")) + object.ongoing = message.ongoing; + if (message.success != null && message.hasOwnProperty("success")) + object.success = message.success; + if (message.failed != null && message.hasOwnProperty("failed")) + object.failed = message.failed; + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stats + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats"; + }; + + return Stats; + })(); + + return ReadPoolInstancesUpgradeStageStatus; + })(); + + return UpgradeClusterStatus; + })(); + + v1.ListUsersRequest = (function() { + + /** + * Properties of a ListUsersRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + * @property {string|null} [filter] ListUsersRequest filter + * @property {string|null} [orderBy] ListUsersRequest orderBy + */ + + /** + * Constructs a new ListUsersRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListUsersRequest=} [properties] Properties to set + */ + function ListUsersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.parent = ""; + + /** + * ListUsersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageSize = 0; + + /** + * ListUsersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageToken = ""; + + /** + * ListUsersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.filter = ""; + + /** + * ListUsersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1.IListUsersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest instance + */ + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); + }; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListUsersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest + */ + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListUsersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ListUsersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1.ListUsersRequest} message ListUsersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListUsersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListUsersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListUsersRequest"; + }; + + return ListUsersRequest; + })(); + + v1.ListUsersResponse = (function() { + + /** + * Properties of a ListUsersResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsersResponse unreachable + */ + + /** + * Constructs a new ListUsersResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse + * @constructor + * @param {google.cloud.alloydb.v1.IListUsersResponse=} [properties] Properties to set + */ + function ListUsersResponse(properties) { + this.users = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.users = $util.emptyArray; + + /** + * ListUsersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.nextPageToken = ""; + + /** + * ListUsersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.IListUsersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse instance + */ + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); + }; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.cloud.alloydb.v1.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListUsersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.cloud.alloydb.v1.User.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse + */ + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListUsersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.cloud.alloydb.v1.User.fromObject(object.users[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1.ListUsersResponse} message ListUsersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.users = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.cloud.alloydb.v1.User.toObject(message.users[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUsersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListUsersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListUsersResponse"; + }; + + return ListUsersResponse; + })(); + + v1.GetUserRequest = (function() { + + /** + * Properties of a GetUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name + */ + + /** + * Constructs a new GetUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.IGetUserRequest=} [properties] Properties to set + */ + function GetUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @instance + */ + GetUserRequest.prototype.name = ""; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.IGetUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest instance + */ + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); + }; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest + */ + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1.GetUserRequest} message GetUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.GetUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetUserRequest"; + }; + + return GetUserRequest; + })(); + + v1.CreateUserRequest = (function() { + + /** + * Properties of a CreateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.cloud.alloydb.v1.IUser|null} [user] CreateUserRequest user + * @property {string|null} [requestId] CreateUserRequest requestId + * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly + */ + + /** + * Constructs a new CreateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.ICreateUserRequest=} [properties] Properties to set + */ + function CreateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.parent = ""; + + /** + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.userId = ""; + + /** + * CreateUserRequest user. + * @member {google.cloud.alloydb.v1.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.user = null; + + /** + * CreateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.requestId = ""; + + /** + * CreateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest instance + */ + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); + }; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.user = $root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest + */ + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1.CreateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1.CreateUserRequest} message CreateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userId = ""; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.CreateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateUserRequest"; + }; + + return CreateUserRequest; + })(); + + v1.UpdateUserRequest = (function() { + + /** + * Properties of an UpdateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IUpdateUserRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + * @property {google.cloud.alloydb.v1.IUser|null} [user] UpdateUserRequest user + * @property {string|null} [requestId] UpdateUserRequest requestId + * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing + */ + + /** + * Constructs a new UpdateUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.IUpdateUserRequest=} [properties] Properties to set + */ + function UpdateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.updateMask = null; + + /** + * UpdateUserRequest user. + * @member {google.cloud.alloydb.v1.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; + + /** + * UpdateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.requestId = ""; + + /** + * UpdateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.validateOnly = false; + + /** + * UpdateUserRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest instance + */ + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); + }; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.user = $root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest + */ + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.UpdateUserRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1.UpdateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1.UpdateUserRequest} message UpdateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.UpdateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateUserRequest"; + }; + + return UpdateUserRequest; + })(); + + v1.DeleteUserRequest = (function() { + + /** + * Properties of a DeleteUserRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + * @property {string|null} [requestId] DeleteUserRequest requestId + * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly + */ + + /** + * Constructs a new DeleteUserRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest + * @constructor + * @param {google.cloud.alloydb.v1.IDeleteUserRequest=} [properties] Properties to set + */ + function DeleteUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.name = ""; + + /** + * DeleteUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.requestId = ""; + + /** + * DeleteUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest instance + */ + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); + }; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest + */ + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1.DeleteUserRequest} message DeleteUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.DeleteUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteUserRequest"; + }; + + return DeleteUserRequest; + })(); + + v1.ListDatabasesRequest = (function() { + + /** + * Properties of a ListDatabasesRequest. + * @memberof google.cloud.alloydb.v1 + * @interface IListDatabasesRequest + * @property {string|null} [parent] ListDatabasesRequest parent + * @property {number|null} [pageSize] ListDatabasesRequest pageSize + * @property {string|null} [pageToken] ListDatabasesRequest pageToken + * @property {string|null} [filter] ListDatabasesRequest filter + */ + + /** + * Constructs a new ListDatabasesRequest. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListDatabasesRequest. + * @implements IListDatabasesRequest + * @constructor + * @param {google.cloud.alloydb.v1.IListDatabasesRequest=} [properties] Properties to set + */ + function ListDatabasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.parent = ""; + + /** + * ListDatabasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageSize = 0; + + /** + * ListDatabasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageToken = ""; + + /** + * ListDatabasesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.filter = ""; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1.IListDatabasesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest instance + */ + ListDatabasesRequest.create = function create(properties) { + return new ListDatabasesRequest(properties); + }; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListDatabasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest + */ + ListDatabasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListDatabasesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1.ListDatabasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1.ListDatabasesRequest} message ListDatabasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListDatabasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListDatabasesRequest"; + }; + + return ListDatabasesRequest; + })(); + + v1.ListDatabasesResponse = (function() { + + /** + * Properties of a ListDatabasesResponse. + * @memberof google.cloud.alloydb.v1 + * @interface IListDatabasesResponse + * @property {Array.|null} [databases] ListDatabasesResponse databases + * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabasesResponse. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a ListDatabasesResponse. + * @implements IListDatabasesResponse + * @constructor + * @param {google.cloud.alloydb.v1.IListDatabasesResponse=} [properties] Properties to set + */ + function ListDatabasesResponse(properties) { + this.databases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesResponse databases. + * @member {Array.} databases + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.databases = $util.emptyArray; + + /** + * ListDatabasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1.IListDatabasesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse instance + */ + ListDatabasesResponse.create = function create(properties) { + return new ListDatabasesResponse(properties); + }; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databases != null && message.databases.length) + for (var i = 0; i < message.databases.length; ++i) + $root.google.cloud.alloydb.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListDatabasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databases && message.databases.length)) + message.databases = []; + message.databases.push($root.google.cloud.alloydb.v1.Database.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databases != null && message.hasOwnProperty("databases")) { + if (!Array.isArray(message.databases)) + return "databases: array expected"; + for (var i = 0; i < message.databases.length; ++i) { + var error = $root.google.cloud.alloydb.v1.Database.verify(message.databases[i]); + if (error) + return "databases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse + */ + ListDatabasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListDatabasesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1.ListDatabasesResponse(); + if (object.databases) { + if (!Array.isArray(object.databases)) + throw TypeError(".google.cloud.alloydb.v1.ListDatabasesResponse.databases: array expected"); + message.databases = []; + for (var i = 0; i < object.databases.length; ++i) { + if (typeof object.databases[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.ListDatabasesResponse.databases: object expected"); + message.databases[i] = $root.google.cloud.alloydb.v1.Database.fromObject(object.databases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1.ListDatabasesResponse} message ListDatabasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databases && message.databases.length) { + object.databases = []; + for (var j = 0; j < message.databases.length; ++j) + object.databases[j] = $root.google.cloud.alloydb.v1.Database.toObject(message.databases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.ListDatabasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListDatabasesResponse"; + }; + + return ListDatabasesResponse; + })(); + + v1.SqlResult = (function() { + + /** + * Properties of a SqlResult. + * @memberof google.cloud.alloydb.v1 + * @interface ISqlResult + * @property {Array.|null} [columns] SqlResult columns + * @property {Array.|null} [rows] SqlResult rows + */ + + /** + * Constructs a new SqlResult. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SqlResult. + * @implements ISqlResult + * @constructor + * @param {google.cloud.alloydb.v1.ISqlResult=} [properties] Properties to set + */ + function SqlResult(properties) { + this.columns = []; + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResult columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1.SqlResult + * @instance + */ + SqlResult.prototype.columns = $util.emptyArray; + + /** + * SqlResult rows. + * @member {Array.} rows + * @memberof google.cloud.alloydb.v1.SqlResult + * @instance + */ + SqlResult.prototype.rows = $util.emptyArray; + + /** + * Creates a new SqlResult instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {google.cloud.alloydb.v1.ISqlResult=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult instance + */ + SqlResult.create = function create(properties) { + return new SqlResult(properties); + }; + + /** + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {google.cloud.alloydb.v1.ISqlResult} message SqlResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.alloydb.v1.SqlResultColumn.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.alloydb.v1.SqlResultRow.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {google.cloud.alloydb.v1.ISqlResult} message SqlResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.alloydb.v1.SqlResultColumn.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.alloydb.v1.SqlResultRow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResult message. + * @function verify + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.alloydb.v1.SqlResultColumn.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.alloydb.v1.SqlResultRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult + */ + SqlResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResult) + return object; + var message = new $root.google.cloud.alloydb.v1.SqlResult(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.alloydb.v1.SqlResult.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.SqlResult.columns: object expected"); + message.columns[i] = $root.google.cloud.alloydb.v1.SqlResultColumn.fromObject(object.columns[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.alloydb.v1.SqlResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.SqlResult.rows: object expected"); + message.rows[i] = $root.google.cloud.alloydb.v1.SqlResultRow.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {google.cloud.alloydb.v1.SqlResult} message SqlResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columns = []; + object.rows = []; + } + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.alloydb.v1.SqlResultColumn.toObject(message.columns[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.alloydb.v1.SqlResultRow.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this SqlResult to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SqlResult + * @instance + * @returns {Object.} JSON object + */ + SqlResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResult + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SqlResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResult"; + }; + + return SqlResult; + })(); + + v1.SqlResultColumn = (function() { + + /** + * Properties of a SqlResultColumn. + * @memberof google.cloud.alloydb.v1 + * @interface ISqlResultColumn + * @property {string|null} [name] SqlResultColumn name + * @property {string|null} [type] SqlResultColumn type + */ + + /** + * Constructs a new SqlResultColumn. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SqlResultColumn. + * @implements ISqlResultColumn + * @constructor + * @param {google.cloud.alloydb.v1.ISqlResultColumn=} [properties] Properties to set + */ + function SqlResultColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultColumn name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @instance + */ + SqlResultColumn.prototype.name = ""; + + /** + * SqlResultColumn type. + * @member {string} type + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @instance + */ + SqlResultColumn.prototype.type = ""; + + /** + * Creates a new SqlResultColumn instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1.ISqlResultColumn=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn instance + */ + SqlResultColumn.create = function create(properties) { + return new SqlResultColumn(properties); + }; + + /** + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1.ISqlResultColumn} message SqlResultColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + return writer; + }; + + /** + * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1.ISqlResultColumn} message SqlResultColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultColumn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResultColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultColumn message. + * @function verify + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn + */ + SqlResultColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResultColumn) + return object; + var message = new $root.google.cloud.alloydb.v1.SqlResultColumn(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1.SqlResultColumn} message SqlResultColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this SqlResultColumn to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @instance + * @returns {Object.} JSON object + */ + SqlResultColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultColumn + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SqlResultColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultColumn"; + }; + + return SqlResultColumn; + })(); + + v1.SqlResultRow = (function() { + + /** + * Properties of a SqlResultRow. + * @memberof google.cloud.alloydb.v1 + * @interface ISqlResultRow + * @property {Array.|null} [values] SqlResultRow values + */ + + /** + * Constructs a new SqlResultRow. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SqlResultRow. + * @implements ISqlResultRow + * @constructor + * @param {google.cloud.alloydb.v1.ISqlResultRow=} [properties] Properties to set + */ + function SqlResultRow(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultRow values. + * @member {Array.} values + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @instance + */ + SqlResultRow.prototype.values = $util.emptyArray; + + /** + * Creates a new SqlResultRow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1.ISqlResultRow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow instance + */ + SqlResultRow.create = function create(properties) { + return new SqlResultRow(properties); + }; + + /** + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1.ISqlResultRow} message SqlResultRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.alloydb.v1.SqlResultValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1.ISqlResultRow} message SqlResultRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResultRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.alloydb.v1.SqlResultValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultRow message. + * @function verify + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.alloydb.v1.SqlResultValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow + */ + SqlResultRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResultRow) + return object; + var message = new $root.google.cloud.alloydb.v1.SqlResultRow(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.alloydb.v1.SqlResultRow.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1.SqlResultRow.values: object expected"); + message.values[i] = $root.google.cloud.alloydb.v1.SqlResultValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1.SqlResultRow} message SqlResultRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.alloydb.v1.SqlResultValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this SqlResultRow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @instance + * @returns {Object.} JSON object + */ + SqlResultRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultRow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SqlResultRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultRow"; + }; + + return SqlResultRow; + })(); + + v1.SqlResultValue = (function() { + + /** + * Properties of a SqlResultValue. + * @memberof google.cloud.alloydb.v1 + * @interface ISqlResultValue + * @property {string|null} [value] SqlResultValue value + * @property {boolean|null} [nullValue] SqlResultValue nullValue + */ + + /** + * Constructs a new SqlResultValue. + * @memberof google.cloud.alloydb.v1 + * @classdesc Represents a SqlResultValue. + * @implements ISqlResultValue + * @constructor + * @param {google.cloud.alloydb.v1.ISqlResultValue=} [properties] Properties to set + */ + function SqlResultValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + */ + SqlResultValue.prototype.value = null; + + /** + * SqlResultValue nullValue. + * @member {boolean|null|undefined} nullValue + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + */ + SqlResultValue.prototype.nullValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlResultValue.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlResultValue.prototype, "_nullValue", { + get: $util.oneOfGetter($oneOfFields = ["nullValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlResultValue instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1.ISqlResultValue=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue instance + */ + SqlResultValue.create = function create(properties) { + return new SqlResultValue(properties); + }; + + /** + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1.ISqlResultValue} message SqlResultValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.nullValue); + return writer; + }; + + /** + * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1.ISqlResultValue} message SqlResultValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResultValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.nullValue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultValue message. + * @function verify + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties._nullValue = 1; + if (typeof message.nullValue !== "boolean") + return "nullValue: boolean expected"; + } + return null; + }; + + /** + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue + */ + SqlResultValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResultValue) + return object; + var message = new $root.google.cloud.alloydb.v1.SqlResultValue(); + if (object.value != null) + message.value = String(object.value); + if (object.nullValue != null) + message.nullValue = Boolean(object.nullValue); + return message; + }; + + /** + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1.SqlResultValue} message SqlResultValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = message.nullValue; + if (options.oneofs) + object._nullValue = "nullValue"; + } + return object; + }; + + /** + * Converts this SqlResultValue to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + * @returns {Object.} JSON object + */ + SqlResultValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultValue + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultValue"; + }; + + return SqlResultValue; + })(); + + return v1; + })(); + + alloydb.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1alpha = {}; + + v1alpha.CloudSQLBackupRunSource = (function() { + + /** + * Properties of a CloudSQLBackupRunSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICloudSQLBackupRunSource + * @property {string|null} [project] CloudSQLBackupRunSource project + * @property {string|null} [instanceId] CloudSQLBackupRunSource instanceId + * @property {number|Long|null} [backupRunId] CloudSQLBackupRunSource backupRunId + */ + + /** + * Constructs a new CloudSQLBackupRunSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CloudSQLBackupRunSource. + * @implements ICloudSQLBackupRunSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource=} [properties] Properties to set + */ + function CloudSQLBackupRunSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSQLBackupRunSource project. + * @member {string} project + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.project = ""; + + /** + * CloudSQLBackupRunSource instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.instanceId = ""; + + /** + * CloudSQLBackupRunSource backupRunId. + * @member {number|Long} backupRunId + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.backupRunId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CloudSQLBackupRunSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource instance + */ + CloudSQLBackupRunSource.create = function create(properties) { + return new CloudSQLBackupRunSource(properties); + }; + + /** + * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSQLBackupRunSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.backupRunId); + return writer; + }; + + /** + * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSQLBackupRunSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSQLBackupRunSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupRunId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSQLBackupRunSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSQLBackupRunSource message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSQLBackupRunSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) + return "backupRunId: integer|Long expected"; + return null; + }; + + /** + * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource + */ + CloudSQLBackupRunSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource(); + if (object.project != null) + message.project = String(object.project); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupRunId != null) + if ($util.Long) + (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; + else if (typeof object.backupRunId === "string") + message.backupRunId = parseInt(object.backupRunId, 10); + else if (typeof object.backupRunId === "number") + message.backupRunId = object.backupRunId; + else if (typeof object.backupRunId === "object") + message.backupRunId = new $util.LongBits(object.backupRunId.low >>> 0, object.backupRunId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} message CloudSQLBackupRunSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSQLBackupRunSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.instanceId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupRunId = options.longs === String ? "0" : 0; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (typeof message.backupRunId === "number") + object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; + else + object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; + return object; + }; + + /** + * Converts this CloudSQLBackupRunSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @instance + * @returns {Object.} JSON object + */ + CloudSQLBackupRunSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSQLBackupRunSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSQLBackupRunSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource"; + }; + + return CloudSQLBackupRunSource; + })(); + + v1alpha.AlloyDBCSQLAdmin = (function() { + + /** + * Constructs a new AlloyDBCSQLAdmin service. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an AlloyDBCSQLAdmin + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AlloyDBCSQLAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBCSQLAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBCSQLAdmin; + + /** + * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AlloyDBCSQLAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBCSQLAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin|restoreFromCloudSQL}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin + * @typedef RestoreFromCloudSQLCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreFromCloudSQL. + * @function restoreFromCloudSQL + * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBCSQLAdmin.prototype.restoreFromCloudSQL = function restoreFromCloudSQL(request, callback) { + return this.rpcCall(restoreFromCloudSQL, $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreFromCloudSQL" }); + + /** + * Calls RestoreFromCloudSQL. + * @function restoreFromCloudSQL + * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBCSQLAdmin; + })(); + + v1alpha.RestoreFromCloudSQLRequest = (function() { + + /** + * Properties of a RestoreFromCloudSQLRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IRestoreFromCloudSQLRequest + * @property {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] RestoreFromCloudSQLRequest cloudsqlBackupRunSource + * @property {string|null} [parent] RestoreFromCloudSQLRequest parent + * @property {string|null} [clusterId] RestoreFromCloudSQLRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] RestoreFromCloudSQLRequest cluster + */ + + /** + * Constructs a new RestoreFromCloudSQLRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a RestoreFromCloudSQLRequest. + * @implements IRestoreFromCloudSQLRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest=} [properties] Properties to set + */ + function RestoreFromCloudSQLRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreFromCloudSQLRequest cloudsqlBackupRunSource. + * @member {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.cloudsqlBackupRunSource = null; + + /** + * RestoreFromCloudSQLRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.parent = ""; + + /** + * RestoreFromCloudSQLRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.clusterId = ""; + + /** + * RestoreFromCloudSQLRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.cluster = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreFromCloudSQLRequest source. + * @member {"cloudsqlBackupRunSource"|undefined} source + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @instance + */ + Object.defineProperty(RestoreFromCloudSQLRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["cloudsqlBackupRunSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest instance + */ + RestoreFromCloudSQLRequest.create = function create(properties) { + return new RestoreFromCloudSQLRequest(properties); + }; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreFromCloudSQLRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) + $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreFromCloudSQLRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreFromCloudSQLRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 101: { + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreFromCloudSQLRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreFromCloudSQLRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreFromCloudSQLRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); + if (error) + return "cloudsqlBackupRunSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + return null; + }; + + /** + * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + */ + RestoreFromCloudSQLRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest(); + if (object.cloudsqlBackupRunSource != null) { + if (typeof object.cloudsqlBackupRunSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.cloudsqlBackupRunSource: object expected"); + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + } + return message; + }; + + /** + * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreFromCloudSQLRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); + if (options.oneofs) + object.source = "cloudsqlBackupRunSource"; + } + return object; + }; + + /** + * Converts this RestoreFromCloudSQLRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreFromCloudSQLRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreFromCloudSQLRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreFromCloudSQLRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest"; + }; + + return RestoreFromCloudSQLRequest; + })(); + + /** + * InstanceView enum. + * @name google.cloud.alloydb.v1alpha.InstanceView + * @enum {number} + * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value + * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value + * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value + */ + v1alpha.InstanceView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; + values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; + return values; + })(); + + /** + * ClusterView enum. + * @name google.cloud.alloydb.v1alpha.ClusterView + * @enum {number} + * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value + * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value + * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value + */ + v1alpha.ClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; + values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; + return values; + })(); + + /** + * DatabaseVersion enum. + * @name google.cloud.alloydb.v1alpha.DatabaseVersion + * @enum {number} + * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value + * @property {number} POSTGRES_13=1 POSTGRES_13 value + * @property {number} POSTGRES_14=2 POSTGRES_14 value + * @property {number} POSTGRES_15=3 POSTGRES_15 value + * @property {number} POSTGRES_16=4 POSTGRES_16 value + * @property {number} POSTGRES_17=5 POSTGRES_17 value + * @property {number} POSTGRES_18=6 POSTGRES_18 value + */ + v1alpha.DatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSTGRES_13"] = 1; + values[valuesById[2] = "POSTGRES_14"] = 2; + values[valuesById[3] = "POSTGRES_15"] = 3; + values[valuesById[4] = "POSTGRES_16"] = 4; + values[valuesById[5] = "POSTGRES_17"] = 5; + values[valuesById[6] = "POSTGRES_18"] = 6; + return values; + })(); + + /** + * SubscriptionType enum. + * @name google.cloud.alloydb.v1alpha.SubscriptionType + * @enum {number} + * @property {number} SUBSCRIPTION_TYPE_UNSPECIFIED=0 SUBSCRIPTION_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} TRIAL=2 TRIAL value + */ + v1alpha.SubscriptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUBSCRIPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "TRIAL"] = 2; + return values; + })(); + + v1alpha.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set + */ + function UserPassword(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserPassword user. + * @member {string} user + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @instance + */ + UserPassword.prototype.user = ""; + + /** + * UserPassword password. + * @member {string} password + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @instance + */ + UserPassword.prototype.password = ""; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UserPassword) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); + if (object.user != null) + message.user = String(object.user); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {google.cloud.alloydb.v1alpha.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = ""; + object.password = ""; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UserPassword"; + }; + + return UserPassword; + })(); + + v1alpha.MigrationSource = (function() { + + /** + * Properties of a MigrationSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface IMigrationSource + * @property {string|null} [hostPort] MigrationSource hostPort + * @property {string|null} [referenceId] MigrationSource referenceId + * @property {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType + */ + + /** + * Constructs a new MigrationSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a MigrationSource. + * @implements IMigrationSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set + */ + function MigrationSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationSource hostPort. + * @member {string} hostPort + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @instance + */ + MigrationSource.prototype.hostPort = ""; + + /** + * MigrationSource referenceId. + * @member {string} referenceId + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @instance + */ + MigrationSource.prototype.referenceId = ""; + + /** + * MigrationSource sourceType. + * @member {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType} sourceType + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @instance + */ + MigrationSource.prototype.sourceType = 0; + + /** + * Creates a new MigrationSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource instance + */ + MigrationSource.create = function create(properties) { + return new MigrationSource(properties); + }; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); + if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); + return writer; + }; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hostPort = reader.string(); + break; + } + case 2: { + message.referenceId = reader.string(); + break; + } + case 3: { + message.sourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationSource message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (!$util.isString(message.hostPort)) + return "hostPort: string expected"; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + if (!$util.isString(message.referenceId)) + return "referenceId: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource + */ + MigrationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.MigrationSource) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); + if (object.hostPort != null) + message.hostPort = String(object.hostPort); + if (object.referenceId != null) + message.referenceId = String(object.referenceId); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "DMS": + case 1: + message.sourceType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {google.cloud.alloydb.v1alpha.MigrationSource} message MigrationSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostPort = ""; + object.referenceId = ""; + object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + object.hostPort = message.hostPort; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + object.referenceId = message.referenceId; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; + return object; + }; + + /** + * Converts this MigrationSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @instance + * @returns {Object.} JSON object + */ + MigrationSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.MigrationSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MigrationSource"; + }; + + /** + * MigrationSourceType enum. + * @name google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType + * @enum {number} + * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value + * @property {number} DMS=1 DMS value + */ + MigrationSource.MigrationSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DMS"] = 1; + return values; + })(); + + return MigrationSource; + })(); + + v1alpha.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1alpha.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @interface IEncryptionInfo + * @property {google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + this.kmsKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.cloud.alloydb.v1alpha.EncryptionInfo.Type} encryptionType + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo kmsKeyVersions. + * @member {Array.} kmsKeyVersions + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) + message.kmsKeyVersions = []; + message.kmsKeyVersions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { + if (!Array.isArray(message.kmsKeyVersions)) + return "kmsKeyVersions: array expected"; + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + if (!$util.isString(message.kmsKeyVersions[i])) + return "kmsKeyVersions: string[] expected"; + } + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.kmsKeyVersions) { + if (!Array.isArray(object.kmsKeyVersions)) + throw TypeError(".google.cloud.alloydb.v1alpha.EncryptionInfo.kmsKeyVersions: array expected"); + message.kmsKeyVersions = []; + for (var i = 0; i < object.kmsKeyVersions.length; ++i) + message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyVersions = []; + if (options.defaults) + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.kmsKeyVersions && message.kmsKeyVersions.length) { + object.kmsKeyVersions = []; + for (var j = 0; j < message.kmsKeyVersions.length; ++j) + object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + } + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionInfo"; + }; + + /** + * Type enum. + * @name google.cloud.alloydb.v1alpha.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + v1alpha.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISslConfig + * @property {google.cloud.alloydb.v1alpha.SslConfig.SslMode|null} [sslMode] SslConfig sslMode + * @property {google.cloud.alloydb.v1alpha.SslConfig.CaSource|null} [caSource] SslConfig caSource + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig sslMode. + * @member {google.cloud.alloydb.v1alpha.SslConfig.SslMode} sslMode + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @instance + */ + SslConfig.prototype.sslMode = 0; + + /** + * SslConfig caSource. + * @member {google.cloud.alloydb.v1alpha.SslConfig.CaSource} caSource + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @instance + */ + SslConfig.prototype.caSource = 0; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); + if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sslMode = reader.int32(); + break; + } + case 2: { + message.caSource = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + switch (message.sslMode) { + default: + return "sslMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.caSource != null && message.hasOwnProperty("caSource")) + switch (message.caSource) { + default: + return "caSource: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SslConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); + switch (object.sslMode) { + default: + if (typeof object.sslMode === "number") { + message.sslMode = object.sslMode; + break; + } + break; + case "SSL_MODE_UNSPECIFIED": + case 0: + message.sslMode = 0; + break; + case "SSL_MODE_ALLOW": + case 1: + message.sslMode = 1; + break; + case "SSL_MODE_REQUIRE": + case 2: + message.sslMode = 2; + break; + case "SSL_MODE_VERIFY_CA": + case 3: + message.sslMode = 3; + break; + case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": + case 4: + message.sslMode = 4; + break; + case "ENCRYPTED_ONLY": + case 5: + message.sslMode = 5; + break; + } + switch (object.caSource) { + default: + if (typeof object.caSource === "number") { + message.caSource = object.caSource; + break; + } + break; + case "CA_SOURCE_UNSPECIFIED": + case 0: + message.caSource = 0; + break; + case "CA_SOURCE_MANAGED": + case 1: + message.caSource = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {google.cloud.alloydb.v1alpha.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; + object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; + } + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] : message.sslMode; + if (message.caSource != null && message.hasOwnProperty("caSource")) + object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] : message.caSource; + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SslConfig"; + }; + + /** + * SslMode enum. + * @name google.cloud.alloydb.v1alpha.SslConfig.SslMode + * @enum {number} + * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value + * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value + * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value + * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value + * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value + * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value + */ + SslConfig.SslMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; + values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; + values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; + values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; + values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; + return values; + })(); + + /** + * CaSource enum. + * @name google.cloud.alloydb.v1alpha.SslConfig.CaSource + * @enum {number} + * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value + * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value + */ + SslConfig.CaSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; + return values; + })(); + + return SslConfig; + })(); + + v1alpha.AutomatedBackupPolicy = (function() { + + /** + * Properties of an AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1alpha + * @interface IAutomatedBackupPolicy + * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule + * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention + * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention + * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled + * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig + * @property {string|null} [location] AutomatedBackupPolicy location + * @property {Object.|null} [labels] AutomatedBackupPolicy labels + */ + + /** + * Constructs a new AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy + * @constructor + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set + */ + function AutomatedBackupPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedBackupPolicy weeklySchedule. + * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.weeklySchedule = null; + + /** + * AutomatedBackupPolicy timeBasedRetention. + * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.timeBasedRetention = null; + + /** + * AutomatedBackupPolicy quantityBasedRetention. + * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.quantityBasedRetention = null; + + /** + * AutomatedBackupPolicy enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.enabled = null; + + /** + * AutomatedBackupPolicy backupWindow. + * @member {google.protobuf.IDuration|null|undefined} backupWindow + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.backupWindow = null; + + /** + * AutomatedBackupPolicy encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.encryptionConfig = null; + + /** + * AutomatedBackupPolicy location. + * @member {string} location + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.location = ""; + + /** + * AutomatedBackupPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutomatedBackupPolicy schedule. + * @member {"weeklySchedule"|undefined} schedule + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { + get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy retention. + * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { + get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); + break; + } + case 5: { + message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); + break; + } + case 1: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedBackupPolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedBackupPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + properties.schedule = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); + if (error) + return "weeklySchedule." + error; + } + } + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); + if (error) + return "timeBasedRetention." + error; + } + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + if (properties.retention === 1) + return "retention: multiple values"; + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); + if (error) + return "quantityBasedRetention." + error; + } + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.protobuf.Duration.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy + */ + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(); + if (object.weeklySchedule != null) { + if (typeof object.weeklySchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.weeklySchedule: object expected"); + message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); + } + if (object.timeBasedRetention != null) { + if (typeof object.timeBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.timeBasedRetention: object expected"); + message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); + } + if (object.quantityBasedRetention != null) { + if (typeof object.quantityBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.quantityBasedRetention: object expected"); + message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.backupWindow: object expected"); + message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedBackupPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.backupWindow = null; + object.location = ""; + object.encryptionConfig = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + object.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); + if (options.oneofs) + object.schedule = "weeklySchedule"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + object.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); + if (options.oneofs) + object.retention = "timeBasedRetention"; + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + object.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); + if (options.oneofs) + object.retention = "quantityBasedRetention"; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + * @returns {Object.} JSON object + */ + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy"; + }; + + AutomatedBackupPolicy.WeeklySchedule = (function() { + + /** + * Properties of a WeeklySchedule. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @interface IWeeklySchedule + * @property {Array.|null} [startTimes] WeeklySchedule startTimes + * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek + */ + + /** + * Constructs a new WeeklySchedule. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @classdesc Represents a WeeklySchedule. + * @implements IWeeklySchedule + * @constructor + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + */ + function WeeklySchedule(properties) { + this.startTimes = []; + this.daysOfWeek = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklySchedule startTimes. + * @member {Array.} startTimes + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.startTimes = $util.emptyArray; + + /** + * WeeklySchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance + */ + WeeklySchedule.create = function create(properties) { + return new WeeklySchedule(properties); + }; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimes != null && message.startTimes.length) + for (var i = 0; i < message.startTimes.length; ++i) + $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.startTimes && message.startTimes.length)) + message.startTimes = []; + message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklySchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimes != null && message.hasOwnProperty("startTimes")) { + if (!Array.isArray(message.startTimes)) + return "startTimes: array expected"; + for (var i = 0; i < message.startTimes.length; ++i) { + var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); + if (error) + return "startTimes." + error; + } + } + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + */ + WeeklySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); + if (object.startTimes) { + if (!Array.isArray(object.startTimes)) + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); + message.startTimes = []; + for (var i = 0; i < object.startTimes.length; ++i) { + if (typeof object.startTimes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); + message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); + } + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startTimes = []; + object.daysOfWeek = []; + } + if (message.startTimes && message.startTimes.length) { + object.startTimes = []; + for (var j = 0; j < message.startTimes.length; ++j) + object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); + } + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + return object; + }; + + /** + * Converts this WeeklySchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @instance + * @returns {Object.} JSON object + */ + WeeklySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeeklySchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule"; + }; + + return WeeklySchedule; + })(); + + AutomatedBackupPolicy.TimeBasedRetention = (function() { + + /** + * Properties of a TimeBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @interface ITimeBasedRetention + * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod + */ + + /** + * Constructs a new TimeBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @classdesc Represents a TimeBasedRetention. + * @implements ITimeBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + */ + function TimeBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeBasedRetention retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @instance + */ + TimeBasedRetention.prototype.retentionPeriod = null; + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance + */ + TimeBasedRetention.create = function create(properties) { + return new TimeBasedRetention(properties); + }; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + */ + TimeBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this TimeBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @instance + * @returns {Object.} JSON object + */ + TimeBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention"; + }; + + return TimeBasedRetention; + })(); + + AutomatedBackupPolicy.QuantityBasedRetention = (function() { + + /** + * Properties of a QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @interface IQuantityBasedRetention + * @property {number|null} [count] QuantityBasedRetention count + */ + + /** + * Constructs a new QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @classdesc Represents a QuantityBasedRetention. + * @implements IQuantityBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + */ + function QuantityBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedRetention count. + * @member {number} count + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + */ + QuantityBasedRetention.prototype.count = 0; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance + */ + QuantityBasedRetention.create = function create(properties) { + return new QuantityBasedRetention(properties); + }; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); + return writer; + }; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + */ + QuantityBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.count = 0; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention"; + }; + + return QuantityBasedRetention; + })(); + + return AutomatedBackupPolicy; + })(); + + v1alpha.ContinuousBackupConfig = (function() { + + /** + * Properties of a ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IContinuousBackupConfig + * @property {boolean|null} [enabled] ContinuousBackupConfig enabled + * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + */ + + /** + * Constructs a new ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ContinuousBackupConfig. + * @implements IContinuousBackupConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set + */ + function ContinuousBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.enabled = null; + + /** + * ContinuousBackupConfig recoveryWindowDays. + * @member {number} recoveryWindowDays + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + + /** + * ContinuousBackupConfig encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig instance + */ + ContinuousBackupConfig.create = function create(properties) { + return new ContinuousBackupConfig(properties); + }; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 4: { + message.recoveryWindowDays = reader.int32(); + break; + } + case 3: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + if (!$util.isInteger(message.recoveryWindowDays)) + return "recoveryWindowDays: integer expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig + */ + ContinuousBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.recoveryWindowDays != null) + message.recoveryWindowDays = object.recoveryWindowDays | 0; + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encryptionConfig = null; + object.recoveryWindowDays = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + object.recoveryWindowDays = message.recoveryWindowDays; + return object; + }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupConfig"; + }; + + return ContinuousBackupConfig; + })(); + + v1alpha.ContinuousBackupInfo = (function() { + + /** + * Properties of a ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1alpha + * @interface IContinuousBackupInfo + * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo + * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime + * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime + */ + + /** + * Constructs a new ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ContinuousBackupInfo. + * @implements IContinuousBackupInfo + * @constructor + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set + */ + function ContinuousBackupInfo(properties) { + this.schedule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupInfo encryptionInfo. + * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.encryptionInfo = null; + + /** + * ContinuousBackupInfo enabledTime. + * @member {google.protobuf.ITimestamp|null|undefined} enabledTime + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.enabledTime = null; + + /** + * ContinuousBackupInfo schedule. + * @member {Array.} schedule + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.schedule = $util.emptyArray; + + /** + * ContinuousBackupInfo earliestRestorableTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.earliestRestorableTime = null; + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo instance + */ + ContinuousBackupInfo.create = function create(properties) { + return new ContinuousBackupInfo(properties); + }; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) + $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schedule != null && message.schedule.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.schedule.length; ++i) + writer.int32(message.schedule[i]); + writer.ldelim(); + } + if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) + $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.schedule && message.schedule.length)) + message.schedule = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.schedule.push(reader.int32()); + } else + message.schedule.push(reader.int32()); + break; + } + case 4: { + message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); + if (error) + return "enabledTime." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + if (!Array.isArray(message.schedule)) + return "schedule: array expected"; + for (var i = 0; i < message.schedule.length; ++i) + switch (message.schedule[i]) { + default: + return "schedule: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); + if (error) + return "earliestRestorableTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo + */ + ContinuousBackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.enabledTime != null) { + if (typeof object.enabledTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.enabledTime: object expected"); + message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); + } + if (object.schedule) { + if (!Array.isArray(object.schedule)) + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.schedule: array expected"); + message.schedule = []; + for (var i = 0; i < object.schedule.length; ++i) + switch (object.schedule[i]) { + default: + if (typeof object.schedule[i] === "number") { + message.schedule[i] = object.schedule[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.schedule[i] = 0; + break; + case "MONDAY": + case 1: + message.schedule[i] = 1; + break; + case "TUESDAY": + case 2: + message.schedule[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.schedule[i] = 3; + break; + case "THURSDAY": + case 4: + message.schedule[i] = 4; + break; + case "FRIDAY": + case 5: + message.schedule[i] = 5; + break; + case "SATURDAY": + case 6: + message.schedule[i] = 6; + break; + case "SUNDAY": + case 7: + message.schedule[i] = 7; + break; + } + } + if (object.earliestRestorableTime != null) { + if (typeof object.earliestRestorableTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.earliestRestorableTime: object expected"); + message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schedule = []; + if (options.defaults) { + object.encryptionInfo = null; + object.enabledTime = null; + object.earliestRestorableTime = null; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) + object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); + if (message.schedule && message.schedule.length) { + object.schedule = []; + for (var j = 0; j < message.schedule.length; ++j) + object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) + object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupInfo"; + }; + + return ContinuousBackupInfo; + })(); + + v1alpha.BackupSource = (function() { + + /** + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName + */ + + /** + * Constructs a new BackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a BackupSource. + * @implements IBackupSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set + */ + function BackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @instance + */ + BackupSource.prototype.backupUid = ""; + + /** + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @instance + */ + BackupSource.prototype.backupName = ""; + + /** + * Creates a new BackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource instance + */ + BackupSource.create = function create(properties) { + return new BackupSource(properties); + }; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); + if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + return writer; + }; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.backupUid = reader.string(); + break; + } + case 1: { + message.backupName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + if (!$util.isString(message.backupUid)) + return "backupUid: string expected"; + if (message.backupName != null && message.hasOwnProperty("backupName")) + if (!$util.isString(message.backupName)) + return "backupName: string expected"; + return null; + }; + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource + */ + BackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); + if (object.backupUid != null) + message.backupUid = String(object.backupUid); + if (object.backupName != null) + message.backupName = String(object.backupName); + return message; + }; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.BackupSource} message BackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupName = ""; + object.backupUid = ""; + } + if (message.backupName != null && message.hasOwnProperty("backupName")) + object.backupName = message.backupName; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + object.backupUid = message.backupUid; + return object; + }; + + /** + * Converts this BackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @instance + * @returns {Object.} JSON object + */ + BackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.BackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BackupSource"; + }; + + return BackupSource; + })(); + + v1alpha.ContinuousBackupSource = (function() { + + /** + * Properties of a ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + */ + + /** + * Constructs a new ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource + * @constructor + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set + */ + function ContinuousBackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.cluster = ""; + + /** + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.pointInTime = null; + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource instance + */ + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); + }; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); + if (error) + return "pointInTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource + */ + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.pointInTime != null) { + if (typeof object.pointInTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupSource.pointInTime: object expected"); + message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupSource} message ContinuousBackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.pointInTime = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupSource"; + }; + + return ContinuousBackupSource; + })(); + + v1alpha.MaintenanceUpdatePolicy = (function() { + + /** + * Properties of a MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1alpha + * @interface IMaintenanceUpdatePolicy + * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows + * @property {Array.|null} [denyMaintenancePeriods] MaintenanceUpdatePolicy denyMaintenancePeriods + */ + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a MaintenanceUpdatePolicy. + * @implements IMaintenanceUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy=} [properties] Properties to set + */ + function MaintenanceUpdatePolicy(properties) { + this.maintenanceWindows = []; + this.denyMaintenancePeriods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceUpdatePolicy maintenanceWindows. + * @member {Array.} maintenanceWindows + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; + + /** + * MaintenanceUpdatePolicy denyMaintenancePeriods. + * @member {Array.} denyMaintenancePeriods + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.denyMaintenancePeriods = $util.emptyArray; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance + */ + MaintenanceUpdatePolicy.create = function create(properties) { + return new MaintenanceUpdatePolicy(properties); + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maintenanceWindows != null && message.maintenanceWindows.length) + for (var i = 0; i < message.maintenanceWindows.length; ++i) + $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) + for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) + $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.maintenanceWindows && message.maintenanceWindows.length)) + message.maintenanceWindows = []; + message.maintenanceWindows.push($root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.denyMaintenancePeriods && message.denyMaintenancePeriods.length)) + message.denyMaintenancePeriods = []; + message.denyMaintenancePeriods.push($root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceUpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { + if (!Array.isArray(message.maintenanceWindows)) + return "maintenanceWindows: array expected"; + for (var i = 0; i < message.maintenanceWindows.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); + if (error) + return "maintenanceWindows." + error; + } + } + if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { + if (!Array.isArray(message.denyMaintenancePeriods)) + return "denyMaintenancePeriods: array expected"; + for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify(message.denyMaintenancePeriods[i]); + if (error) + return "denyMaintenancePeriods." + error; + } + } + return null; + }; + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + */ + MaintenanceUpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy(); + if (object.maintenanceWindows) { + if (!Array.isArray(object.maintenanceWindows)) + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); + message.maintenanceWindows = []; + for (var i = 0; i < object.maintenanceWindows.length; ++i) { + if (typeof object.maintenanceWindows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); + message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); + } + } + if (object.denyMaintenancePeriods) { + if (!Array.isArray(object.denyMaintenancePeriods)) + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.denyMaintenancePeriods: array expected"); + message.denyMaintenancePeriods = []; + for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { + if (typeof object.denyMaintenancePeriods[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.denyMaintenancePeriods: object expected"); + message.denyMaintenancePeriods[i] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceUpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.maintenanceWindows = []; + object.denyMaintenancePeriods = []; + } + if (message.maintenanceWindows && message.maintenanceWindows.length) { + object.maintenanceWindows = []; + for (var j = 0; j < message.maintenanceWindows.length; ++j) + object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); + } + if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { + object.denyMaintenancePeriods = []; + for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) + object.denyMaintenancePeriods[j] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); + } + return object; + }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy"; + }; + + MaintenanceUpdatePolicy.MaintenanceWindow = (function() { + + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @interface IMaintenanceWindow + * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day + * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime + */ + + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.day = 0; + + /** + * MaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.day = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.day != null && message.hasOwnProperty("day")) + switch (message.day) { + default: + return "day: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.day = 0; + break; + case "MONDAY": + case 1: + message.day = 1; + break; + case "TUESDAY": + case 2: + message.day = 2; + break; + case "WEDNESDAY": + case 3: + message.day = 3; + break; + case "THURSDAY": + case 4: + message.day = 4; + break; + case "FRIDAY": + case 5: + message.day = 5; + break; + case "SATURDAY": + case 6: + message.day = 6; + break; + case "SUNDAY": + case 7: + message.day = 7; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.day != null && message.hasOwnProperty("day")) + object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + MaintenanceUpdatePolicy.DenyMaintenancePeriod = (function() { + + /** + * Properties of a DenyMaintenancePeriod. + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @interface IDenyMaintenancePeriod + * @property {google.type.IDate|null} [startDate] DenyMaintenancePeriod startDate + * @property {google.type.IDate|null} [endDate] DenyMaintenancePeriod endDate + * @property {google.type.ITimeOfDay|null} [time] DenyMaintenancePeriod time + */ + + /** + * Constructs a new DenyMaintenancePeriod. + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy + * @classdesc Represents a DenyMaintenancePeriod. + * @implements IDenyMaintenancePeriod + * @constructor + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set + */ + function DenyMaintenancePeriod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenyMaintenancePeriod startDate. + * @member {google.type.IDate|null|undefined} startDate + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.startDate = null; + + /** + * DenyMaintenancePeriod endDate. + * @member {google.type.IDate|null|undefined} endDate + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.endDate = null; + + /** + * DenyMaintenancePeriod time. + * @member {google.type.ITimeOfDay|null|undefined} time + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.time = null; + + /** + * Creates a new DenyMaintenancePeriod instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod instance + */ + DenyMaintenancePeriod.create = function create(properties) { + return new DenyMaintenancePeriod(properties); + }; + + /** + * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenyMaintenancePeriod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) + $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) + $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenyMaintenancePeriod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 3: { + message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenyMaintenancePeriod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenyMaintenancePeriod message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenyMaintenancePeriod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startDate != null && message.hasOwnProperty("startDate")) { + var error = $root.google.type.Date.verify(message.startDate); + if (error) + return "startDate." + error; + } + if (message.endDate != null && message.hasOwnProperty("endDate")) { + var error = $root.google.type.Date.verify(message.endDate); + if (error) + return "endDate." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.type.TimeOfDay.verify(message.time); + if (error) + return "time." + error; + } + return null; + }; + + /** + * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + */ + DenyMaintenancePeriod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); + if (object.startDate != null) { + if (typeof object.startDate !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.startDate: object expected"); + message.startDate = $root.google.type.Date.fromObject(object.startDate); + } + if (object.endDate != null) { + if (typeof object.endDate !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.endDate: object expected"); + message.endDate = $root.google.type.Date.fromObject(object.endDate); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.time: object expected"); + message.time = $root.google.type.TimeOfDay.fromObject(object.time); + } + return message; + }; + + /** + * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} message DenyMaintenancePeriod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenyMaintenancePeriod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = null; + object.endDate = null; + object.time = null; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = $root.google.type.Date.toObject(message.startDate, options); + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = $root.google.type.Date.toObject(message.endDate, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.type.TimeOfDay.toObject(message.time, options); + return object; + }; + + /** + * Converts this DenyMaintenancePeriod to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + * @returns {Object.} JSON object + */ + DenyMaintenancePeriod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DenyMaintenancePeriod + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DenyMaintenancePeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod"; + }; + + return DenyMaintenancePeriod; + })(); + + return MaintenanceUpdatePolicy; + })(); + + v1alpha.MaintenanceSchedule = (function() { + + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1alpha + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + */ + + /** + * Constructs a new MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule=} [properties] Properties to set + */ + function MaintenanceSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceSchedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.MaintenanceSchedule} message MaintenanceSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTime = null; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceSchedule"; + }; + + return MaintenanceSchedule; + })(); + + v1alpha.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICluster + * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] Cluster backupSource + * @property {google.cloud.alloydb.v1alpha.IMigrationSource|null} [migrationSource] Cluster migrationSource + * @property {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] Cluster cloudsqlBackupRunSource + * @property {string|null} [name] Cluster name + * @property {string|null} [displayName] Cluster displayName + * @property {string|null} [uid] Cluster uid + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.alloydb.v1alpha.Cluster.State|null} [state] Cluster state + * @property {google.cloud.alloydb.v1alpha.Cluster.ClusterType|null} [clusterType] Cluster clusterType + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig + * @property {string|null} [network] Cluster network + * @property {string|null} [etag] Cluster etag + * @property {Object.|null} [annotations] Cluster annotations + * @property {boolean|null} [reconciling] Cluster reconciling + * @property {google.cloud.alloydb.v1alpha.IUserPassword|null} [initialUser] Cluster initialUser + * @property {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy + * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] Cluster sslConfig + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo + * @property {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig + * @property {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo + * @property {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig + * @property {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + * @property {boolean|null} [satisfiesPzi] Cluster satisfiesPzi + * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs + * @property {google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null} [pscConfig] Cluster pscConfig + * @property {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy + * @property {google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule + * @property {google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null} [geminiConfig] Cluster geminiConfig + * @property {google.cloud.alloydb.v1alpha.SubscriptionType|null} [subscriptionType] Cluster subscriptionType + * @property {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata + * @property {Object.|null} [tags] Cluster tags + * @property {string|null} [serviceAccountEmail] Cluster serviceAccountEmail + * @property {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.labels = {}; + this.annotations = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster backupSource. + * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.backupSource = null; + + /** + * Cluster migrationSource. + * @member {google.cloud.alloydb.v1alpha.IMigrationSource|null|undefined} migrationSource + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.migrationSource = null; + + /** + * Cluster cloudsqlBackupRunSource. + * @member {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.cloudsqlBackupRunSource = null; + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.displayName = ""; + + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.uid = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.deleteTime = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster state. + * @member {google.cloud.alloydb.v1alpha.Cluster.State} state + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster clusterType. + * @member {google.cloud.alloydb.v1alpha.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.clusterType = 0; + + /** + * Cluster databaseVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.databaseVersion = 0; + + /** + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.networkConfig = null; + + /** + * Cluster network. + * @member {string} network + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.network = ""; + + /** + * Cluster etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.etag = ""; + + /** + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.annotations = $util.emptyObject; + + /** + * Cluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.reconciling = false; + + /** + * Cluster initialUser. + * @member {google.cloud.alloydb.v1alpha.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.initialUser = null; + + /** + * Cluster automatedBackupPolicy. + * @member {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.automatedBackupPolicy = null; + + /** + * Cluster sslConfig. + * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.sslConfig = null; + + /** + * Cluster encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; + + /** + * Cluster encryptionInfo. + * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.encryptionInfo = null; + + /** + * Cluster continuousBackupConfig. + * @member {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null|undefined} continuousBackupConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.continuousBackupConfig = null; + + /** + * Cluster continuousBackupInfo. + * @member {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null|undefined} continuousBackupInfo + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.continuousBackupInfo = null; + + /** + * Cluster secondaryConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null|undefined} secondaryConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.secondaryConfig = null; + + /** + * Cluster primaryConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null|undefined} primaryConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.primaryConfig = null; + + /** + * Cluster satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.satisfiesPzi = false; + + /** + * Cluster satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.satisfiesPzs = false; + + /** + * Cluster pscConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null|undefined} pscConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.pscConfig = null; + + /** + * Cluster maintenanceUpdatePolicy. + * @member {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.maintenanceUpdatePolicy = null; + + /** + * Cluster maintenanceSchedule. + * @member {google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.maintenanceSchedule = null; + + /** + * Cluster geminiConfig. + * @member {google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null|undefined} geminiConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.geminiConfig = null; + + /** + * Cluster subscriptionType. + * @member {google.cloud.alloydb.v1alpha.SubscriptionType} subscriptionType + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.subscriptionType = 0; + + /** + * Cluster trialMetadata. + * @member {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null|undefined} trialMetadata + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.trialMetadata = null; + + /** + * Cluster tags. + * @member {Object.} tags + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.tags = $util.emptyObject; + + /** + * Cluster serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.serviceAccountEmail = ""; + + /** + * Cluster dataplexConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null|undefined} dataplexConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.dataplexConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|"cloudsqlBackupRunSource"|undefined} source + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource", "cloudsqlBackupRunSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.alloydb.v1alpha.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) + $root.google.cloud.alloydb.v1alpha.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) + $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) + $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.encode(message.pscConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) + $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzi); + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) + $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.encode(message.geminiConfig, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.subscriptionType != null && Object.hasOwnProperty.call(message, "subscriptionType")) + writer.uint32(/* id 38, wireType 0 =*/304).int32(message.subscriptionType); + if (message.trialMetadata != null && Object.hasOwnProperty.call(message, "trialMetadata")) + $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.encode(message.trialMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) + $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 46, wireType 2 =*/370).string(message.serviceAccountEmail); + if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 15: { + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); + break; + } + case 16: { + message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.decode(reader, reader.uint32()); + break; + } + case 42: { + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 24: { + message.clusterType = reader.int32(); + break; + } + case 9: { + message.databaseVersion = reader.int32(); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.network = reader.string(); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 13: { + message.reconciling = reader.bool(); + break; + } + case 14: { + message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.decode(reader, reader.uint32()); + break; + } + case 17: { + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 18: { + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 27: { + message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.decode(reader, reader.uint32()); + break; + } + case 22: { + message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + break; + } + case 33: { + message.satisfiesPzi = reader.bool(); + break; + } + case 30: { + message.satisfiesPzs = reader.bool(); + break; + } + case 31: { + message.pscConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.decode(reader, reader.uint32()); + break; + } + case 32: { + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); + break; + } + case 37: { + message.maintenanceSchedule = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.decode(reader, reader.uint32()); + break; + } + case 36: { + message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.decode(reader, reader.uint32()); + break; + } + case 38: { + message.subscriptionType = reader.int32(); + break; + } + case 39: { + message.trialMetadata = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.decode(reader, reader.uint32()); + break; + } + case 41: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + case 46: { + message.serviceAccountEmail = reader.string(); + break; + } + case 47: { + message.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.MigrationSource.verify(message.migrationSource); + if (error) + return "migrationSource." + error; + } + } + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); + if (error) + return "cloudsqlBackupRunSource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.alloydb.v1alpha.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify(message.continuousBackupConfig); + if (error) + return "continuousBackupConfig." + error; + } + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify(message.continuousBackupInfo); + if (error) + return "continuousBackupInfo." + error; + } + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify(message.secondaryConfig); + if (error) + return "secondaryConfig." + error; + } + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (error) + return "primaryConfig." + error; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify(message.pscConfig); + if (error) + return "pscConfig." + error; + } + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { + var error = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); + if (error) + return "maintenanceUpdatePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify(message.geminiConfig); + if (error) + return "geminiConfig." + error; + } + if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) + switch (message.subscriptionType) { + default: + return "subscriptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify(message.trialMetadata); + if (error) + return "trialMetadata." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify(message.dataplexConfig); + if (error) + return "dataplexConfig." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); + } + if (object.migrationSource != null) { + if (typeof object.migrationSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.migrationSource: object expected"); + message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.fromObject(object.migrationSource); + } + if (object.cloudsqlBackupRunSource != null) { + if (typeof object.cloudsqlBackupRunSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.cloudsqlBackupRunSource: object expected"); + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "EMPTY": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 7: + message.state = 7; + break; + case "MAINTENANCE": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.databaseVersion = 6; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.fromObject(object.networkConfig); + } + if (object.network != null) + message.network = String(object.network); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.initialUser: object expected"); + message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.fromObject(object.initialUser); + } + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.continuousBackupConfig != null) { + if (typeof object.continuousBackupConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupConfig: object expected"); + message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); + } + if (object.continuousBackupInfo != null) { + if (typeof object.continuousBackupInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupInfo: object expected"); + message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); + } + if (object.secondaryConfig != null) { + if (typeof object.secondaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.secondaryConfig: object expected"); + message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); + } + if (object.primaryConfig != null) { + if (typeof object.primaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.primaryConfig: object expected"); + message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + } + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.pscConfig != null) { + if (typeof object.pscConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.pscConfig: object expected"); + message.pscConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.fromObject(object.pscConfig); + } + if (object.maintenanceUpdatePolicy != null) { + if (typeof object.maintenanceUpdatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.maintenanceUpdatePolicy: object expected"); + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } + if (object.geminiConfig != null) { + if (typeof object.geminiConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.geminiConfig: object expected"); + message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.fromObject(object.geminiConfig); + } + switch (object.subscriptionType) { + default: + if (typeof object.subscriptionType === "number") { + message.subscriptionType = object.subscriptionType; + break; + } + break; + case "SUBSCRIPTION_TYPE_UNSPECIFIED": + case 0: + message.subscriptionType = 0; + break; + case "STANDARD": + case 1: + message.subscriptionType = 1; + break; + case "TRIAL": + case 2: + message.subscriptionType = 2; + break; + } + if (object.trialMetadata != null) { + if (typeof object.trialMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.trialMetadata: object expected"); + message.trialMetadata = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.fromObject(object.trialMetadata); + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.dataplexConfig != null) { + if (typeof object.dataplexConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.dataplexConfig: object expected"); + message.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.fromObject(object.dataplexConfig); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.network = ""; + object.etag = ""; + object.reconciling = false; + object.initialUser = null; + object.automatedBackupPolicy = null; + object.sslConfig = null; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.secondaryConfig = null; + object.primaryConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.continuousBackupConfig = null; + object.continuousBackupInfo = null; + object.networkConfig = null; + object.satisfiesPzs = false; + object.pscConfig = null; + object.maintenanceUpdatePolicy = null; + object.satisfiesPzi = false; + object.geminiConfig = null; + object.maintenanceSchedule = null; + object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; + object.trialMetadata = null; + object.serviceAccountEmail = ""; + object.dataplexConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] : message.state; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.toObject(message.initialUser, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + object.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.toObject(message.migrationSource, options); + if (options.oneofs) + object.source = "migrationSource"; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) + object.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) + object.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) + object.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) + object.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) + object.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.toObject(message.networkConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) + object.pscConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.toObject(message.pscConfig, options); + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) + object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) + object.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.toObject(message.geminiConfig, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); + if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) + object.subscriptionType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SubscriptionType[message.subscriptionType] === undefined ? message.subscriptionType : $root.google.cloud.alloydb.v1alpha.SubscriptionType[message.subscriptionType] : message.subscriptionType; + if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) + object.trialMetadata = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.toObject(message.trialMetadata, options); + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); + if (options.oneofs) + object.source = "cloudsqlBackupRunSource"; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) + object.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster"; + }; + + Cluster.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.NetworkConfig"; + }; + + return NetworkConfig; + })(); + + Cluster.SecondaryConfig = (function() { + + /** + * Properties of a SecondaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface ISecondaryConfig + * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName + */ + + /** + * Constructs a new SecondaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a SecondaryConfig. + * @implements ISecondaryConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set + */ + function SecondaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecondaryConfig primaryClusterName. + * @member {string} primaryClusterName + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @instance + */ + SecondaryConfig.prototype.primaryClusterName = ""; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig instance + */ + SecondaryConfig.create = function create(properties) { + return new SecondaryConfig(properties); + }; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); + return writer; + }; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.primaryClusterName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecondaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecondaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + if (!$util.isString(message.primaryClusterName)) + return "primaryClusterName: string expected"; + return null; + }; + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig + */ + SecondaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); + if (object.primaryClusterName != null) + message.primaryClusterName = String(object.primaryClusterName); + return message; + }; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} message SecondaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecondaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.primaryClusterName = ""; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + object.primaryClusterName = message.primaryClusterName; + return object; + }; + + /** + * Converts this SecondaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @instance + * @returns {Object.} JSON object + */ + SecondaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecondaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig"; + }; + + return SecondaryConfig; + })(); + + Cluster.PrimaryConfig = (function() { + + /** + * Properties of a PrimaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface IPrimaryConfig + * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames + */ + + /** + * Constructs a new PrimaryConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a PrimaryConfig. + * @implements IPrimaryConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set + */ + function PrimaryConfig(properties) { + this.secondaryClusterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryConfig secondaryClusterNames. + * @member {Array.} secondaryClusterNames + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @instance + */ + PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig instance + */ + PrimaryConfig.create = function create(properties) { + return new PrimaryConfig(properties); + }; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); + return writer; + }; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) + message.secondaryClusterNames = []; + message.secondaryClusterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { + if (!Array.isArray(message.secondaryClusterNames)) + return "secondaryClusterNames: array expected"; + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + if (!$util.isString(message.secondaryClusterNames[i])) + return "secondaryClusterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig + */ + PrimaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); + if (object.secondaryClusterNames) { + if (!Array.isArray(object.secondaryClusterNames)) + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); + message.secondaryClusterNames = []; + for (var i = 0; i < object.secondaryClusterNames.length; ++i) + message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} message PrimaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryClusterNames = []; + if (message.secondaryClusterNames && message.secondaryClusterNames.length) { + object.secondaryClusterNames = []; + for (var j = 0; j < message.secondaryClusterNames.length; ++j) + object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; + } + return object; + }; + + /** + * Converts this PrimaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @instance + * @returns {Object.} JSON object + */ + PrimaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig"; + }; + + return PrimaryConfig; + })(); + + Cluster.PscConfig = (function() { + + /** + * Properties of a PscConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface IPscConfig + * @property {boolean|null} [pscEnabled] PscConfig pscEnabled + * @property {number|Long|null} [serviceOwnedProjectNumber] PscConfig serviceOwnedProjectNumber + */ + + /** + * Constructs a new PscConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a PscConfig. + * @implements IPscConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig=} [properties] Properties to set + */ + function PscConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscConfig pscEnabled. + * @member {boolean} pscEnabled + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @instance + */ + PscConfig.prototype.pscEnabled = false; + + /** + * PscConfig serviceOwnedProjectNumber. + * @member {number|Long} serviceOwnedProjectNumber + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @instance + */ + PscConfig.prototype.serviceOwnedProjectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PscConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig instance + */ + PscConfig.create = function create(properties) { + return new PscConfig(properties); + }; + + /** + * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig} message PscConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); + if (message.serviceOwnedProjectNumber != null && Object.hasOwnProperty.call(message, "serviceOwnedProjectNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.serviceOwnedProjectNumber); + return writer; + }; + + /** + * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig} message PscConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pscEnabled = reader.bool(); + break; + } + case 3: { + message.serviceOwnedProjectNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (typeof message.pscEnabled !== "boolean") + return "pscEnabled: boolean expected"; + if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) + if (!$util.isInteger(message.serviceOwnedProjectNumber) && !(message.serviceOwnedProjectNumber && $util.isInteger(message.serviceOwnedProjectNumber.low) && $util.isInteger(message.serviceOwnedProjectNumber.high))) + return "serviceOwnedProjectNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig + */ + PscConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig(); + if (object.pscEnabled != null) + message.pscEnabled = Boolean(object.pscEnabled); + if (object.serviceOwnedProjectNumber != null) + if ($util.Long) + (message.serviceOwnedProjectNumber = $util.Long.fromValue(object.serviceOwnedProjectNumber)).unsigned = false; + else if (typeof object.serviceOwnedProjectNumber === "string") + message.serviceOwnedProjectNumber = parseInt(object.serviceOwnedProjectNumber, 10); + else if (typeof object.serviceOwnedProjectNumber === "number") + message.serviceOwnedProjectNumber = object.serviceOwnedProjectNumber; + else if (typeof object.serviceOwnedProjectNumber === "object") + message.serviceOwnedProjectNumber = new $util.LongBits(object.serviceOwnedProjectNumber.low >>> 0, object.serviceOwnedProjectNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PscConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.PscConfig} message PscConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pscEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.serviceOwnedProjectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.serviceOwnedProjectNumber = options.longs === String ? "0" : 0; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) + if (typeof message.serviceOwnedProjectNumber === "number") + object.serviceOwnedProjectNumber = options.longs === String ? String(message.serviceOwnedProjectNumber) : message.serviceOwnedProjectNumber; + else + object.serviceOwnedProjectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.serviceOwnedProjectNumber) : options.longs === Number ? new $util.LongBits(message.serviceOwnedProjectNumber.low >>> 0, message.serviceOwnedProjectNumber.high >>> 0).toNumber() : message.serviceOwnedProjectNumber; + return object; + }; + + /** + * Converts this PscConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @instance + * @returns {Object.} JSON object + */ + PscConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.PscConfig"; + }; + + return PscConfig; + })(); + + Cluster.TrialMetadata = (function() { + + /** + * Properties of a TrialMetadata. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface ITrialMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] TrialMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TrialMetadata endTime + * @property {google.protobuf.ITimestamp|null} [upgradeTime] TrialMetadata upgradeTime + * @property {google.protobuf.ITimestamp|null} [graceEndTime] TrialMetadata graceEndTime + */ + + /** + * Constructs a new TrialMetadata. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a TrialMetadata. + * @implements ITrialMetadata + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata=} [properties] Properties to set + */ + function TrialMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.startTime = null; + + /** + * TrialMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.endTime = null; + + /** + * TrialMetadata upgradeTime. + * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.upgradeTime = null; + + /** + * TrialMetadata graceEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} graceEndTime + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.graceEndTime = null; + + /** + * Creates a new TrialMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata instance + */ + TrialMetadata.create = function create(properties) { + return new TrialMetadata(properties); + }; + + /** + * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) + $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.graceEndTime != null && Object.hasOwnProperty.call(message, "graceEndTime")) + $root.google.protobuf.Timestamp.encode(message.graceEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.graceEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); + if (error) + return "upgradeTime." + error; + } + if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.graceEndTime); + if (error) + return "graceEndTime." + error; + } + return null; + }; + + /** + * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata + */ + TrialMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.upgradeTime != null) { + if (typeof object.upgradeTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.upgradeTime: object expected"); + message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); + } + if (object.graceEndTime != null) { + if (typeof object.graceEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.graceEndTime: object expected"); + message.graceEndTime = $root.google.protobuf.Timestamp.fromObject(object.graceEndTime); + } + return message; + }; + + /** + * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} message TrialMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.upgradeTime = null; + object.graceEndTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) + object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); + if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) + object.graceEndTime = $root.google.protobuf.Timestamp.toObject(message.graceEndTime, options); + return object; + }; + + /** + * Converts this TrialMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @instance + * @returns {Object.} JSON object + */ + TrialMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.TrialMetadata"; + }; + + return TrialMetadata; + })(); + + Cluster.DataplexConfig = (function() { + + /** + * Properties of a DataplexConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface IDataplexConfig + * @property {boolean|null} [enabled] DataplexConfig enabled + */ + + /** + * Constructs a new DataplexConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a DataplexConfig. + * @implements IDataplexConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig=} [properties] Properties to set + */ + function DataplexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataplexConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @instance + */ + DataplexConfig.prototype.enabled = false; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig instance + */ + DataplexConfig.create = function create(properties) { + return new DataplexConfig(properties); + }; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataplexConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataplexConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig + */ + DataplexConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} message DataplexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataplexConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this DataplexConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @instance + * @returns {Object.} JSON object + */ + DataplexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataplexConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.DataplexConfig"; + }; + + return DataplexConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} EMPTY=3 EMPTY value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value + * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} PROMOTING=9 PROMOTING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "EMPTY"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "BOOTSTRAPPING"] = 7; + values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * ClusterType enum. + * @name google.cloud.alloydb.v1alpha.Cluster.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} SECONDARY=2 SECONDARY value + */ + Cluster.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "SECONDARY"] = 2; + return values; + })(); + + return Cluster; + })(); + + v1alpha.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.alloydb.v1alpha + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [uid] Instance uid + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {Object.|null} [labels] Instance labels + * @property {google.cloud.alloydb.v1alpha.Instance.State|null} [state] Instance state + * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig + * @property {google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType + * @property {string|null} [gceZone] Instance gceZone + * @property {Object.|null} [databaseFlags] Instance databaseFlags + * @property {google.cloud.alloydb.v1alpha.Instance.INode|null} [writableNode] Instance writableNode + * @property {Array.|null} [nodes] Instance nodes + * @property {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig + * @property {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null} [observabilityConfig] Instance observabilityConfig + * @property {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig + * @property {string|null} [ipAddress] Instance ipAddress + * @property {string|null} [publicIpAddress] Instance publicIpAddress + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy + * @property {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig + * @property {boolean|null} [satisfiesPzi] Instance satisfiesPzi + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig + * @property {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig + * @property {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null} [geminiConfig] Instance geminiConfig + * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses + * @property {google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|null} [activationPolicy] Instance activationPolicy + * @property {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null} [connectionPoolConfig] Instance connectionPoolConfig + * @property {google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null} [gcaConfig] Instance gcaConfig + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.databaseFlags = {}; + this.nodes = []; + this.annotations = {}; + this.outboundPublicIpAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance state. + * @member {google.cloud.alloydb.v1alpha.Instance.State} state + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance instanceType. + * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.instanceType = 0; + + /** + * Instance machineConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.machineConfig = null; + + /** + * Instance availabilityType. + * @member {google.cloud.alloydb.v1alpha.Instance.AvailabilityType} availabilityType + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.availabilityType = 0; + + /** + * Instance gceZone. + * @member {string} gceZone + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.gceZone = ""; + + /** + * Instance databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.databaseFlags = $util.emptyObject; + + /** + * Instance writableNode. + * @member {google.cloud.alloydb.v1alpha.Instance.INode|null|undefined} writableNode + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.writableNode = null; + + /** + * Instance nodes. + * @member {Array.} nodes + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.nodes = $util.emptyArray; + + /** + * Instance queryInsightsConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.queryInsightsConfig = null; + + /** + * Instance observabilityConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null|undefined} observabilityConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.observabilityConfig = null; + + /** + * Instance readPoolConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null|undefined} readPoolConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.readPoolConfig = null; + + /** + * Instance ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.ipAddress = ""; + + /** + * Instance publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.publicIpAddress = ""; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.etag = ""; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance updatePolicy. + * @member {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null|undefined} updatePolicy + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.updatePolicy = null; + + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + + /** + * Instance satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.satisfiesPzi = false; + + /** + * Instance satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = false; + + /** + * Instance pscInstanceConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null|undefined} pscInstanceConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.pscInstanceConfig = null; + + /** + * Instance networkConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.networkConfig = null; + + /** + * Instance geminiConfig. + * @member {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null|undefined} geminiConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.geminiConfig = null; + + /** + * Instance outboundPublicIpAddresses. + * @member {Array.} outboundPublicIpAddresses + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; + + /** + * Instance activationPolicy. + * @member {google.cloud.alloydb.v1alpha.Instance.ActivationPolicy} activationPolicy + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.activationPolicy = 0; + + /** + * Instance connectionPoolConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null|undefined} connectionPoolConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.connectionPoolConfig = null; + + /** + * Instance gcaConfig. + * @member {google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null|undefined} gcaConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.gcaConfig = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) + $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) + $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); + if (message.observabilityConfig != null && Object.hasOwnProperty.call(message, "observabilityConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.encode(message.observabilityConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.publicIpAddress); + if (message.pscInstanceConfig != null && Object.hasOwnProperty.call(message, "pscInstanceConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzi); + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) + $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) + writer.uint32(/* id 35, wireType 0 =*/280).int32(message.activationPolicy); + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.gcaConfig != null && Object.hasOwnProperty.call(message, "gcaConfig")) + $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.encode(message.gcaConfig, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.instanceType = reader.int32(); + break; + } + case 10: { + message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.availabilityType = reader.int32(); + break; + } + case 12: { + message.gceZone = reader.string(); + break; + } + case 13: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.databaseFlags[key] = value; + break; + } + case 19: { + message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 26: { + message.observabilityConfig = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ipAddress = reader.string(); + break; + } + case 27: { + message.publicIpAddress = reader.string(); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 18: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 22: { + message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.decode(reader, reader.uint32()); + break; + } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } + case 30: { + message.satisfiesPzi = reader.bool(); + break; + } + case 24: { + message.satisfiesPzs = reader.bool(); + break; + } + case 28: { + message.pscInstanceConfig = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); + break; + } + case 33: { + message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 34: { + if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) + message.outboundPublicIpAddresses = []; + message.outboundPublicIpAddresses.push(reader.string()); + break; + } + case 35: { + message.activationPolicy = reader.int32(); + break; + } + case 37: { + message.connectionPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.decode(reader, reader.uint32()); + break; + } + case 38: { + message.gcaConfig = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify(message.machineConfig); + if (error) + return "machineConfig." + error; + } + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (!$util.isString(message.gceZone)) + return "gceZone: string expected"; + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.writableNode); + if (error) + return "writableNode." + error; + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (error) + return "queryInsightsConfig." + error; + } + if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify(message.observabilityConfig); + if (error) + return "observabilityConfig." + error; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (error) + return "readPoolConfig." + error; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify(message.updatePolicy); + if (error) + return "updatePolicy." + error; + } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify(message.pscInstanceConfig); + if (error) + return "pscInstanceConfig." + error; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify(message.geminiConfig); + if (error) + return "geminiConfig." + error; + } + if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { + if (!Array.isArray(message.outboundPublicIpAddresses)) + return "outboundPublicIpAddresses: array expected"; + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + if (!$util.isString(message.outboundPublicIpAddresses[i])) + return "outboundPublicIpAddresses: string[] expected"; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + switch (message.activationPolicy) { + default: + return "activationPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify(message.connectionPoolConfig); + if (error) + return "connectionPoolConfig." + error; + } + if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify(message.gcaConfig); + if (error) + return "gcaConfig." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "MAINTENANCE": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.fromObject(object.machineConfig); + } + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + if (object.gceZone != null) + message.gceZone = String(object.gceZone); + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.writableNode != null) { + if (typeof object.writableNode !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.writableNode: object expected"); + message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.writableNode); + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: object expected"); + message.nodes[i] = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.nodes[i]); + } + } + if (object.queryInsightsConfig != null) { + if (typeof object.queryInsightsConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.queryInsightsConfig: object expected"); + message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); + } + if (object.observabilityConfig != null) { + if (typeof object.observabilityConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.observabilityConfig: object expected"); + message.observabilityConfig = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.fromObject(object.observabilityConfig); + } + if (object.readPoolConfig != null) { + if (typeof object.readPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.readPoolConfig: object expected"); + message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); + } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.updatePolicy != null) { + if (typeof object.updatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.updatePolicy: object expected"); + message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.fromObject(object.updatePolicy); + } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.pscInstanceConfig != null) { + if (typeof object.pscInstanceConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.pscInstanceConfig: object expected"); + message.pscInstanceConfig = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.fromObject(object.pscInstanceConfig); + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); + } + if (object.geminiConfig != null) { + if (typeof object.geminiConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.geminiConfig: object expected"); + message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.fromObject(object.geminiConfig); + } + if (object.outboundPublicIpAddresses) { + if (!Array.isArray(object.outboundPublicIpAddresses)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.outboundPublicIpAddresses: array expected"); + message.outboundPublicIpAddresses = []; + for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) + message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); + } + switch (object.activationPolicy) { + default: + if (typeof object.activationPolicy === "number") { + message.activationPolicy = object.activationPolicy; + break; + } + break; + case "ACTIVATION_POLICY_UNSPECIFIED": + case 0: + message.activationPolicy = 0; + break; + case "ALWAYS": + case 1: + message.activationPolicy = 1; + break; + case "NEVER": + case 2: + message.activationPolicy = 2; + break; + } + if (object.connectionPoolConfig != null) { + if (typeof object.connectionPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.connectionPoolConfig: object expected"); + message.connectionPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.fromObject(object.connectionPoolConfig); + } + if (object.gcaConfig != null) { + if (typeof object.gcaConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.gcaConfig: object expected"); + message.gcaConfig = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.fromObject(object.gcaConfig); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {google.cloud.alloydb.v1alpha.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nodes = []; + object.outboundPublicIpAddresses = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.databaseFlags = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.machineConfig = null; + object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.gceZone = ""; + object.readPoolConfig = null; + object.ipAddress = ""; + object.reconciling = false; + object.etag = ""; + object.writableNode = null; + object.queryInsightsConfig = null; + object.updatePolicy = null; + object.clientConnectionConfig = null; + object.satisfiesPzs = false; + object.observabilityConfig = null; + object.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = null; + object.satisfiesPzi = false; + object.geminiConfig = null; + object.activationPolicy = options.enums === String ? "ACTIVATION_POLICY_UNSPECIFIED" : 0; + object.connectionPoolConfig = null; + object.gcaConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] : message.state; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.toObject(message.machineConfig, options); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + object.gceZone = message.gceZone; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) + object.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) + object.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.writableNode, options); + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.nodes[j], options); + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) + object.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) + object.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.toObject(message.updatePolicy, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) + object.observabilityConfig = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.toObject(message.observabilityConfig, options); + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) + object.pscInstanceConfig = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) + object.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.toObject(message.geminiConfig, options); + if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { + object.outboundPublicIpAddresses = []; + for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) + object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + object.activationPolicy = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.ActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.alloydb.v1alpha.Instance.ActivationPolicy[message.activationPolicy] : message.activationPolicy; + if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) + object.connectionPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); + if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) + object.gcaConfig = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.toObject(message.gcaConfig, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance"; + }; + + Instance.MachineConfig = (function() { + + /** + * Properties of a MachineConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + * @property {string|null} [machineType] MachineConfig machineType + */ + + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; + + /** + * MachineConfig machineType. + * @member {string} machineType + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.machineType = ""; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 4: { + message.machineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + return null; + }; + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig + */ + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.MachineConfig} message MachineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.machineType = ""; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; + + /** + * Converts this MachineConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @instance + * @returns {Object.} JSON object + */ + MachineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.MachineConfig"; + }; + + return MachineConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface INode + * @property {string|null} [zoneId] Node zoneId + * @property {string|null} [id] Node id + * @property {string|null} [ip] Node ip + * @property {string|null} [state] Node state + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node zoneId. + * @member {string} zoneId + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.zoneId = ""; + + /** + * Node id. + * @member {string} id + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.id = ""; + + /** + * Node ip. + * @member {string} ip + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.ip = ""; + + /** + * Node state. + * @member {string} state + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + */ + Node.prototype.state = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.ip = reader.string(); + break; + } + case 4: { + message.state = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.Node) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.state != null) + message.state = String(object.state); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zoneId = ""; + object.id = ""; + object.ip = ""; + object.state = ""; + } + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.Node"; + }; + + return Node; + })(); + + Instance.QueryInsightsInstanceConfig = (function() { + + /** + * Properties of a QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IQueryInsightsInstanceConfig + * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags + * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress + * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength + * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + */ + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a QueryInsightsInstanceConfig. + * @implements IQueryInsightsInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + */ + function QueryInsightsInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInsightsInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; + + /** + * QueryInsightsInstanceConfig recordClientAddress. + * @member {boolean|null|undefined} recordClientAddress + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordClientAddress = null; + + /** + * QueryInsightsInstanceConfig queryStringLength. + * @member {number} queryStringLength + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryStringLength = 0; + + /** + * QueryInsightsInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + */ + QueryInsightsInstanceConfig.create = function create(properties) { + return new QueryInsightsInstanceConfig(properties); + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + return writer; + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.recordApplicationTags = reader.bool(); + break; + } + case 3: { + message.recordClientAddress = reader.bool(); + break; + } + case 4: { + message.queryStringLength = reader.uint32(); + break; + } + case 5: { + message.queryPlansPerMinute = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInsightsInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + properties._recordClientAddress = 1; + if (typeof message.recordClientAddress !== "boolean") + return "recordClientAddress: boolean expected"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + if (!$util.isInteger(message.queryStringLength)) + return "queryStringLength: integer expected"; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + return null; + }; + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + */ + QueryInsightsInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.recordClientAddress != null) + message.recordClientAddress = Boolean(object.recordClientAddress); + if (object.queryStringLength != null) + message.queryStringLength = object.queryStringLength >>> 0; + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + return message; + }; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryStringLength = 0; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + object.recordClientAddress = message.recordClientAddress; + if (options.oneofs) + object._recordClientAddress = "recordClientAddress"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + object.queryStringLength = message.queryStringLength; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + return object; + }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig"; + }; + + return QueryInsightsInstanceConfig; + })(); + + Instance.ObservabilityInstanceConfig = (function() { + + /** + * Properties of an ObservabilityInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IObservabilityInstanceConfig + * @property {boolean|null} [enabled] ObservabilityInstanceConfig enabled + * @property {boolean|null} [preserveComments] ObservabilityInstanceConfig preserveComments + * @property {boolean|null} [trackWaitEvents] ObservabilityInstanceConfig trackWaitEvents + * @property {boolean|null} [trackWaitEventTypes] ObservabilityInstanceConfig trackWaitEventTypes + * @property {number|null} [maxQueryStringLength] ObservabilityInstanceConfig maxQueryStringLength + * @property {boolean|null} [recordApplicationTags] ObservabilityInstanceConfig recordApplicationTags + * @property {number|null} [queryPlansPerMinute] ObservabilityInstanceConfig queryPlansPerMinute + * @property {boolean|null} [trackActiveQueries] ObservabilityInstanceConfig trackActiveQueries + * @property {boolean|null} [trackClientAddress] ObservabilityInstanceConfig trackClientAddress + * @property {boolean|null} [assistiveExperiencesEnabled] ObservabilityInstanceConfig assistiveExperiencesEnabled + */ + + /** + * Constructs a new ObservabilityInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents an ObservabilityInstanceConfig. + * @implements IObservabilityInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig=} [properties] Properties to set + */ + function ObservabilityInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObservabilityInstanceConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.enabled = null; + + /** + * ObservabilityInstanceConfig preserveComments. + * @member {boolean|null|undefined} preserveComments + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.preserveComments = null; + + /** + * ObservabilityInstanceConfig trackWaitEvents. + * @member {boolean|null|undefined} trackWaitEvents + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackWaitEvents = null; + + /** + * ObservabilityInstanceConfig trackWaitEventTypes. + * @member {boolean|null|undefined} trackWaitEventTypes + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackWaitEventTypes = null; + + /** + * ObservabilityInstanceConfig maxQueryStringLength. + * @member {number|null|undefined} maxQueryStringLength + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.maxQueryStringLength = null; + + /** + * ObservabilityInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.recordApplicationTags = null; + + /** + * ObservabilityInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.queryPlansPerMinute = null; + + /** + * ObservabilityInstanceConfig trackActiveQueries. + * @member {boolean|null|undefined} trackActiveQueries + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackActiveQueries = null; + + /** + * ObservabilityInstanceConfig trackClientAddress. + * @member {boolean|null|undefined} trackClientAddress + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackClientAddress = null; + + /** + * ObservabilityInstanceConfig assistiveExperiencesEnabled. + * @member {boolean|null|undefined} assistiveExperiencesEnabled + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.assistiveExperiencesEnabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_preserveComments", { + get: $util.oneOfGetter($oneOfFields = ["preserveComments"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEvents", { + get: $util.oneOfGetter($oneOfFields = ["trackWaitEvents"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEventTypes", { + get: $util.oneOfGetter($oneOfFields = ["trackWaitEventTypes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_maxQueryStringLength", { + get: $util.oneOfGetter($oneOfFields = ["maxQueryStringLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackActiveQueries", { + get: $util.oneOfGetter($oneOfFields = ["trackActiveQueries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["trackClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_assistiveExperiencesEnabled", { + get: $util.oneOfGetter($oneOfFields = ["assistiveExperiencesEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObservabilityInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig instance + */ + ObservabilityInstanceConfig.create = function create(properties) { + return new ObservabilityInstanceConfig(properties); + }; + + /** + * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservabilityInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.preserveComments != null && Object.hasOwnProperty.call(message, "preserveComments")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.preserveComments); + if (message.trackWaitEvents != null && Object.hasOwnProperty.call(message, "trackWaitEvents")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trackWaitEvents); + if (message.trackWaitEventTypes != null && Object.hasOwnProperty.call(message, "trackWaitEventTypes")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.trackWaitEventTypes); + if (message.maxQueryStringLength != null && Object.hasOwnProperty.call(message, "maxQueryStringLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxQueryStringLength); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recordApplicationTags); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryPlansPerMinute); + if (message.trackActiveQueries != null && Object.hasOwnProperty.call(message, "trackActiveQueries")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.trackActiveQueries); + if (message.trackClientAddress != null && Object.hasOwnProperty.call(message, "trackClientAddress")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trackClientAddress); + if (message.assistiveExperiencesEnabled != null && Object.hasOwnProperty.call(message, "assistiveExperiencesEnabled")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.assistiveExperiencesEnabled); + return writer; + }; + + /** + * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservabilityInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservabilityInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.preserveComments = reader.bool(); + break; + } + case 3: { + message.trackWaitEvents = reader.bool(); + break; + } + case 4: { + message.trackWaitEventTypes = reader.bool(); + break; + } + case 5: { + message.maxQueryStringLength = reader.int32(); + break; + } + case 6: { + message.recordApplicationTags = reader.bool(); + break; + } + case 7: { + message.queryPlansPerMinute = reader.int32(); + break; + } + case 8: { + message.trackActiveQueries = reader.bool(); + break; + } + case 9: { + message.trackClientAddress = reader.bool(); + break; + } + case 10: { + message.assistiveExperiencesEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservabilityInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObservabilityInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObservabilityInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { + properties._preserveComments = 1; + if (typeof message.preserveComments !== "boolean") + return "preserveComments: boolean expected"; + } + if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { + properties._trackWaitEvents = 1; + if (typeof message.trackWaitEvents !== "boolean") + return "trackWaitEvents: boolean expected"; + } + if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { + properties._trackWaitEventTypes = 1; + if (typeof message.trackWaitEventTypes !== "boolean") + return "trackWaitEventTypes: boolean expected"; + } + if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { + properties._maxQueryStringLength = 1; + if (!$util.isInteger(message.maxQueryStringLength)) + return "maxQueryStringLength: integer expected"; + } + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { + properties._trackActiveQueries = 1; + if (typeof message.trackActiveQueries !== "boolean") + return "trackActiveQueries: boolean expected"; + } + if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { + properties._trackClientAddress = 1; + if (typeof message.trackClientAddress !== "boolean") + return "trackClientAddress: boolean expected"; + } + if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { + properties._assistiveExperiencesEnabled = 1; + if (typeof message.assistiveExperiencesEnabled !== "boolean") + return "assistiveExperiencesEnabled: boolean expected"; + } + return null; + }; + + /** + * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + */ + ObservabilityInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.preserveComments != null) + message.preserveComments = Boolean(object.preserveComments); + if (object.trackWaitEvents != null) + message.trackWaitEvents = Boolean(object.trackWaitEvents); + if (object.trackWaitEventTypes != null) + message.trackWaitEventTypes = Boolean(object.trackWaitEventTypes); + if (object.maxQueryStringLength != null) + message.maxQueryStringLength = object.maxQueryStringLength | 0; + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute | 0; + if (object.trackActiveQueries != null) + message.trackActiveQueries = Boolean(object.trackActiveQueries); + if (object.trackClientAddress != null) + message.trackClientAddress = Boolean(object.trackClientAddress); + if (object.assistiveExperiencesEnabled != null) + message.assistiveExperiencesEnabled = Boolean(object.assistiveExperiencesEnabled); + return message; + }; + + /** + * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} message ObservabilityInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObservabilityInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { + object.preserveComments = message.preserveComments; + if (options.oneofs) + object._preserveComments = "preserveComments"; + } + if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { + object.trackWaitEvents = message.trackWaitEvents; + if (options.oneofs) + object._trackWaitEvents = "trackWaitEvents"; + } + if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { + object.trackWaitEventTypes = message.trackWaitEventTypes; + if (options.oneofs) + object._trackWaitEventTypes = "trackWaitEventTypes"; + } + if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { + object.maxQueryStringLength = message.maxQueryStringLength; + if (options.oneofs) + object._maxQueryStringLength = "maxQueryStringLength"; + } + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { + object.trackActiveQueries = message.trackActiveQueries; + if (options.oneofs) + object._trackActiveQueries = "trackActiveQueries"; + } + if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { + object.trackClientAddress = message.trackClientAddress; + if (options.oneofs) + object._trackClientAddress = "trackClientAddress"; + } + if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { + object.assistiveExperiencesEnabled = message.assistiveExperiencesEnabled; + if (options.oneofs) + object._assistiveExperiencesEnabled = "assistiveExperiencesEnabled"; + } + return object; + }; + + /** + * Converts this ObservabilityInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ObservabilityInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObservabilityInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObservabilityInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig"; + }; + + return ObservabilityInstanceConfig; + })(); + + Instance.ReadPoolConfig = (function() { + + /** + * Properties of a ReadPoolConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IReadPoolConfig + * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + */ + + /** + * Constructs a new ReadPoolConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a ReadPoolConfig. + * @implements IReadPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set + */ + function ReadPoolConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadPoolConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @instance + */ + ReadPoolConfig.prototype.nodeCount = 0; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig instance + */ + ReadPoolConfig.create = function create(properties) { + return new ReadPoolConfig(properties); + }; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + return null; + }; + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig + */ + ReadPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} message ReadPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeCount = 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + return object; + }; + + /** + * Converts this ReadPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ReadPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig"; + }; + + return ReadPoolConfig; + })(); + + Instance.UpdatePolicy = (function() { + + /** + * Properties of an UpdatePolicy. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IUpdatePolicy + * @property {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|null} [mode] UpdatePolicy mode + */ + + /** + * Constructs a new UpdatePolicy. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents an UpdatePolicy. + * @implements IUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy=} [properties] Properties to set + */ + function UpdatePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePolicy mode. + * @member {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode} mode + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @instance + */ + UpdatePolicy.prototype.mode = 0; + + /** + * Creates a new UpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy instance + */ + UpdatePolicy.create = function create(properties) { + return new UpdatePolicy(properties); + }; + + /** + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy + */ + UpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DEFAULT": + case 1: + message.mode = 1; + break; + case "FORCE_APPLY": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} message UpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this UpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + UpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.UpdatePolicy"; + }; + + /** + * Mode enum. + * @name google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} FORCE_APPLY=2 FORCE_APPLY value + */ + UpdatePolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "FORCE_APPLY"] = 2; + return values; + })(); + + return UpdatePolicy; + })(); + + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + + Instance.PscInterfaceConfig = (function() { + + /** + * Properties of a PscInterfaceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IPscInterfaceConfig + * @property {string|null} [networkAttachmentResource] PscInterfaceConfig networkAttachmentResource + */ + + /** + * Constructs a new PscInterfaceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a PscInterfaceConfig. + * @implements IPscInterfaceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig=} [properties] Properties to set + */ + function PscInterfaceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscInterfaceConfig networkAttachmentResource. + * @member {string} networkAttachmentResource + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.networkAttachmentResource = ""; + + /** + * Creates a new PscInterfaceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig instance + */ + PscInterfaceConfig.create = function create(properties) { + return new PscInterfaceConfig(properties); + }; + + /** + * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInterfaceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkAttachmentResource != null && Object.hasOwnProperty.call(message, "networkAttachmentResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkAttachmentResource); + return writer; + }; + + /** + * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInterfaceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInterfaceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.networkAttachmentResource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInterfaceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscInterfaceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscInterfaceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) + if (!$util.isString(message.networkAttachmentResource)) + return "networkAttachmentResource: string expected"; + return null; + }; + + /** + * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig + */ + PscInterfaceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig(); + if (object.networkAttachmentResource != null) + message.networkAttachmentResource = String(object.networkAttachmentResource); + return message; + }; + + /** + * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} message PscInterfaceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscInterfaceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.networkAttachmentResource = ""; + if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) + object.networkAttachmentResource = message.networkAttachmentResource; + return object; + }; + + /** + * Converts this PscInterfaceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @instance + * @returns {Object.} JSON object + */ + PscInterfaceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscInterfaceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscInterfaceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig"; + }; + + return PscInterfaceConfig; + })(); + + Instance.PscAutoConnectionConfig = (function() { + + /** + * Properties of a PscAutoConnectionConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IPscAutoConnectionConfig + * @property {string|null} [consumerProject] PscAutoConnectionConfig consumerProject + * @property {string|null} [consumerNetwork] PscAutoConnectionConfig consumerNetwork + * @property {string|null} [ipAddress] PscAutoConnectionConfig ipAddress + * @property {string|null} [status] PscAutoConnectionConfig status + * @property {string|null} [consumerNetworkStatus] PscAutoConnectionConfig consumerNetworkStatus + */ + + /** + * Constructs a new PscAutoConnectionConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a PscAutoConnectionConfig. + * @implements IPscAutoConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig=} [properties] Properties to set + */ + function PscAutoConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscAutoConnectionConfig consumerProject. + * @member {string} consumerProject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerProject = ""; + + /** + * PscAutoConnectionConfig consumerNetwork. + * @member {string} consumerNetwork + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerNetwork = ""; + + /** + * PscAutoConnectionConfig ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.ipAddress = ""; + + /** + * PscAutoConnectionConfig status. + * @member {string} status + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.status = ""; + + /** + * PscAutoConnectionConfig consumerNetworkStatus. + * @member {string} consumerNetworkStatus + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerNetworkStatus = ""; + + /** + * Creates a new PscAutoConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig instance + */ + PscAutoConnectionConfig.create = function create(properties) { + return new PscAutoConnectionConfig(properties); + }; + + /** + * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscAutoConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNetwork); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.consumerNetworkStatus); + return writer; + }; + + /** + * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscAutoConnectionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consumerProject = reader.string(); + break; + } + case 2: { + message.consumerNetwork = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + case 4: { + message.status = reader.string(); + break; + } + case 5: { + message.consumerNetworkStatus = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscAutoConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscAutoConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscAutoConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (!$util.isString(message.consumerProject)) + return "consumerProject: string expected"; + if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (!$util.isString(message.consumerNetwork)) + return "consumerNetwork: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) + if (!$util.isString(message.consumerNetworkStatus)) + return "consumerNetworkStatus: string expected"; + return null; + }; + + /** + * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + */ + PscAutoConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig(); + if (object.consumerProject != null) + message.consumerProject = String(object.consumerProject); + if (object.consumerNetwork != null) + message.consumerNetwork = String(object.consumerNetwork); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.status != null) + message.status = String(object.status); + if (object.consumerNetworkStatus != null) + message.consumerNetworkStatus = String(object.consumerNetworkStatus); + return message; + }; + + /** + * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} message PscAutoConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscAutoConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.consumerProject = ""; + object.consumerNetwork = ""; + object.ipAddress = ""; + object.status = ""; + object.consumerNetworkStatus = ""; + } + if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + object.consumerProject = message.consumerProject; + if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + object.consumerNetwork = message.consumerNetwork; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) + object.consumerNetworkStatus = message.consumerNetworkStatus; + return object; + }; + + /** + * Converts this PscAutoConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + PscAutoConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscAutoConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscAutoConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig"; + }; + + return PscAutoConnectionConfig; + })(); + + Instance.PscInstanceConfig = (function() { + + /** + * Properties of a PscInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IPscInstanceConfig + * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink + * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects + * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName + * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs + * @property {Array.|null} [pscAutoConnections] PscInstanceConfig pscAutoConnections + */ + + /** + * Constructs a new PscInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a PscInstanceConfig. + * @implements IPscInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig=} [properties] Properties to set + */ + function PscInstanceConfig(properties) { + this.allowedConsumerProjects = []; + this.pscInterfaceConfigs = []; + this.pscAutoConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscInstanceConfig serviceAttachmentLink. + * @member {string} serviceAttachmentLink + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.serviceAttachmentLink = ""; + + /** + * PscInstanceConfig allowedConsumerProjects. + * @member {Array.} allowedConsumerProjects + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.allowedConsumerProjects = $util.emptyArray; + + /** + * PscInstanceConfig pscDnsName. + * @member {string} pscDnsName + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscDnsName = ""; + + /** + * PscInstanceConfig pscInterfaceConfigs. + * @member {Array.} pscInterfaceConfigs + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; + + /** + * PscInstanceConfig pscAutoConnections. + * @member {Array.} pscAutoConnections + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscAutoConnections = $util.emptyArray; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig instance + */ + PscInstanceConfig.create = function create(properties) { + return new PscInstanceConfig(properties); + }; + + /** + * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAttachmentLink != null && Object.hasOwnProperty.call(message, "serviceAttachmentLink")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachmentLink); + if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) + for (var i = 0; i < message.allowedConsumerProjects.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); + if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscDnsName); + if (message.pscInterfaceConfigs != null && message.pscInterfaceConfigs.length) + for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.encode(message.pscInterfaceConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.pscAutoConnections != null && message.pscAutoConnections.length) + for (var i = 0; i < message.pscAutoConnections.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAttachmentLink = reader.string(); + break; + } + case 2: { + if (!(message.allowedConsumerProjects && message.allowedConsumerProjects.length)) + message.allowedConsumerProjects = []; + message.allowedConsumerProjects.push(reader.string()); + break; + } + case 7: { + message.pscDnsName = reader.string(); + break; + } + case 8: { + if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) + message.pscInterfaceConfigs = []; + message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.pscAutoConnections && message.pscAutoConnections.length)) + message.pscAutoConnections = []; + message.pscAutoConnections.push($root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) + if (!$util.isString(message.serviceAttachmentLink)) + return "serviceAttachmentLink: string expected"; + if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { + if (!Array.isArray(message.allowedConsumerProjects)) + return "allowedConsumerProjects: array expected"; + for (var i = 0; i < message.allowedConsumerProjects.length; ++i) + if (!$util.isString(message.allowedConsumerProjects[i])) + return "allowedConsumerProjects: string[] expected"; + } + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + if (!$util.isString(message.pscDnsName)) + return "pscDnsName: string expected"; + if (message.pscInterfaceConfigs != null && message.hasOwnProperty("pscInterfaceConfigs")) { + if (!Array.isArray(message.pscInterfaceConfigs)) + return "pscInterfaceConfigs: array expected"; + for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify(message.pscInterfaceConfigs[i]); + if (error) + return "pscInterfaceConfigs." + error; + } + } + if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (!Array.isArray(message.pscAutoConnections)) + return "pscAutoConnections: array expected"; + for (var i = 0; i < message.pscAutoConnections.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify(message.pscAutoConnections[i]); + if (error) + return "pscAutoConnections." + error; + } + } + return null; + }; + + /** + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig + */ + PscInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig(); + if (object.serviceAttachmentLink != null) + message.serviceAttachmentLink = String(object.serviceAttachmentLink); + if (object.allowedConsumerProjects) { + if (!Array.isArray(object.allowedConsumerProjects)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.allowedConsumerProjects: array expected"); + message.allowedConsumerProjects = []; + for (var i = 0; i < object.allowedConsumerProjects.length; ++i) + message.allowedConsumerProjects[i] = String(object.allowedConsumerProjects[i]); + } + if (object.pscDnsName != null) + message.pscDnsName = String(object.pscDnsName); + if (object.pscInterfaceConfigs) { + if (!Array.isArray(object.pscInterfaceConfigs)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscInterfaceConfigs: array expected"); + message.pscInterfaceConfigs = []; + for (var i = 0; i < object.pscInterfaceConfigs.length; ++i) { + if (typeof object.pscInterfaceConfigs[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscInterfaceConfigs: object expected"); + message.pscInterfaceConfigs[i] = $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.fromObject(object.pscInterfaceConfigs[i]); + } + } + if (object.pscAutoConnections) { + if (!Array.isArray(object.pscAutoConnections)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscAutoConnections: array expected"); + message.pscAutoConnections = []; + for (var i = 0; i < object.pscAutoConnections.length; ++i) { + if (typeof object.pscAutoConnections[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscAutoConnections: object expected"); + message.pscAutoConnections[i] = $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} message PscInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedConsumerProjects = []; + object.pscInterfaceConfigs = []; + object.pscAutoConnections = []; + } + if (options.defaults) { + object.serviceAttachmentLink = ""; + object.pscDnsName = ""; + } + if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) + object.serviceAttachmentLink = message.serviceAttachmentLink; + if (message.allowedConsumerProjects && message.allowedConsumerProjects.length) { + object.allowedConsumerProjects = []; + for (var j = 0; j < message.allowedConsumerProjects.length; ++j) + object.allowedConsumerProjects[j] = message.allowedConsumerProjects[j]; + } + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + object.pscDnsName = message.pscDnsName; + if (message.pscInterfaceConfigs && message.pscInterfaceConfigs.length) { + object.pscInterfaceConfigs = []; + for (var j = 0; j < message.pscInterfaceConfigs.length; ++j) + object.pscInterfaceConfigs[j] = $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.toObject(message.pscInterfaceConfigs[j], options); + } + if (message.pscAutoConnections && message.pscAutoConnections.length) { + object.pscAutoConnections = []; + for (var j = 0; j < message.pscAutoConnections.length; ++j) + object.pscAutoConnections[j] = $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + } + return object; + }; + + /** + * Converts this PscInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + PscInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig"; + }; + + return PscInstanceConfig; + })(); + + Instance.InstanceNetworkConfig = (function() { + + /** + * Properties of an InstanceNetworkConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IInstanceNetworkConfig + * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks + * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp + * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp + * @property {string|null} [network] InstanceNetworkConfig network + * @property {string|null} [allocatedIpRangeOverride] InstanceNetworkConfig allocatedIpRangeOverride + */ + + /** + * Constructs a new InstanceNetworkConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents an InstanceNetworkConfig. + * @implements IInstanceNetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig=} [properties] Properties to set + */ + function InstanceNetworkConfig(properties) { + this.authorizedExternalNetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceNetworkConfig authorizedExternalNetworks. + * @member {Array.} authorizedExternalNetworks + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; + + /** + * InstanceNetworkConfig enablePublicIp. + * @member {boolean} enablePublicIp + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enablePublicIp = false; + + /** + * InstanceNetworkConfig enableOutboundPublicIp. + * @member {boolean} enableOutboundPublicIp + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; + + /** + * InstanceNetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.network = ""; + + /** + * InstanceNetworkConfig allocatedIpRangeOverride. + * @member {string} allocatedIpRangeOverride + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.allocatedIpRangeOverride = ""; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance + */ + InstanceNetworkConfig.create = function create(properties) { + return new InstanceNetworkConfig(properties); + }; + + /** + * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceNetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedExternalNetworks != null && message.authorizedExternalNetworks.length) + for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); + if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); + if (message.allocatedIpRangeOverride != null && Object.hasOwnProperty.call(message, "allocatedIpRangeOverride")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRangeOverride); + return writer; + }; + + /** + * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceNetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.authorizedExternalNetworks && message.authorizedExternalNetworks.length)) + message.authorizedExternalNetworks = []; + message.authorizedExternalNetworks.push($root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.decode(reader, reader.uint32())); + break; + } + case 2: { + message.enablePublicIp = reader.bool(); + break; + } + case 3: { + message.enableOutboundPublicIp = reader.bool(); + break; + } + case 4: { + message.network = reader.string(); + break; + } + case 5: { + message.allocatedIpRangeOverride = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceNetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceNetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedExternalNetworks != null && message.hasOwnProperty("authorizedExternalNetworks")) { + if (!Array.isArray(message.authorizedExternalNetworks)) + return "authorizedExternalNetworks: array expected"; + for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify(message.authorizedExternalNetworks[i]); + if (error) + return "authorizedExternalNetworks." + error; + } + } + if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) + if (typeof message.enablePublicIp !== "boolean") + return "enablePublicIp: boolean expected"; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + if (typeof message.enableOutboundPublicIp !== "boolean") + return "enableOutboundPublicIp: boolean expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) + if (!$util.isString(message.allocatedIpRangeOverride)) + return "allocatedIpRangeOverride: string expected"; + return null; + }; + + /** + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig + */ + InstanceNetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig(); + if (object.authorizedExternalNetworks) { + if (!Array.isArray(object.authorizedExternalNetworks)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.authorizedExternalNetworks: array expected"); + message.authorizedExternalNetworks = []; + for (var i = 0; i < object.authorizedExternalNetworks.length; ++i) { + if (typeof object.authorizedExternalNetworks[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.authorizedExternalNetworks: object expected"); + message.authorizedExternalNetworks[i] = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.fromObject(object.authorizedExternalNetworks[i]); + } + } + if (object.enablePublicIp != null) + message.enablePublicIp = Boolean(object.enablePublicIp); + if (object.enableOutboundPublicIp != null) + message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRangeOverride != null) + message.allocatedIpRangeOverride = String(object.allocatedIpRangeOverride); + return message; + }; + + /** + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} message InstanceNetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceNetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedExternalNetworks = []; + if (options.defaults) { + object.enablePublicIp = false; + object.enableOutboundPublicIp = false; + object.network = ""; + object.allocatedIpRangeOverride = ""; + } + if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { + object.authorizedExternalNetworks = []; + for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) + object.authorizedExternalNetworks[j] = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.toObject(message.authorizedExternalNetworks[j], options); + } + if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) + object.enablePublicIp = message.enablePublicIp; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + object.enableOutboundPublicIp = message.enableOutboundPublicIp; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) + object.allocatedIpRangeOverride = message.allocatedIpRangeOverride; + return object; + }; + + /** + * Converts this InstanceNetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceNetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceNetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceNetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig"; + }; + + InstanceNetworkConfig.AuthorizedNetwork = (function() { + + /** + * Properties of an AuthorizedNetwork. + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @interface IAuthorizedNetwork + * @property {string|null} [cidrRange] AuthorizedNetwork cidrRange + */ + + /** + * Constructs a new AuthorizedNetwork. + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig + * @classdesc Represents an AuthorizedNetwork. + * @implements IAuthorizedNetwork + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set + */ + function AuthorizedNetwork(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedNetwork cidrRange. + * @member {string} cidrRange + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @instance + */ + AuthorizedNetwork.prototype.cidrRange = ""; + + /** + * Creates a new AuthorizedNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork instance + */ + AuthorizedNetwork.create = function create(properties) { + return new AuthorizedNetwork(properties); + }; + + /** + * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedNetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cidrRange != null && Object.hasOwnProperty.call(message, "cidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cidrRange); + return writer; + }; + + /** + * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedNetwork.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cidrRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedNetwork message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedNetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) + if (!$util.isString(message.cidrRange)) + return "cidrRange: string expected"; + return null; + }; + + /** + * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + */ + AuthorizedNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork(); + if (object.cidrRange != null) + message.cidrRange = String(object.cidrRange); + return message; + }; + + /** + * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} message AuthorizedNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cidrRange = ""; + if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) + object.cidrRange = message.cidrRange; + return object; + }; + + /** + * Converts this AuthorizedNetwork to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @instance + * @returns {Object.} JSON object + */ + AuthorizedNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedNetwork + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork"; + }; + + return AuthorizedNetwork; + })(); + + return InstanceNetworkConfig; + })(); + + Instance.ConnectionPoolConfig = (function() { + + /** + * Properties of a ConnectionPoolConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IConnectionPoolConfig + * @property {boolean|null} [enabled] ConnectionPoolConfig enabled + * @property {Object.|null} [flags] ConnectionPoolConfig flags + * @property {number|null} [poolerCount] ConnectionPoolConfig poolerCount + */ + + /** + * Constructs a new ConnectionPoolConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a ConnectionPoolConfig. + * @implements IConnectionPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig=} [properties] Properties to set + */ + function ConnectionPoolConfig(properties) { + this.flags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionPoolConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.enabled = false; + + /** + * ConnectionPoolConfig flags. + * @member {Object.} flags + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.flags = $util.emptyObject; + + /** + * ConnectionPoolConfig poolerCount. + * @member {number} poolerCount + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.poolerCount = 0; + + /** + * Creates a new ConnectionPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig instance + */ + ConnectionPoolConfig.create = function create(properties) { + return new ConnectionPoolConfig(properties); + }; + + /** + * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enabled); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + for (var keys = Object.keys(message.flags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.flags[keys[i]]).ldelim(); + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.poolerCount); + return writer; + }; + + /** + * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 12: { + message.enabled = reader.bool(); + break; + } + case 13: { + if (message.flags === $util.emptyObject) + message.flags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.flags[key] = value; + break; + } + case 14: { + message.poolerCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isObject(message.flags)) + return "flags: object expected"; + var key = Object.keys(message.flags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.flags[key[i]])) + return "flags: string{k:string} expected"; + } + if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) + if (!$util.isInteger(message.poolerCount)) + return "poolerCount: integer expected"; + return null; + }; + + /** + * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig + */ + ConnectionPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.flags) { + if (typeof object.flags !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.flags: object expected"); + message.flags = {}; + for (var keys = Object.keys(object.flags), i = 0; i < keys.length; ++i) + message.flags[keys[i]] = String(object.flags[keys[i]]); + } + if (object.poolerCount != null) + message.poolerCount = object.poolerCount | 0; + return message; + }; + + /** + * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} message ConnectionPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.flags = {}; + if (options.defaults) { + object.enabled = false; + object.poolerCount = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + var keys2; + if (message.flags && (keys2 = Object.keys(message.flags)).length) { + object.flags = {}; + for (var j = 0; j < keys2.length; ++j) + object.flags[keys2[j]] = message.flags[keys2[j]]; + } + if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) + object.poolerCount = message.poolerCount; + return object; + }; + + /** + * Converts this ConnectionPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ConnectionPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig"; + }; + + return ConnectionPoolConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value + * @property {number} PROMOTING=9 PROMOTING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * InstanceType enum. + * @name google.cloud.alloydb.v1alpha.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} READ_POOL=2 READ_POOL value + * @property {number} SECONDARY=3 SECONDARY value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "READ_POOL"] = 2; + values[valuesById[3] = "SECONDARY"] = 3; + return values; + })(); + + /** + * AvailabilityType enum. + * @name google.cloud.alloydb.v1alpha.Instance.AvailabilityType + * @enum {number} + * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + Instance.AvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + /** + * ActivationPolicy enum. + * @name google.cloud.alloydb.v1alpha.Instance.ActivationPolicy + * @enum {number} + * @property {number} ACTIVATION_POLICY_UNSPECIFIED=0 ACTIVATION_POLICY_UNSPECIFIED value + * @property {number} ALWAYS=1 ALWAYS value + * @property {number} NEVER=2 NEVER value + */ + Instance.ActivationPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVATION_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALWAYS"] = 1; + values[valuesById[2] = "NEVER"] = 2; + return values; + })(); + + return Instance; + })(); + + v1alpha.ConnectionInfo = (function() { + + /** + * Properties of a ConnectionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @interface IConnectionInfo + * @property {string|null} [name] ConnectionInfo name + * @property {string|null} [ipAddress] ConnectionInfo ipAddress + * @property {string|null} [publicIpAddress] ConnectionInfo publicIpAddress + * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain + * @property {string|null} [instanceUid] ConnectionInfo instanceUid + * @property {string|null} [pscDnsName] ConnectionInfo pscDnsName + */ + + /** + * Constructs a new ConnectionInfo. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ConnectionInfo. + * @implements IConnectionInfo + * @constructor + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set + */ + function ConnectionInfo(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionInfo name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.name = ""; + + /** + * ConnectionInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.ipAddress = ""; + + /** + * ConnectionInfo publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.publicIpAddress = ""; + + /** + * ConnectionInfo pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; + + /** + * ConnectionInfo instanceUid. + * @member {string} instanceUid + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.instanceUid = ""; + + /** + * ConnectionInfo pscDnsName. + * @member {string} pscDnsName + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.pscDnsName = ""; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo instance + */ + ConnectionInfo.create = function create(properties) { + return new ConnectionInfo(properties); + }; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); + if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicIpAddress); + if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pscDnsName); + return writer; + }; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ipAddress = reader.string(); + break; + } + case 5: { + message.publicIpAddress = reader.string(); + break; + } + case 3: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 4: { + message.instanceUid = reader.string(); + break; + } + case 6: { + message.pscDnsName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + if (!$util.isString(message.instanceUid)) + return "instanceUid: string expected"; + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + if (!$util.isString(message.pscDnsName)) + return "pscDnsName: string expected"; + return null; + }; + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo + */ + ConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ConnectionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1alpha.ConnectionInfo.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.instanceUid != null) + message.instanceUid = String(object.instanceUid); + if (object.pscDnsName != null) + message.pscDnsName = String(object.pscDnsName); + return message; + }; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} message ConnectionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) { + object.name = ""; + object.ipAddress = ""; + object.instanceUid = ""; + object.publicIpAddress = ""; + object.pscDnsName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + object.instanceUid = message.instanceUid; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + object.pscDnsName = message.pscDnsName; + return object; + }; + + /** + * Converts this ConnectionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @instance + * @returns {Object.} JSON object + */ + ConnectionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ConnectionInfo"; + }; + + return ConnectionInfo; + })(); + + v1alpha.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [displayName] Backup displayName + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime + * @property {google.protobuf.ITimestamp|null} [createCompletionTime] Backup createCompletionTime + * @property {Object.|null} [labels] Backup labels + * @property {google.cloud.alloydb.v1alpha.Backup.State|null} [state] Backup state + * @property {google.cloud.alloydb.v1alpha.Backup.Type|null} [type] Backup type + * @property {string|null} [description] Backup description + * @property {string|null} [clusterUid] Backup clusterUid + * @property {string|null} [clusterName] Backup clusterName + * @property {boolean|null} [reconciling] Backup reconciling + * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig + * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {string|null} [etag] Backup etag + * @property {Object.|null} [annotations] Backup annotations + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * @property {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity + * @property {boolean|null} [satisfiesPzi] Backup satisfiesPzi + * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Backup databaseVersion + * @property {Object.|null} [tags] Backup tags + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + this.annotations = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.displayName = ""; + + /** + * Backup uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.uid = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.deleteTime = null; + + /** + * Backup createCompletionTime. + * @member {google.protobuf.ITimestamp|null|undefined} createCompletionTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.createCompletionTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup state. + * @member {google.cloud.alloydb.v1alpha.Backup.State} state + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup type. + * @member {google.cloud.alloydb.v1alpha.Backup.Type} type + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.type = 0; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup clusterUid. + * @member {string} clusterUid + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.clusterUid = ""; + + /** + * Backup clusterName. + * @member {string} clusterName + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.clusterName = ""; + + /** + * Backup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.reconciling = false; + + /** + * Backup encryptionConfig. + * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.encryptionConfig = null; + + /** + * Backup encryptionInfo. + * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.etag = ""; + + /** + * Backup annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.annotations = $util.emptyObject; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.expiryTime = null; + + /** + * Backup expiryQuantity. + * @member {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.expiryQuantity = null; + + /** + * Backup satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.satisfiesPzi = false; + + /** + * Backup satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = false; + + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + + /** + * Backup tags. + * @member {Object.} tags + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.tags = $util.emptyObject; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); + if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) + $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.satisfiesPzi); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + if (message.createCompletionTime != null && Object.hasOwnProperty.call(message, "createCompletionTime")) + $root.google.protobuf.Timestamp.encode(message.createCompletionTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.createCompletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 18: { + message.clusterUid = reader.string(); + break; + } + case 10: { + message.clusterName = reader.string(); + break; + } + case 11: { + message.reconciling = reader.bool(); + break; + } + case 12: { + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 16: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 17: { + message.sizeBytes = reader.int64(); + break; + } + case 19: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); + break; + } + case 23: { + message.satisfiesPzi = reader.bool(); + break; + } + case 21: { + message.satisfiesPzs = reader.bool(); + break; + } + case 22: { + message.databaseVersion = reader.int32(); + break; + } + case 25: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createCompletionTime); + if (error) + return "createCompletionTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + if (!$util.isString(message.clusterUid)) + return "clusterUid: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); + if (error) + return "expiryQuantity." + error; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Backup) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.createCompletionTime != null) { + if (typeof object.createCompletionTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.createCompletionTime: object expected"); + message.createCompletionTime = $root.google.protobuf.Timestamp.fromObject(object.createCompletionTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ON_DEMAND": + case 1: + message.type = 1; + break; + case "AUTOMATED": + case 2: + message.type = 2; + break; + case "CONTINUOUS": + case 3: + message.type = 3; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.clusterUid != null) + message.clusterUid = String(object.clusterUid); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } + if (object.expiryQuantity != null) { + if (typeof object.expiryQuantity !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.expiryQuantity: object expected"); + message.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); + } + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.databaseVersion = 6; + break; + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Backup.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {google.cloud.alloydb.v1alpha.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.clusterName = ""; + object.reconciling = false; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.etag = ""; + object.deleteTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.clusterUid = ""; + object.expiryTime = null; + object.expiryQuantity = null; + object.satisfiesPzs = false; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.satisfiesPzi = false; + object.createCompletionTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + object.clusterUid = message.clusterUid; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) + object.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) + object.createCompletionTime = $root.google.protobuf.Timestamp.toObject(message.createCompletionTime, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Backup"; + }; + + Backup.QuantityBasedExpiry = (function() { + + /** + * Properties of a QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1alpha.Backup + * @interface IQuantityBasedExpiry + * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount + * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount + */ + + /** + * Constructs a new QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1alpha.Backup + * @classdesc Represents a QuantityBasedExpiry. + * @implements IQuantityBasedExpiry + * @constructor + * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry=} [properties] Properties to set + */ + function QuantityBasedExpiry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedExpiry retentionCount. + * @member {number} retentionCount + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.retentionCount = 0; + + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + */ + QuantityBasedExpiry.create = function create(properties) { + return new QuantityBasedExpiry(properties); + }; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); + if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); + return writer; + }; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionCount = reader.int32(); + break; + } + case 2: { + message.totalRetentionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedExpiry message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedExpiry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + if (!$util.isInteger(message.retentionCount)) + return "retentionCount: integer expected"; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + if (!$util.isInteger(message.totalRetentionCount)) + return "totalRetentionCount: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry + */ + QuantityBasedExpiry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry(); + if (object.retentionCount != null) + message.retentionCount = object.retentionCount | 0; + if (object.totalRetentionCount != null) + message.totalRetentionCount = object.totalRetentionCount | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedExpiry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionCount = 0; + object.totalRetentionCount = 0; + } + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + object.retentionCount = message.retentionCount; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + object.totalRetentionCount = message.totalRetentionCount; + return object; + }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedExpiry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry"; + }; + + return QuantityBasedExpiry; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.alloydb.v1alpha.Backup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} AUTOMATED=2 AUTOMATED value + * @property {number} CONTINUOUS=3 CONTINUOUS value + */ + Backup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "AUTOMATED"] = 2; + values[valuesById[3] = "CONTINUOUS"] = 3; + return values; + })(); + + return Backup; + })(); + + v1alpha.SupportedDatabaseFlag = (function() { + + /** + * Properties of a SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISupportedDatabaseFlag + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions + * @property {string|null} [recommendedStringValue] SupportedDatabaseFlag recommendedStringValue + * @property {google.protobuf.IInt64Value|null} [recommendedIntegerValue] SupportedDatabaseFlag recommendedIntegerValue + * @property {string|null} [name] SupportedDatabaseFlag name + * @property {string|null} [flagName] SupportedDatabaseFlag flagName + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType + * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues + * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions + * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null} [scope] SupportedDatabaseFlag scope + */ + + /** + * Constructs a new SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SupportedDatabaseFlag. + * @implements ISupportedDatabaseFlag + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set + */ + function SupportedDatabaseFlag(properties) { + this.supportedDbVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.stringRestrictions = null; + + /** + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.integerRestrictions = null; + + /** + * SupportedDatabaseFlag recommendedStringValue. + * @member {string|null|undefined} recommendedStringValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.recommendedStringValue = null; + + /** + * SupportedDatabaseFlag recommendedIntegerValue. + * @member {google.protobuf.IInt64Value|null|undefined} recommendedIntegerValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.recommendedIntegerValue = null; + + /** + * SupportedDatabaseFlag name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.name = ""; + + /** + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.flagName = ""; + + /** + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.valueType = 0; + + /** + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; + + /** + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + + /** + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.requiresDbRestart = false; + + /** + * SupportedDatabaseFlag scope. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} scope + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.scope = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SupportedDatabaseFlag recommendedValue. + * @member {"recommendedStringValue"|"recommendedIntegerValue"|undefined} recommendedValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "recommendedValue", { + get: $util.oneOfGetter($oneOfFields = ["recommendedStringValue", "recommendedIntegerValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag instance + */ + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); + }; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); + if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); + if (message.supportedDbVersions != null && message.supportedDbVersions.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedDbVersions.length; ++i) + writer.int32(message.supportedDbVersions[i]); + writer.ldelim(); + } + if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); + if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) + $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) + $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recommendedStringValue); + if (message.recommendedIntegerValue != null && Object.hasOwnProperty.call(message, "recommendedIntegerValue")) + $root.google.protobuf.Int64Value.encode(message.recommendedIntegerValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.recommendedStringValue = reader.string(); + break; + } + case 11: { + message.recommendedIntegerValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flagName = reader.string(); + break; + } + case 3: { + message.valueType = reader.int32(); + break; + } + case 4: { + message.acceptsMultipleValues = reader.bool(); + break; + } + case 5: { + if (!(message.supportedDbVersions && message.supportedDbVersions.length)) + message.supportedDbVersions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedDbVersions.push(reader.int32()); + } else + message.supportedDbVersions.push(reader.int32()); + break; + } + case 6: { + message.requiresDbRestart = reader.bool(); + break; + } + case 9: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedDatabaseFlag message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedDatabaseFlag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); + if (error) + return "stringRestrictions." + error; + } + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + if (properties.restrictions === 1) + return "restrictions: multiple values"; + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); + if (error) + return "integerRestrictions." + error; + } + } + if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + properties.recommendedValue = 1; + if (!$util.isString(message.recommendedStringValue)) + return "recommendedStringValue: string expected"; + } + if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { + if (properties.recommendedValue === 1) + return "recommendedValue: multiple values"; + properties.recommendedValue = 1; + { + var error = $root.google.protobuf.Int64Value.verify(message.recommendedIntegerValue); + if (error) + return "recommendedIntegerValue." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flagName != null && message.hasOwnProperty("flagName")) + if (!$util.isString(message.flagName)) + return "flagName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + if (typeof message.acceptsMultipleValues !== "boolean") + return "acceptsMultipleValues: boolean expected"; + if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { + if (!Array.isArray(message.supportedDbVersions)) + return "supportedDbVersions: array expected"; + for (var i = 0; i < message.supportedDbVersions.length; ++i) + switch (message.supportedDbVersions[i]) { + default: + return "supportedDbVersions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag + */ + SupportedDatabaseFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); + if (object.stringRestrictions != null) { + if (typeof object.stringRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.stringRestrictions: object expected"); + message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); + } + if (object.integerRestrictions != null) { + if (typeof object.integerRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.integerRestrictions: object expected"); + message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + } + if (object.recommendedStringValue != null) + message.recommendedStringValue = String(object.recommendedStringValue); + if (object.recommendedIntegerValue != null) { + if (typeof object.recommendedIntegerValue !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.recommendedIntegerValue: object expected"); + message.recommendedIntegerValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntegerValue); + } + if (object.name != null) + message.name = String(object.name); + if (object.flagName != null) + message.flagName = String(object.flagName); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INTEGER": + case 2: + message.valueType = 2; + break; + case "FLOAT": + case 3: + message.valueType = 3; + break; + case "NONE": + case 4: + message.valueType = 4; + break; + } + if (object.acceptsMultipleValues != null) + message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); + if (object.supportedDbVersions) { + if (!Array.isArray(object.supportedDbVersions)) + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.supportedDbVersions: array expected"); + message.supportedDbVersions = []; + for (var i = 0; i < object.supportedDbVersions.length; ++i) + switch (object.supportedDbVersions[i]) { + default: + if (typeof object.supportedDbVersions[i] === "number") { + message.supportedDbVersions[i] = object.supportedDbVersions[i]; + break; + } + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.supportedDbVersions[i] = 0; + break; + case "POSTGRES_13": + case 1: + message.supportedDbVersions[i] = 1; + break; + case "POSTGRES_14": + case 2: + message.supportedDbVersions[i] = 2; + break; + case "POSTGRES_15": + case 3: + message.supportedDbVersions[i] = 3; + break; + case "POSTGRES_16": + case 4: + message.supportedDbVersions[i] = 4; + break; + case "POSTGRES_17": + case 5: + message.supportedDbVersions[i] = 5; + break; + case "POSTGRES_18": + case 6: + message.supportedDbVersions[i] = 6; + break; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "DATABASE": + case 1: + message.scope = 1; + break; + case "CONNECTION_POOL": + case 2: + message.scope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedDatabaseFlag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDbVersions = []; + if (options.defaults) { + object.name = ""; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flagName != null && message.hasOwnProperty("flagName")) + object.flagName = message.flagName; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + object.acceptsMultipleValues = message.acceptsMultipleValues; + if (message.supportedDbVersions && message.supportedDbVersions.length) { + object.supportedDbVersions = []; + for (var j = 0; j < message.supportedDbVersions.length; ++j) + object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + object.requiresDbRestart = message.requiresDbRestart; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + object.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); + if (options.oneofs) + object.restrictions = "stringRestrictions"; + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + object.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); + if (options.oneofs) + object.restrictions = "integerRestrictions"; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] : message.scope; + if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + object.recommendedStringValue = message.recommendedStringValue; + if (options.oneofs) + object.recommendedValue = "recommendedStringValue"; + } + if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { + object.recommendedIntegerValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntegerValue, options); + if (options.oneofs) + object.recommendedValue = "recommendedIntegerValue"; + } + return object; + }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @instance + * @returns {Object.} JSON object + */ + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag"; + }; + + SupportedDatabaseFlag.StringRestrictions = (function() { + + /** + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues + */ + + /** + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions + * @constructor + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + */ + function StringRestrictions(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @instance + */ + StringRestrictions.prototype.allowedValues = $util.emptyArray; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance + */ + StringRestrictions.create = function create(properties) { + return new StringRestrictions(properties); + }; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + return writer; + }; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + return null; + }; + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + */ + StringRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + return object; + }; + + /** + * Converts this StringRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @instance + * @returns {Object.} JSON object + */ + StringRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions"; + }; + + return StringRestrictions; + })(); + + SupportedDatabaseFlag.IntegerRestrictions = (function() { + + /** + * Properties of an IntegerRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @interface IIntegerRestrictions + * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue + * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue + */ + + /** + * Constructs a new IntegerRestrictions. + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag + * @classdesc Represents an IntegerRestrictions. + * @implements IIntegerRestrictions + * @constructor + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + */ + function IntegerRestrictions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntegerRestrictions minValue. + * @member {google.protobuf.IInt64Value|null|undefined} minValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.minValue = null; + + /** + * IntegerRestrictions maxValue. + * @member {google.protobuf.IInt64Value|null|undefined} maxValue + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.maxValue = null; + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance + */ + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); + }; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + return null; + }; + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + */ + IntegerRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); + message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); + message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + } + return message; + }; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + return object; + }; + + /** + * Converts this IntegerRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @instance + * @returns {Object.} JSON object + */ + IntegerRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions"; + }; + + return IntegerRestrictions; + })(); + + /** + * ValueType enum. + * @name google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} FLOAT=3 FLOAT value + * @property {number} NONE=4 NONE value + */ + SupportedDatabaseFlag.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "FLOAT"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} DATABASE=1 DATABASE value + * @property {number} CONNECTION_POOL=2 CONNECTION_POOL value + */ + SupportedDatabaseFlag.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATABASE"] = 1; + values[valuesById[2] = "CONNECTION_POOL"] = 2; + return values; + })(); + + return SupportedDatabaseFlag; + })(); + + v1alpha.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [password] User password + * @property {Array.|null} [databaseRoles] User databaseRoles + * @property {google.cloud.alloydb.v1alpha.User.UserType|null} [userType] User userType + * @property {boolean|null} [keepExtraRoles] User keepExtraRoles + */ + + /** + * Constructs a new User. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUser=} [properties] Properties to set + */ + function User(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.name = ""; + + /** + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.password = ""; + + /** + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.databaseRoles = $util.emptyArray; + + /** + * User userType. + * @member {google.cloud.alloydb.v1alpha.User.UserType} userType + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.userType = 0; + + /** + * User keepExtraRoles. + * @member {boolean} keepExtraRoles + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + */ + User.prototype.keepExtraRoles = false; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {google.cloud.alloydb.v1alpha.IUser=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {google.cloud.alloydb.v1alpha.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); + if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); + if (message.keepExtraRoles != null && Object.hasOwnProperty.call(message, "keepExtraRoles")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.keepExtraRoles); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {google.cloud.alloydb.v1alpha.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 4: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push(reader.string()); + break; + } + case 5: { + message.userType = reader.int32(); + break; + } + case 6: { + message.keepExtraRoles = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) + if (!$util.isString(message.databaseRoles[i])) + return "databaseRoles: string[] expected"; + } + if (message.userType != null && message.hasOwnProperty("userType")) + switch (message.userType) { + default: + return "userType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) + if (typeof message.keepExtraRoles !== "boolean") + return "keepExtraRoles: boolean expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.User) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.User(); + if (object.name != null) + message.name = String(object.name); + if (object.password != null) + message.password = String(object.password); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.cloud.alloydb.v1alpha.User.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) + message.databaseRoles[i] = String(object.databaseRoles[i]); + } + switch (object.userType) { + default: + if (typeof object.userType === "number") { + message.userType = object.userType; + break; + } + break; + case "USER_TYPE_UNSPECIFIED": + case 0: + message.userType = 0; + break; + case "ALLOYDB_BUILT_IN": + case 1: + message.userType = 1; + break; + case "ALLOYDB_IAM_USER": + case 2: + message.userType = 2; + break; + } + if (object.keepExtraRoles != null) + message.keepExtraRoles = Boolean(object.keepExtraRoles); + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {google.cloud.alloydb.v1alpha.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; + if (options.defaults) { + object.name = ""; + object.password = ""; + object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; + object.keepExtraRoles = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = message.databaseRoles[j]; + } + if (message.userType != null && message.hasOwnProperty("userType")) + object.userType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1alpha.User.UserType[message.userType] : message.userType; + if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) + object.keepExtraRoles = message.keepExtraRoles; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.User"; + }; + + /** + * UserType enum. + * @name google.cloud.alloydb.v1alpha.User.UserType + * @enum {number} + * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value + * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value + * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value + */ + User.UserType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; + values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; + return values; + })(); + + return User; + })(); + + v1alpha.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {string|null} [charset] Database charset + * @property {string|null} [collation] Database collation + * @property {string|null} [characterType] Database characterType + * @property {boolean|null} [isTemplate] Database isTemplate + * @property {string|null} [databaseTemplate] Database databaseTemplate + * @property {boolean|null} [isTemplateDatabase] Database isTemplateDatabase + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.alloydb.v1alpha.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database charset. + * @member {string} charset + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.charset = ""; + + /** + * Database collation. + * @member {string} collation + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.collation = ""; + + /** + * Database characterType. + * @member {string} characterType + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.characterType = ""; + + /** + * Database isTemplate. + * @member {boolean} isTemplate + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.isTemplate = false; + + /** + * Database databaseTemplate. + * @member {string} databaseTemplate + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.databaseTemplate = ""; + + /** + * Database isTemplateDatabase. + * @member {boolean|null|undefined} isTemplateDatabase + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + */ + Database.prototype.isTemplateDatabase = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Database.prototype, "_isTemplateDatabase", { + get: $util.oneOfGetter($oneOfFields = ["isTemplateDatabase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {google.cloud.alloydb.v1alpha.IDatabase=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {google.cloud.alloydb.v1alpha.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.charset); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.collation); + if (message.characterType != null && Object.hasOwnProperty.call(message, "characterType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.characterType); + if (message.isTemplate != null && Object.hasOwnProperty.call(message, "isTemplate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isTemplate); + if (message.databaseTemplate != null && Object.hasOwnProperty.call(message, "databaseTemplate")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseTemplate); + if (message.isTemplateDatabase != null && Object.hasOwnProperty.call(message, "isTemplateDatabase")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isTemplateDatabase); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {google.cloud.alloydb.v1alpha.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.charset = reader.string(); + break; + } + case 3: { + message.collation = reader.string(); + break; + } + case 4: { + message.characterType = reader.string(); + break; + } + case 5: { + message.isTemplate = reader.bool(); + break; + } + case 6: { + message.databaseTemplate = reader.string(); + break; + } + case 7: { + message.isTemplateDatabase = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.charset != null && message.hasOwnProperty("charset")) + if (!$util.isString(message.charset)) + return "charset: string expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isString(message.collation)) + return "collation: string expected"; + if (message.characterType != null && message.hasOwnProperty("characterType")) + if (!$util.isString(message.characterType)) + return "characterType: string expected"; + if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) + if (typeof message.isTemplate !== "boolean") + return "isTemplate: boolean expected"; + if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) + if (!$util.isString(message.databaseTemplate)) + return "databaseTemplate: string expected"; + if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { + properties._isTemplateDatabase = 1; + if (typeof message.isTemplateDatabase !== "boolean") + return "isTemplateDatabase: boolean expected"; + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Database) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Database(); + if (object.name != null) + message.name = String(object.name); + if (object.charset != null) + message.charset = String(object.charset); + if (object.collation != null) + message.collation = String(object.collation); + if (object.characterType != null) + message.characterType = String(object.characterType); + if (object.isTemplate != null) + message.isTemplate = Boolean(object.isTemplate); + if (object.databaseTemplate != null) + message.databaseTemplate = String(object.databaseTemplate); + if (object.isTemplateDatabase != null) + message.isTemplateDatabase = Boolean(object.isTemplateDatabase); + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {google.cloud.alloydb.v1alpha.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.charset = ""; + object.collation = ""; + object.characterType = ""; + object.isTemplate = false; + object.databaseTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.charset != null && message.hasOwnProperty("charset")) + object.charset = message.charset; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.characterType != null && message.hasOwnProperty("characterType")) + object.characterType = message.characterType; + if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) + object.isTemplate = message.isTemplate; + if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) + object.databaseTemplate = message.databaseTemplate; + if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { + object.isTemplateDatabase = message.isTemplateDatabase; + if (options.oneofs) + object._isTemplateDatabase = "isTemplateDatabase"; + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Database"; + }; + + return Database; + })(); + + /** + * GCAEntitlementType enum. + * @name google.cloud.alloydb.v1alpha.GCAEntitlementType + * @enum {number} + * @property {number} GCA_ENTITLEMENT_TYPE_UNSPECIFIED=0 GCA_ENTITLEMENT_TYPE_UNSPECIFIED value + * @property {number} GCA_STANDARD=1 GCA_STANDARD value + */ + v1alpha.GCAEntitlementType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GCA_ENTITLEMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCA_STANDARD"] = 1; + return values; + })(); + + v1alpha.GeminiClusterConfig = (function() { + + /** + * Properties of a GeminiClusterConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGeminiClusterConfig + * @property {boolean|null} [entitled] GeminiClusterConfig entitled + */ + + /** + * Constructs a new GeminiClusterConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GeminiClusterConfig. + * @implements IGeminiClusterConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig=} [properties] Properties to set + */ + function GeminiClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeminiClusterConfig entitled. + * @member {boolean} entitled + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @instance + */ + GeminiClusterConfig.prototype.entitled = false; + + /** + * Creates a new GeminiClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig instance + */ + GeminiClusterConfig.create = function create(properties) { + return new GeminiClusterConfig(properties); + }; + + /** + * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); + return writer; + }; + + /** + * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entitled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeminiClusterConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeminiClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitled != null && message.hasOwnProperty("entitled")) + if (typeof message.entitled !== "boolean") + return "entitled: boolean expected"; + return null; + }; + + /** + * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig + */ + GeminiClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig(); + if (object.entitled != null) + message.entitled = Boolean(object.entitled); + return message; + }; + + /** + * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1alpha.GeminiClusterConfig} message GeminiClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeminiClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entitled = false; + if (message.entitled != null && message.hasOwnProperty("entitled")) + object.entitled = message.entitled; + return object; + }; + + /** + * Converts this GeminiClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @instance + * @returns {Object.} JSON object + */ + GeminiClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeminiClusterConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeminiClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GeminiClusterConfig"; + }; + + return GeminiClusterConfig; + })(); + + v1alpha.GeminiInstanceConfig = (function() { + + /** + * Properties of a GeminiInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGeminiInstanceConfig + * @property {boolean|null} [entitled] GeminiInstanceConfig entitled + */ + + /** + * Constructs a new GeminiInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GeminiInstanceConfig. + * @implements IGeminiInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig=} [properties] Properties to set + */ + function GeminiInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeminiInstanceConfig entitled. + * @member {boolean} entitled + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @instance + */ + GeminiInstanceConfig.prototype.entitled = false; + + /** + * Creates a new GeminiInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig instance + */ + GeminiInstanceConfig.create = function create(properties) { + return new GeminiInstanceConfig(properties); + }; + + /** + * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); + return writer; + }; + + /** + * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entitled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeminiInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeminiInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitled != null && message.hasOwnProperty("entitled")) + if (typeof message.entitled !== "boolean") + return "entitled: boolean expected"; + return null; + }; + + /** + * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig + */ + GeminiInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig(); + if (object.entitled != null) + message.entitled = Boolean(object.entitled); + return message; + }; + + /** + * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} message GeminiInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeminiInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entitled = false; + if (message.entitled != null && message.hasOwnProperty("entitled")) + object.entitled = message.entitled; + return object; + }; + + /** + * Converts this GeminiInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + GeminiInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeminiInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeminiInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GeminiInstanceConfig"; + }; + + return GeminiInstanceConfig; + })(); + + v1alpha.GCAInstanceConfig = (function() { + + /** + * Properties of a GCAInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGCAInstanceConfig + * @property {google.cloud.alloydb.v1alpha.GCAEntitlementType|null} [gcaEntitlement] GCAInstanceConfig gcaEntitlement + */ + + /** + * Constructs a new GCAInstanceConfig. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GCAInstanceConfig. + * @implements IGCAInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig=} [properties] Properties to set + */ + function GCAInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCAInstanceConfig gcaEntitlement. + * @member {google.cloud.alloydb.v1alpha.GCAEntitlementType} gcaEntitlement + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @instance + */ + GCAInstanceConfig.prototype.gcaEntitlement = 0; + + /** + * Creates a new GCAInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig instance + */ + GCAInstanceConfig.create = function create(properties) { + return new GCAInstanceConfig(properties); + }; + + /** + * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCAInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcaEntitlement != null && Object.hasOwnProperty.call(message, "gcaEntitlement")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.gcaEntitlement); + return writer; + }; + + /** + * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCAInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCAInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcaEntitlement = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCAInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCAInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCAInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) + switch (message.gcaEntitlement) { + default: + return "gcaEntitlement: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig + */ + GCAInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig(); + switch (object.gcaEntitlement) { + default: + if (typeof object.gcaEntitlement === "number") { + message.gcaEntitlement = object.gcaEntitlement; + break; + } + break; + case "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": + case 0: + message.gcaEntitlement = 0; + break; + case "GCA_STANDARD": + case 1: + message.gcaEntitlement = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1alpha.GCAInstanceConfig} message GCAInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCAInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcaEntitlement = options.enums === String ? "GCA_ENTITLEMENT_TYPE_UNSPECIFIED" : 0; + if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) + object.gcaEntitlement = options.enums === String ? $root.google.cloud.alloydb.v1alpha.GCAEntitlementType[message.gcaEntitlement] === undefined ? message.gcaEntitlement : $root.google.cloud.alloydb.v1alpha.GCAEntitlementType[message.gcaEntitlement] : message.gcaEntitlement; + return object; + }; + + /** + * Converts this GCAInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + GCAInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCAInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCAInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GCAInstanceConfig"; + }; + + return GCAInstanceConfig; + })(); + + v1alpha.AlloyDBAdmin = (function() { + + /** + * Constructs a new AlloyDBAdmin service. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an AlloyDBAdmin + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1alpha.ListClustersRequest, $root.google.cloud.alloydb.v1alpha.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1alpha.GetClusterRequest, $root.google.cloud.alloydb.v1alpha.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1alpha.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|exportCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ExportClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportCluster. + * @function exportCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} request ExportClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.exportCluster = function exportCluster(request, callback) { + return this.rpcCall(exportCluster, $root.google.cloud.alloydb.v1alpha.ExportClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportCluster" }); + + /** + * Calls ExportCluster. + * @function exportCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} request ExportClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|importCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ImportClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportCluster. + * @function importCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} request ImportClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.importCluster = function importCluster(request, callback) { + return this.rpcCall(importCluster, $root.google.cloud.alloydb.v1alpha.ImportClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportCluster" }); + + /** + * Calls ImportCluster. + * @function importCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} request ImportClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|upgradeCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpgradeClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpgradeCluster. + * @function upgradeCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.upgradeCluster = function upgradeCluster(request, callback) { + return this.rpcCall(upgradeCluster, $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpgradeCluster" }); + + /** + * Calls UpgradeCluster. + * @function upgradeCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef PromoteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { + return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteCluster" }); + + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|switchoverCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef SwitchoverClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SwitchoverCluster. + * @function switchoverCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.switchoverCluster = function switchoverCluster(request, callback) { + return this.rpcCall(switchoverCluster, $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SwitchoverCluster" }); + + /** + * Calls SwitchoverCluster. + * @function switchoverCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef RestoreClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { + return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCluster" }); + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateSecondaryClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { + return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryCluster" }); + + /** + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1alpha.ListInstancesRequest, $root.google.cloud.alloydb.v1alpha.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1alpha.GetInstanceRequest, $root.google.cloud.alloydb.v1alpha.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateSecondaryInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { + return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryInstance" }); + + /** + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef BatchCreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { + return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateInstances" }); + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef FailoverInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { + return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FailoverInstance" }); + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|injectFault}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef InjectFaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { + return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1alpha.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InjectFault" }); + + /** + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|executeSql}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ExecuteSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} [response] ExecuteSqlResponse + */ + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ExecuteSqlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.executeSql = function executeSql(request, callback) { + return this.rpcCall(executeSql, $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest, $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse, request, callback); + }, "name", { value: "ExecuteSql" }); + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1alpha.ListBackupsRequest, $root.google.cloud.alloydb.v1alpha.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1alpha.GetBackupRequest, $root.google.cloud.alloydb.v1alpha.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1alpha.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListSupportedDatabaseFlagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse + */ + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { + return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, request, callback); + }, "name", { value: "ListSupportedDatabaseFlags" }); + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GenerateClientCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse + */ + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { + return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, request, callback); + }, "name", { value: "GenerateClientCertificate" }); + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetConnectionInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} [response] ConnectionInfo + */ + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { + return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1alpha.ConnectionInfo, request, callback); + }, "name", { value: "GetConnectionInfo" }); + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listUsers}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListUsersResponse} [response] ListUsersResponse + */ + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1alpha.ListUsersRequest, $root.google.cloud.alloydb.v1alpha.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.User} [response] User + */ + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.cloud.alloydb.v1alpha.GetUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); + }, "name", { value: "GetUser" }); + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.User} [response] User + */ + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.cloud.alloydb.v1alpha.CreateUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1alpha.UpdateUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); + }, "name", { value: "UpdateUser" }); + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteUser}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1alpha.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listDatabases}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef ListDatabasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.ListDatabasesResponse} [response] ListDatabasesResponse + */ + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listDatabases = function listDatabases(request, callback) { + return this.rpcCall(listDatabases, $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest, $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse, request, callback); + }, "name", { value: "ListDatabases" }); + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createDatabase}. + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @typedef CreateDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1alpha.Database} [response] Database + */ + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Database + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createDatabase = function createDatabase(request, callback) { + return this.rpcCall(createDatabase, $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest, $root.google.cloud.alloydb.v1alpha.Database, request, callback); + }, "name", { value: "CreateDatabase" }); + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBAdmin; + })(); + + v1alpha.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1alpha.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.clusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1alpha.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + * @property {google.cloud.alloydb.v1alpha.ClusterView|null} [view] GetClusterRequest view + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1alpha.ClusterView} view + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.view = 0; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CLUSTER_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CLUSTER_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CLUSTER_VIEW_CONTINUOUS_BACKUP": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.ClusterView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1alpha.CreateSecondaryClusterRequest = (function() { + + /** + * Properties of a CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateSecondaryClusterRequest + * @property {string|null} [parent] CreateSecondaryClusterRequest parent + * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster + * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly + */ + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateSecondaryClusterRequest. + * @implements ICreateSecondaryClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set + */ + function CreateSecondaryClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecondaryClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.parent = ""; + + /** + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.clusterId = ""; + + /** + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.cluster = null; + + /** + * CreateSecondaryClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.requestId = ""; + + /** + * CreateSecondaryClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance + */ + CreateSecondaryClusterRequest.create = function create(properties) { + return new CreateSecondaryClusterRequest(properties); + }; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecondaryClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + */ + CreateSecondaryClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecondaryClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest"; + }; + + return CreateSecondaryClusterRequest; + })(); + + v1alpha.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1alpha.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.validateOnly = false; + + /** + * UpdateClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1alpha.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {google.cloud.alloydb.v1alpha.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {google.cloud.alloydb.v1alpha.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {google.cloud.alloydb.v1alpha.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GcsDestination) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {google.cloud.alloydb.v1alpha.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1alpha.ExportClusterRequest = (function() { + + /** + * Properties of an ExportClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IExportClusterRequest + * @property {google.cloud.alloydb.v1alpha.IGcsDestination|null} [gcsDestination] ExportClusterRequest gcsDestination + * @property {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null} [csvExportOptions] ExportClusterRequest csvExportOptions + * @property {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null} [sqlExportOptions] ExportClusterRequest sqlExportOptions + * @property {string|null} [name] ExportClusterRequest name + * @property {string|null} [database] ExportClusterRequest database + */ + + /** + * Constructs a new ExportClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ExportClusterRequest. + * @implements IExportClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest=} [properties] Properties to set + */ + function ExportClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportClusterRequest gcsDestination. + * @member {google.cloud.alloydb.v1alpha.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.gcsDestination = null; + + /** + * ExportClusterRequest csvExportOptions. + * @member {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null|undefined} csvExportOptions + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.csvExportOptions = null; + + /** + * ExportClusterRequest sqlExportOptions. + * @member {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null|undefined} sqlExportOptions + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.sqlExportOptions = null; + + /** + * ExportClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.name = ""; + + /** + * ExportClusterRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.database = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportClusterRequest destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + Object.defineProperty(ExportClusterRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExportClusterRequest exportOptions. + * @member {"csvExportOptions"|"sqlExportOptions"|undefined} exportOptions + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + */ + Object.defineProperty(ExportClusterRequest.prototype, "exportOptions", { + get: $util.oneOfGetter($oneOfFields = ["csvExportOptions", "sqlExportOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest instance + */ + ExportClusterRequest.create = function create(properties) { + return new ExportClusterRequest(properties); + }; + + /** + * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} message ExportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.alloydb.v1alpha.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) + $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) + $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} message ExportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.csvExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sqlExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + properties.exportOptions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify(message.csvExportOptions); + if (error) + return "csvExportOptions." + error; + } + } + if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + if (properties.exportOptions === 1) + return "exportOptions: multiple values"; + properties.exportOptions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify(message.sqlExportOptions); + if (error) + return "sqlExportOptions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest + */ + ExportClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.fromObject(object.gcsDestination); + } + if (object.csvExportOptions != null) { + if (typeof object.csvExportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.csvExportOptions: object expected"); + message.csvExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.fromObject(object.csvExportOptions); + } + if (object.sqlExportOptions != null) { + if (typeof object.sqlExportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.sqlExportOptions: object expected"); + message.sqlExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.fromObject(object.sqlExportOptions); + } + if (object.name != null) + message.name = String(object.name); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest} message ExportClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.database = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + object.csvExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.toObject(message.csvExportOptions, options); + if (options.oneofs) + object.exportOptions = "csvExportOptions"; + } + if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + object.sqlExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.toObject(message.sqlExportOptions, options); + if (options.oneofs) + object.exportOptions = "sqlExportOptions"; + } + return object; + }; + + /** + * Converts this ExportClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @instance + * @returns {Object.} JSON object + */ + ExportClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterRequest"; + }; + + ExportClusterRequest.CsvExportOptions = (function() { + + /** + * Properties of a CsvExportOptions. + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @interface ICsvExportOptions + * @property {string|null} [selectQuery] CsvExportOptions selectQuery + * @property {string|null} [fieldDelimiter] CsvExportOptions fieldDelimiter + * @property {string|null} [quoteCharacter] CsvExportOptions quoteCharacter + * @property {string|null} [escapeCharacter] CsvExportOptions escapeCharacter + */ + + /** + * Constructs a new CsvExportOptions. + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @classdesc Represents a CsvExportOptions. + * @implements ICsvExportOptions + * @constructor + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set + */ + function CsvExportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvExportOptions selectQuery. + * @member {string} selectQuery + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.selectQuery = ""; + + /** + * CsvExportOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.fieldDelimiter = ""; + + /** + * CsvExportOptions quoteCharacter. + * @member {string} quoteCharacter + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.quoteCharacter = ""; + + /** + * CsvExportOptions escapeCharacter. + * @member {string} escapeCharacter + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.escapeCharacter = ""; + + /** + * Creates a new CsvExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions instance + */ + CsvExportOptions.create = function create(properties) { + return new CsvExportOptions(properties); + }; + + /** + * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldDelimiter); + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.quoteCharacter); + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.escapeCharacter); + return writer; + }; + + /** + * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvExportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selectQuery = reader.string(); + break; + } + case 2: { + message.fieldDelimiter = reader.string(); + break; + } + case 3: { + message.quoteCharacter = reader.string(); + break; + } + case 4: { + message.escapeCharacter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvExportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (!$util.isString(message.selectQuery)) + return "selectQuery: string expected"; + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (!$util.isString(message.quoteCharacter)) + return "quoteCharacter: string expected"; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (!$util.isString(message.escapeCharacter)) + return "escapeCharacter: string expected"; + return null; + }; + + /** + * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions + */ + CsvExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions(); + if (object.selectQuery != null) + message.selectQuery = String(object.selectQuery); + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.quoteCharacter != null) + message.quoteCharacter = String(object.quoteCharacter); + if (object.escapeCharacter != null) + message.escapeCharacter = String(object.escapeCharacter); + return message; + }; + + /** + * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} message CsvExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selectQuery = ""; + object.fieldDelimiter = ""; + object.quoteCharacter = ""; + object.escapeCharacter = ""; + } + if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + object.selectQuery = message.selectQuery; + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + object.quoteCharacter = message.quoteCharacter; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + object.escapeCharacter = message.escapeCharacter; + return object; + }; + + /** + * Converts this CsvExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @instance + * @returns {Object.} JSON object + */ + CsvExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvExportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions"; + }; + + return CsvExportOptions; + })(); + + ExportClusterRequest.SqlExportOptions = (function() { + + /** + * Properties of a SqlExportOptions. + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @interface ISqlExportOptions + * @property {Array.|null} [tables] SqlExportOptions tables + * @property {boolean|null} [schemaOnly] SqlExportOptions schemaOnly + * @property {boolean|null} [cleanTargetObjects] SqlExportOptions cleanTargetObjects + * @property {boolean|null} [ifExistTargetObjects] SqlExportOptions ifExistTargetObjects + */ + + /** + * Constructs a new SqlExportOptions. + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest + * @classdesc Represents a SqlExportOptions. + * @implements ISqlExportOptions + * @constructor + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set + */ + function SqlExportOptions(properties) { + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlExportOptions tables. + * @member {Array.} tables + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.tables = $util.emptyArray; + + /** + * SqlExportOptions schemaOnly. + * @member {boolean|null|undefined} schemaOnly + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.schemaOnly = null; + + /** + * SqlExportOptions cleanTargetObjects. + * @member {boolean|null|undefined} cleanTargetObjects + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.cleanTargetObjects = null; + + /** + * SqlExportOptions ifExistTargetObjects. + * @member {boolean|null|undefined} ifExistTargetObjects + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.ifExistTargetObjects = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_schemaOnly", { + get: $util.oneOfGetter($oneOfFields = ["schemaOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_cleanTargetObjects", { + get: $util.oneOfGetter($oneOfFields = ["cleanTargetObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_ifExistTargetObjects", { + get: $util.oneOfGetter($oneOfFields = ["ifExistTargetObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions instance + */ + SqlExportOptions.create = function create(properties) { + return new SqlExportOptions(properties); + }; + + /** + * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.schemaOnly); + if (message.cleanTargetObjects != null && Object.hasOwnProperty.call(message, "cleanTargetObjects")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanTargetObjects); + if (message.ifExistTargetObjects != null && Object.hasOwnProperty.call(message, "ifExistTargetObjects")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ifExistTargetObjects); + return writer; + }; + + /** + * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlExportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push(reader.string()); + break; + } + case 2: { + message.schemaOnly = reader.bool(); + break; + } + case 3: { + message.cleanTargetObjects = reader.bool(); + break; + } + case 4: { + message.ifExistTargetObjects = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlExportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) + if (!$util.isString(message.tables[i])) + return "tables: string[] expected"; + } + if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + properties._schemaOnly = 1; + if (typeof message.schemaOnly !== "boolean") + return "schemaOnly: boolean expected"; + } + if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { + properties._cleanTargetObjects = 1; + if (typeof message.cleanTargetObjects !== "boolean") + return "cleanTargetObjects: boolean expected"; + } + if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { + properties._ifExistTargetObjects = 1; + if (typeof message.ifExistTargetObjects !== "boolean") + return "ifExistTargetObjects: boolean expected"; + } + return null; + }; + + /** + * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions + */ + SqlExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions(); + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) + message.tables[i] = String(object.tables[i]); + } + if (object.schemaOnly != null) + message.schemaOnly = Boolean(object.schemaOnly); + if (object.cleanTargetObjects != null) + message.cleanTargetObjects = Boolean(object.cleanTargetObjects); + if (object.ifExistTargetObjects != null) + message.ifExistTargetObjects = Boolean(object.ifExistTargetObjects); + return message; + }; + + /** + * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} message SqlExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tables = []; + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = message.tables[j]; + } + if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + object.schemaOnly = message.schemaOnly; + if (options.oneofs) + object._schemaOnly = "schemaOnly"; + } + if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { + object.cleanTargetObjects = message.cleanTargetObjects; + if (options.oneofs) + object._cleanTargetObjects = "cleanTargetObjects"; + } + if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { + object.ifExistTargetObjects = message.ifExistTargetObjects; + if (options.oneofs) + object._ifExistTargetObjects = "ifExistTargetObjects"; + } + return object; + }; + + /** + * Converts this SqlExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @instance + * @returns {Object.} JSON object + */ + SqlExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlExportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions"; + }; + + return SqlExportOptions; + })(); + + return ExportClusterRequest; + })(); + + v1alpha.ExportClusterResponse = (function() { + + /** + * Properties of an ExportClusterResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IExportClusterResponse + * @property {google.cloud.alloydb.v1alpha.IGcsDestination|null} [gcsDestination] ExportClusterResponse gcsDestination + */ + + /** + * Constructs a new ExportClusterResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ExportClusterResponse. + * @implements IExportClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse=} [properties] Properties to set + */ + function ExportClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportClusterResponse gcsDestination. + * @member {google.cloud.alloydb.v1alpha.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @instance + */ + ExportClusterResponse.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportClusterResponse destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @instance + */ + Object.defineProperty(ExportClusterResponse.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse instance + */ + ExportClusterResponse.create = function create(properties) { + return new ExportClusterResponse(properties); + }; + + /** + * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse} message ExportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.alloydb.v1alpha.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse} message ExportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse + */ + ExportClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterResponse(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterResponse.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ExportClusterResponse} message ExportClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this ExportClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @instance + * @returns {Object.} JSON object + */ + ExportClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterResponse"; + }; + + return ExportClusterResponse; + })(); + + v1alpha.ImportClusterRequest = (function() { + + /** + * Properties of an ImportClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IImportClusterRequest + * @property {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null} [sqlImportOptions] ImportClusterRequest sqlImportOptions + * @property {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null} [csvImportOptions] ImportClusterRequest csvImportOptions + * @property {string|null} [name] ImportClusterRequest name + * @property {string|null} [gcsUri] ImportClusterRequest gcsUri + * @property {string|null} [database] ImportClusterRequest database + * @property {string|null} [user] ImportClusterRequest user + */ + + /** + * Constructs a new ImportClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ImportClusterRequest. + * @implements IImportClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest=} [properties] Properties to set + */ + function ImportClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportClusterRequest sqlImportOptions. + * @member {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null|undefined} sqlImportOptions + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.sqlImportOptions = null; + + /** + * ImportClusterRequest csvImportOptions. + * @member {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null|undefined} csvImportOptions + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.csvImportOptions = null; + + /** + * ImportClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.name = ""; + + /** + * ImportClusterRequest gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.gcsUri = ""; + + /** + * ImportClusterRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.database = ""; + + /** + * ImportClusterRequest user. + * @member {string} user + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.user = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportClusterRequest importOptions. + * @member {"sqlImportOptions"|"csvImportOptions"|undefined} importOptions + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + */ + Object.defineProperty(ImportClusterRequest.prototype, "importOptions", { + get: $util.oneOfGetter($oneOfFields = ["sqlImportOptions", "csvImportOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest instance + */ + ImportClusterRequest.create = function create(properties) { + return new ImportClusterRequest(properties); + }; + + /** + * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} message ImportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) + $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.user); + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) + $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} message ImportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.sqlImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.csvImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.database = reader.string(); + break; + } + case 5: { + message.user = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + properties.importOptions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify(message.sqlImportOptions); + if (error) + return "sqlImportOptions." + error; + } + } + if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + if (properties.importOptions === 1) + return "importOptions: multiple values"; + properties.importOptions = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify(message.csvImportOptions); + if (error) + return "csvImportOptions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + return null; + }; + + /** + * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest + */ + ImportClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest(); + if (object.sqlImportOptions != null) { + if (typeof object.sqlImportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ImportClusterRequest.sqlImportOptions: object expected"); + message.sqlImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.fromObject(object.sqlImportOptions); + } + if (object.csvImportOptions != null) { + if (typeof object.csvImportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ImportClusterRequest.csvImportOptions: object expected"); + message.csvImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.fromObject(object.csvImportOptions); + } + if (object.name != null) + message.name = String(object.name); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.database != null) + message.database = String(object.database); + if (object.user != null) + message.user = String(object.user); + return message; + }; + + /** + * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest} message ImportClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gcsUri = ""; + object.database = ""; + object.user = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + object.sqlImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.toObject(message.sqlImportOptions, options); + if (options.oneofs) + object.importOptions = "sqlImportOptions"; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + object.csvImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.toObject(message.csvImportOptions, options); + if (options.oneofs) + object.importOptions = "csvImportOptions"; + } + return object; + }; + + /** + * Converts this ImportClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @instance + * @returns {Object.} JSON object + */ + ImportClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterRequest"; + }; + + ImportClusterRequest.SqlImportOptions = (function() { + + /** + * Properties of a SqlImportOptions. + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @interface ISqlImportOptions + */ + + /** + * Constructs a new SqlImportOptions. + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @classdesc Represents a SqlImportOptions. + * @implements ISqlImportOptions + * @constructor + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set + */ + function SqlImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SqlImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions instance + */ + SqlImportOptions.create = function create(properties) { + return new SqlImportOptions(properties); + }; + + /** + * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlImportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions + */ + SqlImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions) + return object; + return new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions(); + }; + + /** + * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} message SqlImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlImportOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SqlImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @instance + * @returns {Object.} JSON object + */ + SqlImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlImportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions"; + }; + + return SqlImportOptions; + })(); + + ImportClusterRequest.CsvImportOptions = (function() { + + /** + * Properties of a CsvImportOptions. + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @interface ICsvImportOptions + * @property {string|null} [table] CsvImportOptions table + * @property {Array.|null} [columns] CsvImportOptions columns + * @property {string|null} [fieldDelimiter] CsvImportOptions fieldDelimiter + * @property {string|null} [quoteCharacter] CsvImportOptions quoteCharacter + * @property {string|null} [escapeCharacter] CsvImportOptions escapeCharacter + */ + + /** + * Constructs a new CsvImportOptions. + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest + * @classdesc Represents a CsvImportOptions. + * @implements ICsvImportOptions + * @constructor + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set + */ + function CsvImportOptions(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvImportOptions table. + * @member {string} table + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.table = ""; + + /** + * CsvImportOptions columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.columns = $util.emptyArray; + + /** + * CsvImportOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.fieldDelimiter = ""; + + /** + * CsvImportOptions quoteCharacter. + * @member {string} quoteCharacter + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.quoteCharacter = ""; + + /** + * CsvImportOptions escapeCharacter. + * @member {string} escapeCharacter + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.escapeCharacter = ""; + + /** + * Creates a new CsvImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions instance + */ + CsvImportOptions.create = function create(properties) { + return new CsvImportOptions(properties); + }; + + /** + * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldDelimiter); + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.quoteCharacter); + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.escapeCharacter); + return writer; + }; + + /** + * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 3: { + message.fieldDelimiter = reader.string(); + break; + } + case 4: { + message.quoteCharacter = reader.string(); + break; + } + case 5: { + message.escapeCharacter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvImportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (!$util.isString(message.quoteCharacter)) + return "quoteCharacter: string expected"; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (!$util.isString(message.escapeCharacter)) + return "escapeCharacter: string expected"; + return null; + }; + + /** + * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions + */ + CsvImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions(); + if (object.table != null) + message.table = String(object.table); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.quoteCharacter != null) + message.quoteCharacter = String(object.quoteCharacter); + if (object.escapeCharacter != null) + message.escapeCharacter = String(object.escapeCharacter); + return message; + }; + + /** + * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} message CsvImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.table = ""; + object.fieldDelimiter = ""; + object.quoteCharacter = ""; + object.escapeCharacter = ""; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + object.quoteCharacter = message.quoteCharacter; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + object.escapeCharacter = message.escapeCharacter; + return object; + }; + + /** + * Converts this CsvImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @instance + * @returns {Object.} JSON object + */ + CsvImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvImportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions"; + }; + + return CsvImportOptions; + })(); + + return ImportClusterRequest; + })(); + + v1alpha.ImportClusterResponse = (function() { + + /** + * Properties of an ImportClusterResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IImportClusterResponse + * @property {number|Long|null} [bytesDownloaded] ImportClusterResponse bytesDownloaded + */ + + /** + * Constructs a new ImportClusterResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ImportClusterResponse. + * @implements IImportClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse=} [properties] Properties to set + */ + function ImportClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportClusterResponse bytesDownloaded. + * @member {number|Long} bytesDownloaded + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @instance + */ + ImportClusterResponse.prototype.bytesDownloaded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse instance + */ + ImportClusterResponse.create = function create(properties) { + return new ImportClusterResponse(properties); + }; + + /** + * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse} message ImportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesDownloaded != null && Object.hasOwnProperty.call(message, "bytesDownloaded")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bytesDownloaded); + return writer; + }; + + /** + * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse} message ImportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesDownloaded = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) + if (!$util.isInteger(message.bytesDownloaded) && !(message.bytesDownloaded && $util.isInteger(message.bytesDownloaded.low) && $util.isInteger(message.bytesDownloaded.high))) + return "bytesDownloaded: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse + */ + ImportClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ImportClusterResponse(); + if (object.bytesDownloaded != null) + if ($util.Long) + (message.bytesDownloaded = $util.Long.fromValue(object.bytesDownloaded)).unsigned = false; + else if (typeof object.bytesDownloaded === "string") + message.bytesDownloaded = parseInt(object.bytesDownloaded, 10); + else if (typeof object.bytesDownloaded === "number") + message.bytesDownloaded = object.bytesDownloaded; + else if (typeof object.bytesDownloaded === "object") + message.bytesDownloaded = new $util.LongBits(object.bytesDownloaded.low >>> 0, object.bytesDownloaded.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ImportClusterResponse} message ImportClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDownloaded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDownloaded = options.longs === String ? "0" : 0; + if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) + if (typeof message.bytesDownloaded === "number") + object.bytesDownloaded = options.longs === String ? String(message.bytesDownloaded) : message.bytesDownloaded; + else + object.bytesDownloaded = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDownloaded) : options.longs === Number ? new $util.LongBits(message.bytesDownloaded.low >>> 0, message.bytesDownloaded.high >>> 0).toNumber() : message.bytesDownloaded; + return object; + }; + + /** + * Converts this ImportClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @instance + * @returns {Object.} JSON object + */ + ImportClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterResponse"; + }; + + return ImportClusterResponse; + })(); + + v1alpha.UpgradeClusterRequest = (function() { + + /** + * Properties of an UpgradeClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpgradeClusterRequest + * @property {string|null} [name] UpgradeClusterRequest name + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [version] UpgradeClusterRequest version + * @property {string|null} [requestId] UpgradeClusterRequest requestId + * @property {boolean|null} [validateOnly] UpgradeClusterRequest validateOnly + * @property {string|null} [etag] UpgradeClusterRequest etag + */ + + /** + * Constructs a new UpgradeClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpgradeClusterRequest. + * @implements IUpgradeClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest=} [properties] Properties to set + */ + function UpgradeClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.name = ""; + + /** + * UpgradeClusterRequest version. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} version + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.version = 0; + + /** + * UpgradeClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.requestId = ""; + + /** + * UpgradeClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.validateOnly = false; + + /** + * UpgradeClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.etag = ""; + + /** + * Creates a new UpgradeClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest instance + */ + UpgradeClusterRequest.create = function create(properties) { + return new UpgradeClusterRequest(properties); + }; + + /** + * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.int32(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest + */ + UpgradeClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.version) { + default: + if (typeof object.version === "number") { + message.version = object.version; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.version = 0; + break; + case "POSTGRES_13": + case 1: + message.version = 1; + break; + case "POSTGRES_14": + case 2: + message.version = 2; + break; + case "POSTGRES_15": + case 3: + message.version = 3; + break; + case "POSTGRES_16": + case 4: + message.version = 4; + break; + case "POSTGRES_17": + case 5: + message.version = 5; + break; + case "POSTGRES_18": + case 6: + message.version = 6; + break; + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} message UpgradeClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.version] === undefined ? message.version : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.version] : message.version; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this UpgradeClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterRequest"; + }; + + return UpgradeClusterRequest; + })(); + + v1alpha.UpgradeClusterResponse = (function() { + + /** + * Properties of an UpgradeClusterResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpgradeClusterResponse + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [status] UpgradeClusterResponse status + * @property {string|null} [message] UpgradeClusterResponse message + * @property {Array.|null} [clusterUpgradeDetails] UpgradeClusterResponse clusterUpgradeDetails + */ + + /** + * Constructs a new UpgradeClusterResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpgradeClusterResponse. + * @implements IUpgradeClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse=} [properties] Properties to set + */ + function UpgradeClusterResponse(properties) { + this.clusterUpgradeDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterResponse status. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} status + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.status = 0; + + /** + * UpgradeClusterResponse message. + * @member {string} message + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.message = ""; + + /** + * UpgradeClusterResponse clusterUpgradeDetails. + * @member {Array.} clusterUpgradeDetails + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.clusterUpgradeDetails = $util.emptyArray; + + /** + * Creates a new UpgradeClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse instance + */ + UpgradeClusterResponse.create = function create(properties) { + return new UpgradeClusterResponse(properties); + }; + + /** + * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.clusterUpgradeDetails != null && message.clusterUpgradeDetails.length) + for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.encode(message.clusterUpgradeDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.clusterUpgradeDetails && message.clusterUpgradeDetails.length)) + message.clusterUpgradeDetails = []; + message.clusterUpgradeDetails.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.clusterUpgradeDetails != null && message.hasOwnProperty("clusterUpgradeDetails")) { + if (!Array.isArray(message.clusterUpgradeDetails)) + return "clusterUpgradeDetails: array expected"; + for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify(message.clusterUpgradeDetails[i]); + if (error) + return "clusterUpgradeDetails." + error; + } + } + return null; + }; + + /** + * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse + */ + UpgradeClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse(); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 4: + message.status = 4; + break; + case "IN_PROGRESS": + case 5: + message.status = 5; + break; + case "SUCCESS": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.status = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.clusterUpgradeDetails) { + if (!Array.isArray(object.clusterUpgradeDetails)) + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.clusterUpgradeDetails: array expected"); + message.clusterUpgradeDetails = []; + for (var i = 0; i < object.clusterUpgradeDetails.length; ++i) { + if (typeof object.clusterUpgradeDetails[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.clusterUpgradeDetails: object expected"); + message.clusterUpgradeDetails[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.fromObject(object.clusterUpgradeDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} message UpgradeClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clusterUpgradeDetails = []; + if (options.defaults) { + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] : message.status; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.clusterUpgradeDetails && message.clusterUpgradeDetails.length) { + object.clusterUpgradeDetails = []; + for (var j = 0; j < message.clusterUpgradeDetails.length; ++j) + object.clusterUpgradeDetails[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.toObject(message.clusterUpgradeDetails[j], options); + } + return object; + }; + + /** + * Converts this UpgradeClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse"; + }; + + UpgradeClusterResponse.StageInfo = (function() { + + /** + * Properties of a StageInfo. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @interface IStageInfo + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null} [stage] StageInfo stage + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [status] StageInfo status + * @property {string|null} [logsUrl] StageInfo logsUrl + */ + + /** + * Constructs a new StageInfo. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @classdesc Represents a StageInfo. + * @implements IStageInfo + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set + */ + function StageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageInfo stage. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage} stage + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.stage = 0; + + /** + * StageInfo status. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} status + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.status = 0; + + /** + * StageInfo logsUrl. + * @member {string} logsUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.logsUrl = ""; + + /** + * Creates a new StageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo instance + */ + StageInfo.create = function create(properties) { + return new StageInfo(properties); + }; + + /** + * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); + if (message.logsUrl != null && Object.hasOwnProperty.call(message, "logsUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.logsUrl); + return writer; + }; + + /** + * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stage = reader.int32(); + break; + } + case 2: { + message.status = reader.int32(); + break; + } + case 3: { + message.logsUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stage != null && message.hasOwnProperty("stage")) + switch (message.stage) { + default: + return "stage: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) + if (!$util.isString(message.logsUrl)) + return "logsUrl: string expected"; + return null; + }; + + /** + * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo + */ + StageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo(); + switch (object.stage) { + default: + if (typeof object.stage === "number") { + message.stage = object.stage; + break; + } + break; + case "STAGE_UNSPECIFIED": + case 0: + message.stage = 0; + break; + case "ALLOYDB_PRECHECK": + case 1: + message.stage = 1; + break; + case "PG_UPGRADE_CHECK": + case 2: + message.stage = 2; + break; + case "PREPARE_FOR_UPGRADE": + case 5: + message.stage = 5; + break; + case "PRIMARY_INSTANCE_UPGRADE": + case 3: + message.stage = 3; + break; + case "READ_POOL_INSTANCES_UPGRADE": + case 4: + message.stage = 4; + break; + case "ROLLBACK": + case 6: + message.stage = 6; + break; + case "CLEANUP": + case 7: + message.stage = 7; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 4: + message.status = 4; + break; + case "IN_PROGRESS": + case 5: + message.status = 5; + break; + case "SUCCESS": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.status = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + } + if (object.logsUrl != null) + message.logsUrl = String(object.logsUrl); + return message; + }; + + /** + * Creates a plain object from a StageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} message StageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.logsUrl = ""; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] : message.stage; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] : message.status; + if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) + object.logsUrl = message.logsUrl; + return object; + }; + + /** + * Converts this StageInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @instance + * @returns {Object.} JSON object + */ + StageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo"; + }; + + return StageInfo; + })(); + + UpgradeClusterResponse.InstanceUpgradeDetails = (function() { + + /** + * Properties of an InstanceUpgradeDetails. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @interface IInstanceUpgradeDetails + * @property {string|null} [name] InstanceUpgradeDetails name + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [upgradeStatus] InstanceUpgradeDetails upgradeStatus + * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [instanceType] InstanceUpgradeDetails instanceType + */ + + /** + * Constructs a new InstanceUpgradeDetails. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @classdesc Represents an InstanceUpgradeDetails. + * @implements IInstanceUpgradeDetails + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set + */ + function InstanceUpgradeDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceUpgradeDetails name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.name = ""; + + /** + * InstanceUpgradeDetails upgradeStatus. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} upgradeStatus + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.upgradeStatus = 0; + + /** + * InstanceUpgradeDetails instanceType. + * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.instanceType = 0; + + /** + * Creates a new InstanceUpgradeDetails instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails instance + */ + InstanceUpgradeDetails.create = function create(properties) { + return new InstanceUpgradeDetails(properties); + }; + + /** + * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceUpgradeDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.instanceType); + return writer; + }; + + /** + * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceUpgradeDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.upgradeStatus = reader.int32(); + break; + } + case 3: { + message.instanceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceUpgradeDetails message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceUpgradeDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + switch (message.upgradeStatus) { + default: + return "upgradeStatus: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + */ + InstanceUpgradeDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails(); + if (object.name != null) + message.name = String(object.name); + switch (object.upgradeStatus) { + default: + if (typeof object.upgradeStatus === "number") { + message.upgradeStatus = object.upgradeStatus; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.upgradeStatus = 0; + break; + case "NOT_STARTED": + case 4: + message.upgradeStatus = 4; + break; + case "IN_PROGRESS": + case 5: + message.upgradeStatus = 5; + break; + case "SUCCESS": + case 1: + message.upgradeStatus = 1; + break; + case "FAILED": + case 2: + message.upgradeStatus = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.upgradeStatus = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.upgradeStatus = 6; + break; + case "CANCELLED": + case 7: + message.upgradeStatus = 7; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} message InstanceUpgradeDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceUpgradeDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] : message.instanceType; + return object; + }; + + /** + * Converts this InstanceUpgradeDetails to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + * @returns {Object.} JSON object + */ + InstanceUpgradeDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceUpgradeDetails + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails"; + }; + + return InstanceUpgradeDetails; + })(); + + UpgradeClusterResponse.ClusterUpgradeDetails = (function() { + + /** + * Properties of a ClusterUpgradeDetails. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @interface IClusterUpgradeDetails + * @property {string|null} [name] ClusterUpgradeDetails name + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [upgradeStatus] ClusterUpgradeDetails upgradeStatus + * @property {google.cloud.alloydb.v1alpha.Cluster.ClusterType|null} [clusterType] ClusterUpgradeDetails clusterType + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] ClusterUpgradeDetails databaseVersion + * @property {Array.|null} [stageInfo] ClusterUpgradeDetails stageInfo + * @property {Array.|null} [instanceUpgradeDetails] ClusterUpgradeDetails instanceUpgradeDetails + */ + + /** + * Constructs a new ClusterUpgradeDetails. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse + * @classdesc Represents a ClusterUpgradeDetails. + * @implements IClusterUpgradeDetails + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set + */ + function ClusterUpgradeDetails(properties) { + this.stageInfo = []; + this.instanceUpgradeDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterUpgradeDetails name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.name = ""; + + /** + * ClusterUpgradeDetails upgradeStatus. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} upgradeStatus + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.upgradeStatus = 0; + + /** + * ClusterUpgradeDetails clusterType. + * @member {google.cloud.alloydb.v1alpha.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.clusterType = 0; + + /** + * ClusterUpgradeDetails databaseVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.databaseVersion = 0; + + /** + * ClusterUpgradeDetails stageInfo. + * @member {Array.} stageInfo + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.stageInfo = $util.emptyArray; + + /** + * ClusterUpgradeDetails instanceUpgradeDetails. + * @member {Array.} instanceUpgradeDetails + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.instanceUpgradeDetails = $util.emptyArray; + + /** + * Creates a new ClusterUpgradeDetails instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails instance + */ + ClusterUpgradeDetails.create = function create(properties) { + return new ClusterUpgradeDetails(properties); + }; + + /** + * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUpgradeDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.clusterType); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.databaseVersion); + if (message.stageInfo != null && message.stageInfo.length) + for (var i = 0; i < message.stageInfo.length; ++i) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.encode(message.stageInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.instanceUpgradeDetails != null && message.instanceUpgradeDetails.length) + for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.encode(message.instanceUpgradeDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUpgradeDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.upgradeStatus = reader.int32(); + break; + } + case 3: { + message.clusterType = reader.int32(); + break; + } + case 4: { + message.databaseVersion = reader.int32(); + break; + } + case 5: { + if (!(message.stageInfo && message.stageInfo.length)) + message.stageInfo = []; + message.stageInfo.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.instanceUpgradeDetails && message.instanceUpgradeDetails.length)) + message.instanceUpgradeDetails = []; + message.instanceUpgradeDetails.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterUpgradeDetails message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterUpgradeDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + switch (message.upgradeStatus) { + default: + return "upgradeStatus: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stageInfo != null && message.hasOwnProperty("stageInfo")) { + if (!Array.isArray(message.stageInfo)) + return "stageInfo: array expected"; + for (var i = 0; i < message.stageInfo.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify(message.stageInfo[i]); + if (error) + return "stageInfo." + error; + } + } + if (message.instanceUpgradeDetails != null && message.hasOwnProperty("instanceUpgradeDetails")) { + if (!Array.isArray(message.instanceUpgradeDetails)) + return "instanceUpgradeDetails: array expected"; + for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify(message.instanceUpgradeDetails[i]); + if (error) + return "instanceUpgradeDetails." + error; + } + } + return null; + }; + + /** + * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + */ + ClusterUpgradeDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails(); + if (object.name != null) + message.name = String(object.name); + switch (object.upgradeStatus) { + default: + if (typeof object.upgradeStatus === "number") { + message.upgradeStatus = object.upgradeStatus; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.upgradeStatus = 0; + break; + case "NOT_STARTED": + case 4: + message.upgradeStatus = 4; + break; + case "IN_PROGRESS": + case 5: + message.upgradeStatus = 5; + break; + case "SUCCESS": + case 1: + message.upgradeStatus = 1; + break; + case "FAILED": + case 2: + message.upgradeStatus = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.upgradeStatus = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.upgradeStatus = 6; + break; + case "CANCELLED": + case 7: + message.upgradeStatus = 7; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.databaseVersion = 6; + break; + } + if (object.stageInfo) { + if (!Array.isArray(object.stageInfo)) + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: array expected"); + message.stageInfo = []; + for (var i = 0; i < object.stageInfo.length; ++i) { + if (typeof object.stageInfo[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: object expected"); + message.stageInfo[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.fromObject(object.stageInfo[i]); + } + } + if (object.instanceUpgradeDetails) { + if (!Array.isArray(object.instanceUpgradeDetails)) + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: array expected"); + message.instanceUpgradeDetails = []; + for (var i = 0; i < object.instanceUpgradeDetails.length; ++i) { + if (typeof object.instanceUpgradeDetails[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: object expected"); + message.instanceUpgradeDetails[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.fromObject(object.instanceUpgradeDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} message ClusterUpgradeDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterUpgradeDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.stageInfo = []; + object.instanceUpgradeDetails = []; + } + if (options.defaults) { + object.name = ""; + object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.stageInfo && message.stageInfo.length) { + object.stageInfo = []; + for (var j = 0; j < message.stageInfo.length; ++j) + object.stageInfo[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.toObject(message.stageInfo[j], options); + } + if (message.instanceUpgradeDetails && message.instanceUpgradeDetails.length) { + object.instanceUpgradeDetails = []; + for (var j = 0; j < message.instanceUpgradeDetails.length; ++j) + object.instanceUpgradeDetails[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.toObject(message.instanceUpgradeDetails[j], options); + } + return object; + }; + + /** + * Converts this ClusterUpgradeDetails to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + * @returns {Object.} JSON object + */ + ClusterUpgradeDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterUpgradeDetails + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails"; + }; + + return ClusterUpgradeDetails; + })(); + + /** + * Status enum. + * @name google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} NOT_STARTED=4 NOT_STARTED value + * @property {number} IN_PROGRESS=5 IN_PROGRESS value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} FAILED=2 FAILED value + * @property {number} PARTIAL_SUCCESS=3 PARTIAL_SUCCESS value + * @property {number} CANCEL_IN_PROGRESS=6 CANCEL_IN_PROGRESS value + * @property {number} CANCELLED=7 CANCELLED value + */ + UpgradeClusterResponse.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[4] = "NOT_STARTED"] = 4; + values[valuesById[5] = "IN_PROGRESS"] = 5; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "PARTIAL_SUCCESS"] = 3; + values[valuesById[6] = "CANCEL_IN_PROGRESS"] = 6; + values[valuesById[7] = "CANCELLED"] = 7; + return values; + })(); + + /** + * Stage enum. + * @name google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage + * @enum {number} + * @property {number} STAGE_UNSPECIFIED=0 STAGE_UNSPECIFIED value + * @property {number} ALLOYDB_PRECHECK=1 ALLOYDB_PRECHECK value + * @property {number} PG_UPGRADE_CHECK=2 PG_UPGRADE_CHECK value + * @property {number} PREPARE_FOR_UPGRADE=5 PREPARE_FOR_UPGRADE value + * @property {number} PRIMARY_INSTANCE_UPGRADE=3 PRIMARY_INSTANCE_UPGRADE value + * @property {number} READ_POOL_INSTANCES_UPGRADE=4 READ_POOL_INSTANCES_UPGRADE value + * @property {number} ROLLBACK=6 ROLLBACK value + * @property {number} CLEANUP=7 CLEANUP value + */ + UpgradeClusterResponse.Stage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_PRECHECK"] = 1; + values[valuesById[2] = "PG_UPGRADE_CHECK"] = 2; + values[valuesById[5] = "PREPARE_FOR_UPGRADE"] = 5; + values[valuesById[3] = "PRIMARY_INSTANCE_UPGRADE"] = 3; + values[valuesById[4] = "READ_POOL_INSTANCES_UPGRADE"] = 4; + values[valuesById[6] = "ROLLBACK"] = 6; + values[valuesById[7] = "CLEANUP"] = 7; + return values; + })(); + + return UpgradeClusterResponse; + })(); + + v1alpha.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + * @property {string|null} [etag] DeleteClusterRequest etag + * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly + * @property {boolean|null} [force] DeleteClusterRequest force + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * DeleteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.etag = ""; + + /** + * DeleteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.validateOnly = false; + + /** + * DeleteClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.force = false; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1alpha.SwitchoverClusterRequest = (function() { + + /** + * Properties of a SwitchoverClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISwitchoverClusterRequest + * @property {string|null} [name] SwitchoverClusterRequest name + * @property {string|null} [requestId] SwitchoverClusterRequest requestId + * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly + */ + + /** + * Constructs a new SwitchoverClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SwitchoverClusterRequest. + * @implements ISwitchoverClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest=} [properties] Properties to set + */ + function SwitchoverClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SwitchoverClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.name = ""; + + /** + * SwitchoverClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.requestId = ""; + + /** + * SwitchoverClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new SwitchoverClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest instance + */ + SwitchoverClusterRequest.create = function create(properties) { + return new SwitchoverClusterRequest(properties); + }; + + /** + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchoverClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchoverClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SwitchoverClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SwitchoverClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest + */ + SwitchoverClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} message SwitchoverClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwitchoverClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this SwitchoverClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @instance + * @returns {Object.} JSON object + */ + SwitchoverClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SwitchoverClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SwitchoverClusterRequest"; + }; + + return SwitchoverClusterRequest; + })(); + + v1alpha.PromoteClusterRequest = (function() { + + /** + * Properties of a PromoteClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IPromoteClusterRequest + * @property {string|null} [name] PromoteClusterRequest name + * @property {string|null} [requestId] PromoteClusterRequest requestId + * @property {string|null} [etag] PromoteClusterRequest etag + * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly + */ + + /** + * Constructs a new PromoteClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set + */ + function PromoteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromoteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.name = ""; + + /** + * PromoteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.requestId = ""; + + /** + * PromoteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.etag = ""; + + /** + * PromoteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest instance + */ + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); + }; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromoteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromoteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest + */ + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.PromoteClusterRequest} message PromoteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromoteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PromoteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromoteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.PromoteClusterRequest"; + }; + + return PromoteClusterRequest; + })(); + + v1alpha.RestoreClusterRequest = (function() { + + /** + * Properties of a RestoreClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IRestoreClusterRequest + * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource + * @property {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource + * @property {string|null} [parent] RestoreClusterRequest parent + * @property {string|null} [clusterId] RestoreClusterRequest clusterId + * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] RestoreClusterRequest cluster + * @property {string|null} [requestId] RestoreClusterRequest requestId + * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly + */ + + /** + * Constructs a new RestoreClusterRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set + */ + function RestoreClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.backupSource = null; + + /** + * RestoreClusterRequest continuousBackupSource. + * @member {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null|undefined} continuousBackupSource + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.continuousBackupSource = null; + + /** + * RestoreClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.parent = ""; + + /** + * RestoreClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.clusterId = ""; + + /** + * RestoreClusterRequest cluster. + * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.cluster = null; + + /** + * RestoreClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.requestId = ""; + + /** + * RestoreClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + */ + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest instance + */ + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); + }; + + /** + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) + $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify(message.continuousBackupSource); + if (error) + return "continuousBackupSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest + */ + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); + } + if (object.continuousBackupSource != null) { + if (typeof object.continuousBackupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.continuousBackupSource: object expected"); + message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.fromObject(object.continuousBackupSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1alpha.RestoreClusterRequest} message RestoreClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + object.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.toObject(message.continuousBackupSource, options); + if (options.oneofs) + object.source = "continuousBackupSource"; + } + return object; + }; + + /** + * Converts this RestoreClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestoreClusterRequest"; + }; + + return RestoreClusterRequest; + })(); + + v1alpha.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1alpha.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1alpha.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1alpha.InstanceView|null} [view] GetInstanceRequest view + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1alpha.InstanceView} view + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.view = 0; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INSTANCE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "INSTANCE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "INSTANCE_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1alpha.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.requestId = ""; + + /** + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1alpha.CreateSecondaryInstanceRequest = (function() { + + /** + * Properties of a CreateSecondaryInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateSecondaryInstanceRequest + * @property {string|null} [parent] CreateSecondaryInstanceRequest parent + * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId + * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateSecondaryInstanceRequest instance + * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set + */ + function CreateSecondaryInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecondaryInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.parent = ""; + + /** + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.instanceId = ""; + + /** + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.instance = null; + + /** + * CreateSecondaryInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.requestId = ""; + + /** + * CreateSecondaryInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance + */ + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecondaryInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + */ + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest"; + }; + + return CreateSecondaryInstanceRequest; + })(); + + v1alpha.CreateInstanceRequests = (function() { + + /** + * Properties of a CreateInstanceRequests. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + */ + + /** + * Constructs a new CreateInstanceRequests. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set + */ + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @instance + */ + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + + /** + * Creates a new CreateInstanceRequests instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests instance + */ + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); + }; + + /** + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequests.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createInstanceRequests != null && message.createInstanceRequests.length) + for (var i = 0; i < message.createInstanceRequests.length; ++i) + $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequests.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequests message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequests.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { + if (!Array.isArray(message.createInstanceRequests)) + return "createInstanceRequests: array expected"; + for (var i = 0; i < message.createInstanceRequests.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify(message.createInstanceRequests[i]); + if (error) + return "createInstanceRequests." + error; + } + } + return null; + }; + + /** + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests + */ + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); + if (object.createInstanceRequests) { + if (!Array.isArray(object.createInstanceRequests)) + throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: array expected"); + message.createInstanceRequests = []; + for (var i = 0; i < object.createInstanceRequests.length; ++i) { + if (typeof object.createInstanceRequests[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: object expected"); + message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequests} message CreateInstanceRequests + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequests.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.createInstanceRequests = []; + if (message.createInstanceRequests && message.createInstanceRequests.length) { + object.createInstanceRequests = []; + for (var j = 0; j < message.createInstanceRequests.length; ++j) + object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); + } + return object; + }; + + /** + * Converts this CreateInstanceRequests to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequests.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequests + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequests"; + }; + + return CreateInstanceRequests; + })(); + + v1alpha.BatchCreateInstancesRequest = (function() { + + /** + * Properties of a BatchCreateInstancesRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBatchCreateInstancesRequest + * @property {string|null} [parent] BatchCreateInstancesRequest parent + * @property {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests + * @property {string|null} [requestId] BatchCreateInstancesRequest requestId + */ + + /** + * Constructs a new BatchCreateInstancesRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set + */ + function BatchCreateInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.parent = ""; + + /** + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requests = null; + + /** + * BatchCreateInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requestId = ""; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + */ + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest + */ + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.requests: object expected"); + message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.fromObject(object.requests); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requests = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.toObject(message.requests, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this BatchCreateInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest"; + }; + + return BatchCreateInstancesRequest; + })(); + + v1alpha.BatchCreateInstancesResponse = (function() { + + /** + * Properties of a BatchCreateInstancesResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + */ + + /** + * Constructs a new BatchCreateInstancesResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set + */ + function BatchCreateInstancesResponse(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @instance + */ + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + */ + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse + */ + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse"; + }; + + return BatchCreateInstancesResponse; + })(); + + v1alpha.BatchCreateInstancesMetadata = (function() { + + /** + * Properties of a BatchCreateInstancesMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + */ + + /** + * Constructs a new BatchCreateInstancesMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set + */ + function BatchCreateInstancesMetadata(properties) { + this.instanceTargets = []; + this.instanceStatuses = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @instance + */ + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + + /** + * BatchCreateInstancesMetadata instanceStatuses. + * @member {Object.} instanceStatuses + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @instance + */ + BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + + /** + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + */ + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTargets != null && message.instanceTargets.length) + for (var i = 0; i < message.instanceTargets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); + if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) + for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instanceTargets && message.instanceTargets.length)) + message.instanceTargets = []; + message.instanceTargets.push(reader.string()); + break; + } + case 2: { + if (message.instanceStatuses === $util.emptyObject) + message.instanceStatuses = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.instanceStatuses[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { + if (!Array.isArray(message.instanceTargets)) + return "instanceTargets: array expected"; + for (var i = 0; i < message.instanceTargets.length; ++i) + if (!$util.isString(message.instanceTargets[i])) + return "instanceTargets: string[] expected"; + } + if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { + if (!$util.isObject(message.instanceStatuses)) + return "instanceStatuses: object expected"; + var key = Object.keys(message.instanceStatuses); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); + if (error) + return "instanceStatuses." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + */ + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(); + if (object.instanceTargets) { + if (!Array.isArray(object.instanceTargets)) + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceTargets: array expected"); + message.instanceTargets = []; + for (var i = 0; i < object.instanceTargets.length; ++i) + message.instanceTargets[i] = String(object.instanceTargets[i]); + } + if (object.instanceStatuses) { + if (typeof object.instanceStatuses !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses = {}; + for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { + if (typeof object.instanceStatuses[keys[i]] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceTargets = []; + if (options.objects || options.defaults) + object.instanceStatuses = {}; + if (message.instanceTargets && message.instanceTargets.length) { + object.instanceTargets = []; + for (var j = 0; j < message.instanceTargets.length; ++j) + object.instanceTargets[j] = message.instanceTargets[j]; + } + var keys2; + if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { + object.instanceStatuses = {}; + for (var j = 0; j < keys2.length; ++j) + object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); + } + return object; + }; + + /** + * Converts this BatchCreateInstancesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata"; + }; + + return BatchCreateInstancesMetadata; + })(); + + v1alpha.BatchCreateInstanceStatus = (function() { + + /** + * Properties of a BatchCreateInstanceStatus. + * @memberof google.cloud.alloydb.v1alpha + * @interface IBatchCreateInstanceStatus + * @property {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state + * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg + * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error + * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type + */ + + /** + * Constructs a new BatchCreateInstanceStatus. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus + * @constructor + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set + */ + function BatchCreateInstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.state = 0; + + /** + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.errorMsg = ""; + + /** + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.error = null; + + /** + * BatchCreateInstanceStatus type. + * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} type + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.type = 0; + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + */ + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); + }; + + /** + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstanceStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.errorMsg = reader.string(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstanceStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + if (!$util.isString(message.errorMsg)) + return "errorMsg: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus + */ + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING_CREATE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ROLLED_BACK": + case 6: + message.state = 6; + break; + } + if (object.errorMsg != null) + message.errorMsg = String(object.errorMsg); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "READ_POOL": + case 2: + message.type = 2; + break; + case "SECONDARY": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] : message.state; + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + object.errorMsg = message.errorMsg; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] : message.type; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstanceStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus"; + }; + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING_CREATE=1 PENDING_CREATE value + * @property {number} READY=2 READY value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED=5 FAILED value + * @property {number} ROLLED_BACK=6 ROLLED_BACK value + */ + BatchCreateInstanceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_CREATE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ROLLED_BACK"] = 6; + return values; + })(); + + return BatchCreateInstanceStatus; + })(); + + v1alpha.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.requestId = ""; + + /** + * UpdateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.validateOnly = false; + + /** + * UpdateInstanceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1alpha.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [etag] DeleteInstanceRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.requestId = ""; + + /** + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1alpha.FailoverInstanceRequest = (function() { + + /** + * Properties of a FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly + */ + + /** + * Constructs a new FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set + */ + function FailoverInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.name = ""; + + /** + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.requestId = ""; + + /** + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest instance + */ + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); + }; + + /** + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailoverInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailoverInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FailoverInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FailoverInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest + */ + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FailoverInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this FailoverInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + FailoverInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FailoverInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.FailoverInstanceRequest"; + }; + + return FailoverInstanceRequest; + })(); + + v1alpha.InjectFaultRequest = (function() { + + /** + * Properties of an InjectFaultRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IInjectFaultRequest + * @property {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType + * @property {string|null} [name] InjectFaultRequest name + * @property {string|null} [requestId] InjectFaultRequest requestId + * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly + */ + + /** + * Constructs a new InjectFaultRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest=} [properties] Properties to set + */ + function InjectFaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.faultType = 0; + + /** + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.name = ""; + + /** + * InjectFaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.requestId = ""; + + /** + * InjectFaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.validateOnly = false; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest instance + */ + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); + }; + + /** + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectFaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectFaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.InjectFaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.faultType = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InjectFaultRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InjectFaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faultType != null && message.hasOwnProperty("faultType")) + switch (message.faultType) { + default: + return "faultType: enum value expected"; + case 0: + case 1: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest + */ + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.InjectFaultRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.InjectFaultRequest(); + switch (object.faultType) { + default: + if (typeof object.faultType === "number") { + message.faultType = object.faultType; + break; + } + break; + case "FAULT_TYPE_UNSPECIFIED": + case 0: + message.faultType = 0; + break; + case "STOP_VM": + case 1: + message.faultType = 1; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1alpha.InjectFaultRequest} message InjectFaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InjectFaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.faultType != null && message.hasOwnProperty("faultType")) + object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType[message.faultType] : message.faultType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this InjectFaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @instance + * @returns {Object.} JSON object + */ + InjectFaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InjectFaultRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.InjectFaultRequest"; + }; + + /** + * FaultType enum. + * @name google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType + * @enum {number} + * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value + * @property {number} STOP_VM=1 STOP_VM value + */ + InjectFaultRequest.FaultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP_VM"] = 1; + return values; + })(); + + return InjectFaultRequest; + })(); + + v1alpha.RestartInstanceRequest = (function() { + + /** + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + * @property {string|null} [requestId] RestartInstanceRequest requestId + * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly + * @property {Array.|null} [nodeIds] RestartInstanceRequest nodeIds + */ + + /** + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set + */ + function RestartInstanceRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.name = ""; + + /** + * RestartInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.requestId = ""; + + /** + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.validateOnly = false; + + /** + * RestartInstanceRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest instance + */ + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); + }; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeIds[i]); + return writer; + }; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest + */ + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.alloydb.v1alpha.RestartInstanceRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1alpha.RestartInstanceRequest} message RestartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + return object; + }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestartInstanceRequest"; + }; + + return RestartInstanceRequest; + })(); + + v1alpha.ExecuteSqlRequest = (function() { + + /** + * Properties of an ExecuteSqlRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IExecuteSqlRequest + * @property {string|null} [password] ExecuteSqlRequest password + * @property {string|null} [instance] ExecuteSqlRequest instance + * @property {string|null} [database] ExecuteSqlRequest database + * @property {string|null} [user] ExecuteSqlRequest user + * @property {string|null} [sqlStatement] ExecuteSqlRequest sqlStatement + * @property {boolean|null} [validateOnly] ExecuteSqlRequest validateOnly + */ + + /** + * Constructs a new ExecuteSqlRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest=} [properties] Properties to set + */ + function ExecuteSqlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlRequest password. + * @member {string|null|undefined} password + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.password = null; + + /** + * ExecuteSqlRequest instance. + * @member {string} instance + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.instance = ""; + + /** + * ExecuteSqlRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.database = ""; + + /** + * ExecuteSqlRequest user. + * @member {string} user + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.user = ""; + + /** + * ExecuteSqlRequest sqlStatement. + * @member {string} sqlStatement + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.sqlStatement = ""; + + /** + * ExecuteSqlRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteSqlRequest userCredential. + * @member {"password"|undefined} userCredential + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + */ + Object.defineProperty(ExecuteSqlRequest.prototype, "userCredential", { + get: $util.oneOfGetter($oneOfFields = ["password"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest instance + */ + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); + }; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlStatement); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.password); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.password = reader.string(); + break; + } + case 1: { + message.instance = reader.string(); + break; + } + case 2: { + message.database = reader.string(); + break; + } + case 3: { + message.user = reader.string(); + break; + } + case 4: { + message.sqlStatement = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.password != null && message.hasOwnProperty("password")) { + properties.userCredential = 1; + if (!$util.isString(message.password)) + return "password: string expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (!$util.isString(message.sqlStatement)) + return "sqlStatement: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest + */ + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest(); + if (object.password != null) + message.password = String(object.password); + if (object.instance != null) + message.instance = String(object.instance); + if (object.database != null) + message.database = String(object.database); + if (object.user != null) + message.user = String(object.user); + if (object.sqlStatement != null) + message.sqlStatement = String(object.sqlStatement); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = ""; + object.database = ""; + object.user = ""; + object.sqlStatement = ""; + object.validateOnly = false; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + object.sqlStatement = message.sqlStatement; + if (message.password != null && message.hasOwnProperty("password")) { + object.password = message.password; + if (options.oneofs) + object.userCredential = "password"; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExecuteSqlRequest"; + }; + + return ExecuteSqlRequest; + })(); + + v1alpha.ExecuteSqlResponse = (function() { + + /** + * Properties of an ExecuteSqlResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IExecuteSqlResponse + * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults + * @property {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata + */ + + /** + * Constructs a new ExecuteSqlResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ExecuteSqlResponse. + * @implements IExecuteSqlResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse=} [properties] Properties to set + */ + function ExecuteSqlResponse(properties) { + this.sqlResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlResponse sqlResults. + * @member {Array.} sqlResults + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @instance + */ + ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; + + /** + * ExecuteSqlResponse metadata. + * @member {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null|undefined} metadata + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @instance + */ + ExecuteSqlResponse.prototype.metadata = null; + + /** + * Creates a new ExecuteSqlResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse instance + */ + ExecuteSqlResponse.create = function create(properties) { + return new ExecuteSqlResponse(properties); + }; + + /** + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sqlResults != null && message.sqlResults.length) + for (var i = 0; i < message.sqlResults.length; ++i) + $root.google.cloud.alloydb.v1alpha.SqlResult.encode(message.sqlResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sqlResults && message.sqlResults.length)) + message.sqlResults = []; + message.sqlResults.push($root.google.cloud.alloydb.v1alpha.SqlResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.metadata = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sqlResults != null && message.hasOwnProperty("sqlResults")) { + if (!Array.isArray(message.sqlResults)) + return "sqlResults: array expected"; + for (var i = 0; i < message.sqlResults.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.SqlResult.verify(message.sqlResults[i]); + if (error) + return "sqlResults." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse + */ + ExecuteSqlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse(); + if (object.sqlResults) { + if (!Array.isArray(object.sqlResults)) + throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlResponse.sqlResults: array expected"); + message.sqlResults = []; + for (var i = 0; i < object.sqlResults.length; ++i) { + if (typeof object.sqlResults[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlResponse.sqlResults: object expected"); + message.sqlResults[i] = $root.google.cloud.alloydb.v1alpha.SqlResult.fromObject(object.sqlResults[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlResponse.metadata: object expected"); + message.metadata = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} message ExecuteSqlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sqlResults = []; + if (options.defaults) + object.metadata = null; + if (message.sqlResults && message.sqlResults.length) { + object.sqlResults = []; + for (var j = 0; j < message.sqlResults.length; ++j) + object.sqlResults[j] = $root.google.cloud.alloydb.v1alpha.SqlResult.toObject(message.sqlResults[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ExecuteSqlResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExecuteSqlResponse"; + }; + + return ExecuteSqlResponse; + })(); + + v1alpha.ExecuteSqlMetadata = (function() { + + /** + * Properties of an ExecuteSqlMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @interface IExecuteSqlMetadata + * @property {string|null} [message] ExecuteSqlMetadata message + * @property {boolean|null} [partialResult] ExecuteSqlMetadata partialResult + * @property {google.protobuf.IDuration|null} [sqlStatementExecutionDuration] ExecuteSqlMetadata sqlStatementExecutionDuration + * @property {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|null} [status] ExecuteSqlMetadata status + */ + + /** + * Constructs a new ExecuteSqlMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an ExecuteSqlMetadata. + * @implements IExecuteSqlMetadata + * @constructor + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata=} [properties] Properties to set + */ + function ExecuteSqlMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlMetadata message. + * @member {string} message + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.message = ""; + + /** + * ExecuteSqlMetadata partialResult. + * @member {boolean} partialResult + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.partialResult = false; + + /** + * ExecuteSqlMetadata sqlStatementExecutionDuration. + * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; + + /** + * ExecuteSqlMetadata status. + * @member {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status} status + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.status = 0; + + /** + * Creates a new ExecuteSqlMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata instance + */ + ExecuteSqlMetadata.create = function create(properties) { + return new ExecuteSqlMetadata(properties); + }; + + /** + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialResult); + if (message.sqlStatementExecutionDuration != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionDuration")) + $root.google.protobuf.Duration.encode(message.sqlStatementExecutionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.partialResult = reader.bool(); + break; + } + case 3: { + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.partialResult != null && message.hasOwnProperty("partialResult")) + if (typeof message.partialResult !== "boolean") + return "partialResult: boolean expected"; + if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionDuration); + if (error) + return "sqlStatementExecutionDuration." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata + */ + ExecuteSqlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata(); + if (object.message != null) + message.message = String(object.message); + if (object.partialResult != null) + message.partialResult = Boolean(object.partialResult); + if (object.sqlStatementExecutionDuration != null) { + if (typeof object.sqlStatementExecutionDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.sqlStatementExecutionDuration: object expected"); + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionDuration); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "OK": + case 1: + message.status = 1; + break; + case "PARTIAL": + case 2: + message.status = 2; + break; + case "ERROR": + case 3: + message.status = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} message ExecuteSqlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.partialResult = false; + object.sqlStatementExecutionDuration = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.partialResult != null && message.hasOwnProperty("partialResult")) + object.partialResult = message.partialResult; + if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) + object.sqlStatementExecutionDuration = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionDuration, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status[message.status] : message.status; + return object; + }; + + /** + * Converts this ExecuteSqlMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExecuteSqlMetadata"; + }; + + /** + * Status enum. + * @name google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} PARTIAL=2 PARTIAL value + * @property {number} ERROR=3 ERROR value + */ + ExecuteSqlMetadata.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "PARTIAL"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return ExecuteSqlMetadata; + })(); + + v1alpha.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1alpha.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1alpha.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1alpha.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [requestId] CreateBackupRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.requestId = ""; + + /** + * CreateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1alpha.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; + + /** + * UpdateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.validateOnly = false; + + /** + * UpdateBackupRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1alpha.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly + * @property {string|null} [etag] DeleteBackupRequest etag + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; + + /** + * DeleteBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.validateOnly = false; + + /** + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1alpha.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1alpha.ListSupportedDatabaseFlagsRequest = (function() { + + /** + * Properties of a ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListSupportedDatabaseFlagsRequest + * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent + * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize + * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken + * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null} [scope] ListSupportedDatabaseFlagsRequest scope + */ + + /** + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListSupportedDatabaseFlagsRequest. + * @implements IListSupportedDatabaseFlagsRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + */ + function ListSupportedDatabaseFlagsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSupportedDatabaseFlagsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.parent = ""; + + /** + * ListSupportedDatabaseFlagsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; + + /** + * ListSupportedDatabaseFlagsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + + /** + * ListSupportedDatabaseFlagsRequest scope. + * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} scope + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.scope = 0; + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance + */ + ListSupportedDatabaseFlagsRequest.create = function create(properties) { + return new ListSupportedDatabaseFlagsRequest(properties); + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); + return writer; + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSupportedDatabaseFlagsRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSupportedDatabaseFlagsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + */ + ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "DATABASE": + case 1: + message.scope = 1; + break; + case "CONNECTION_POOL": + case 2: + message.scope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] : message.scope; + return object; + }; + + /** + * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest"; + }; + + return ListSupportedDatabaseFlagsRequest; + })(); + + v1alpha.ListSupportedDatabaseFlagsResponse = (function() { + + /** + * Properties of a ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListSupportedDatabaseFlagsResponse + * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags + * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken + */ + + /** + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListSupportedDatabaseFlagsResponse. + * @implements IListSupportedDatabaseFlagsResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + */ + function ListSupportedDatabaseFlagsResponse(properties) { + this.supportedDatabaseFlags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. + * @member {Array.} supportedDatabaseFlags + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @instance + */ + ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; + + /** + * ListSupportedDatabaseFlagsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @instance + */ + ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance + */ + ListSupportedDatabaseFlagsResponse.create = function create(properties) { + return new ListSupportedDatabaseFlagsResponse(properties); + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) + $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) + message.supportedDatabaseFlags = []; + message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSupportedDatabaseFlagsResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSupportedDatabaseFlagsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { + if (!Array.isArray(message.supportedDatabaseFlags)) + return "supportedDatabaseFlags: array expected"; + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (error) + return "supportedDatabaseFlags." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + */ + ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); + if (object.supportedDatabaseFlags) { + if (!Array.isArray(object.supportedDatabaseFlags)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); + message.supportedDatabaseFlags = []; + for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { + if (typeof object.supportedDatabaseFlags[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); + message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDatabaseFlags = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { + object.supportedDatabaseFlags = []; + for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) + object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse"; + }; + + return ListSupportedDatabaseFlagsResponse; + })(); + + v1alpha.GenerateClientCertificateRequest = (function() { + + /** + * Properties of a GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGenerateClientCertificateRequest + * @property {string|null} [parent] GenerateClientCertificateRequest parent + * @property {string|null} [requestId] GenerateClientCertificateRequest requestId + * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr + * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey + * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange + */ + + /** + * Constructs a new GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GenerateClientCertificateRequest. + * @implements IGenerateClientCertificateRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set + */ + function GenerateClientCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateClientCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.parent = ""; + + /** + * GenerateClientCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.requestId = ""; + + /** + * GenerateClientCertificateRequest pemCsr. + * @member {string} pemCsr + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.pemCsr = ""; + + /** + * GenerateClientCertificateRequest certDuration. + * @member {google.protobuf.IDuration|null|undefined} certDuration + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.certDuration = null; + + /** + * GenerateClientCertificateRequest publicKey. + * @member {string} publicKey + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.publicKey = ""; + + /** + * GenerateClientCertificateRequest useMetadataExchange. + * @member {boolean} useMetadataExchange + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.useMetadataExchange = false; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance + */ + GenerateClientCertificateRequest.create = function create(properties) { + return new GenerateClientCertificateRequest(properties); + }; + + /** + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); + if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) + $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); + if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); + return writer; + }; + + /** + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.pemCsr = reader.string(); + break; + } + case 4: { + message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.publicKey = reader.string(); + break; + } + case 6: { + message.useMetadataExchange = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateClientCertificateRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateClientCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) { + var error = $root.google.protobuf.Duration.verify(message.certDuration); + if (error) + return "certDuration." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: string expected"; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + if (typeof message.useMetadataExchange !== "boolean") + return "useMetadataExchange: boolean expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest + */ + GenerateClientCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + if (object.certDuration != null) { + if (typeof object.certDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.certDuration: object expected"); + message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); + } + if (object.publicKey != null) + message.publicKey = String(object.publicKey); + if (object.useMetadataExchange != null) + message.useMetadataExchange = Boolean(object.useMetadataExchange); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} message GenerateClientCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + object.pemCsr = ""; + object.certDuration = null; + object.publicKey = ""; + object.useMetadataExchange = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + object.pemCsr = message.pemCsr; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) + object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + object.useMetadataExchange = message.useMetadataExchange; + return object; + }; + + /** + * Converts this GenerateClientCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest"; + }; + + return GenerateClientCertificateRequest; + })(); + + v1alpha.GenerateClientCertificateResponse = (function() { + + /** + * Properties of a GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGenerateClientCertificateResponse + * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate + * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @property {string|null} [caCert] GenerateClientCertificateResponse caCert + */ + + /** + * Constructs a new GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GenerateClientCertificateResponse. + * @implements IGenerateClientCertificateResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set + */ + function GenerateClientCertificateResponse(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateClientCertificateResponse pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.pemCertificate = ""; + + /** + * GenerateClientCertificateResponse pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; + + /** + * GenerateClientCertificateResponse caCert. + * @member {string} caCert + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.caCert = ""; + + /** + * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance + */ + GenerateClientCertificateResponse.create = function create(properties) { + return new GenerateClientCertificateResponse(properties); + }; + + /** + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); + return writer; + }; + + /** + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pemCertificate = reader.string(); + break; + } + case 2: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 3: { + message.caCert = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateClientCertificateResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateClientCertificateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + if (!$util.isString(message.caCert)) + return "caCert: string expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse + */ + GenerateClientCertificateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.caCert != null) + message.caCert = String(object.caCert); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} message GenerateClientCertificateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) { + object.pemCertificate = ""; + object.caCert = ""; + } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + object.caCert = message.caCert; + return object; + }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse"; + }; + + return GenerateClientCertificateResponse; + })(); + + v1alpha.GetConnectionInfoRequest = (function() { + + /** + * Properties of a GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetConnectionInfoRequest + * @property {string|null} [parent] GetConnectionInfoRequest parent + * @property {string|null} [requestId] GetConnectionInfoRequest requestId + */ + + /** + * Constructs a new GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetConnectionInfoRequest. + * @implements IGetConnectionInfoRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set + */ + function GetConnectionInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionInfoRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.parent = ""; + + /** + * GetConnectionInfoRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.requestId = ""; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest instance + */ + GetConnectionInfoRequest.create = function create(properties) { + return new GetConnectionInfoRequest(properties); + }; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionInfoRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest + */ + GetConnectionInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} message GetConnectionInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetConnectionInfoRequest"; + }; + + return GetConnectionInfoRequest; + })(); + + v1alpha.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @interface IOperationMetadata + * @property {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata + * @property {google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null} [promoteClusterStatus] OperationMetadata promoteClusterStatus + * @property {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null} [upgradeClusterStatus] OperationMetadata upgradeClusterStatus + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata batchCreateInstancesMetadata. + * @member {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchCreateInstancesMetadata = null; + + /** + * OperationMetadata promoteClusterStatus. + * @member {google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null|undefined} promoteClusterStatus + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.promoteClusterStatus = null; + + /** + * OperationMetadata upgradeClusterStatus. + * @member {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null|undefined} upgradeClusterStatus + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.upgradeClusterStatus = null; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata requestSpecific. + * @member {"batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata", "promoteClusterStatus", "upgradeClusterStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) + $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.promoteClusterStatus != null && Object.hasOwnProperty.call(message, "promoteClusterStatus")) + $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.encode(message.promoteClusterStatus, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.upgradeClusterStatus != null && Object.hasOwnProperty.call(message, "upgradeClusterStatus")) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.encode(message.upgradeClusterStatus, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); + break; + } + case 9: { + message.promoteClusterStatus = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.decode(reader, reader.uint32()); + break; + } + case 10: { + message.upgradeClusterStatus = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.decode(reader, reader.uint32()); + break; + } + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); + if (error) + return "batchCreateInstancesMetadata." + error; + } + } + if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { + if (properties.requestSpecific === 1) + return "requestSpecific: multiple values"; + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify(message.promoteClusterStatus); + if (error) + return "promoteClusterStatus." + error; + } + } + if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { + if (properties.requestSpecific === 1) + return "requestSpecific: multiple values"; + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify(message.upgradeClusterStatus); + if (error) + return "upgradeClusterStatus." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.OperationMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.OperationMetadata(); + if (object.batchCreateInstancesMetadata != null) { + if (typeof object.batchCreateInstancesMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.batchCreateInstancesMetadata: object expected"); + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); + } + if (object.promoteClusterStatus != null) { + if (typeof object.promoteClusterStatus !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.promoteClusterStatus: object expected"); + message.promoteClusterStatus = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.fromObject(object.promoteClusterStatus); + } + if (object.upgradeClusterStatus != null) { + if (typeof object.upgradeClusterStatus !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.upgradeClusterStatus: object expected"); + message.upgradeClusterStatus = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.fromObject(object.upgradeClusterStatus); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1alpha.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); + if (options.oneofs) + object.requestSpecific = "batchCreateInstancesMetadata"; + } + if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { + object.promoteClusterStatus = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.toObject(message.promoteClusterStatus, options); + if (options.oneofs) + object.requestSpecific = "promoteClusterStatus"; + } + if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { + object.upgradeClusterStatus = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.toObject(message.upgradeClusterStatus, options); + if (options.oneofs) + object.requestSpecific = "upgradeClusterStatus"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1alpha.PromoteClusterStatus = (function() { + + /** + * Properties of a PromoteClusterStatus. + * @memberof google.cloud.alloydb.v1alpha + * @interface IPromoteClusterStatus + * @property {google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|null} [state] PromoteClusterStatus state + */ + + /** + * Constructs a new PromoteClusterStatus. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a PromoteClusterStatus. + * @implements IPromoteClusterStatus + * @constructor + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus=} [properties] Properties to set + */ + function PromoteClusterStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromoteClusterStatus state. + * @member {google.cloud.alloydb.v1alpha.PromoteClusterStatus.State} state + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @instance + */ + PromoteClusterStatus.prototype.state = 0; + + /** + * Creates a new PromoteClusterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus instance + */ + PromoteClusterStatus.create = function create(properties) { + return new PromoteClusterStatus(properties); + }; + + /** + * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + return writer; + }; + + /** + * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromoteClusterStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromoteClusterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus + */ + PromoteClusterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": + case 1: + message.state = 1; + break; + case "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": + case 2: + message.state = 2; + break; + case "PROMOTE_CLUSTER_COMPLETED": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.PromoteClusterStatus} message PromoteClusterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromoteClusterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.State[message.state] : message.state; + return object; + }; + + /** + * Converts this PromoteClusterStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @instance + * @returns {Object.} JSON object + */ + PromoteClusterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromoteClusterStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromoteClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.PromoteClusterStatus"; + }; + + /** + * State enum. + * @name google.cloud.alloydb.v1alpha.PromoteClusterStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_READ=1 PROMOTE_CLUSTER_AVAILABLE_FOR_READ value + * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE=2 PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE value + * @property {number} PROMOTE_CLUSTER_COMPLETED=3 PROMOTE_CLUSTER_COMPLETED value + */ + PromoteClusterStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROMOTE_CLUSTER_AVAILABLE_FOR_READ"] = 1; + values[valuesById[2] = "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE"] = 2; + values[valuesById[3] = "PROMOTE_CLUSTER_COMPLETED"] = 3; + return values; + })(); + + return PromoteClusterStatus; + })(); + + v1alpha.UpgradeClusterStatus = (function() { + + /** + * Properties of an UpgradeClusterStatus. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpgradeClusterStatus + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [state] UpgradeClusterStatus state + * @property {boolean|null} [cancellable] UpgradeClusterStatus cancellable + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [sourceVersion] UpgradeClusterStatus sourceVersion + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [targetVersion] UpgradeClusterStatus targetVersion + * @property {Array.|null} [stages] UpgradeClusterStatus stages + */ + + /** + * Constructs a new UpgradeClusterStatus. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpgradeClusterStatus. + * @implements IUpgradeClusterStatus + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus=} [properties] Properties to set + */ + function UpgradeClusterStatus(properties) { + this.stages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterStatus state. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} state + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.state = 0; + + /** + * UpgradeClusterStatus cancellable. + * @member {boolean} cancellable + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.cancellable = false; + + /** + * UpgradeClusterStatus sourceVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} sourceVersion + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.sourceVersion = 0; + + /** + * UpgradeClusterStatus targetVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} targetVersion + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.targetVersion = 0; + + /** + * UpgradeClusterStatus stages. + * @member {Array.} stages + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.stages = $util.emptyArray; + + /** + * Creates a new UpgradeClusterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus instance + */ + UpgradeClusterStatus.create = function create(properties) { + return new UpgradeClusterStatus(properties); + }; + + /** + * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.cancellable != null && Object.hasOwnProperty.call(message, "cancellable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cancellable); + if (message.sourceVersion != null && Object.hasOwnProperty.call(message, "sourceVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceVersion); + if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.targetVersion); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.cancellable = reader.bool(); + break; + } + case 3: { + message.sourceVersion = reader.int32(); + break; + } + case 4: { + message.targetVersion = reader.int32(); + break; + } + case 5: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.cancellable != null && message.hasOwnProperty("cancellable")) + if (typeof message.cancellable !== "boolean") + return "cancellable: boolean expected"; + if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) + switch (message.sourceVersion) { + default: + return "sourceVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + switch (message.targetVersion) { + default: + return "targetVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + return null; + }; + + /** + * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus + */ + UpgradeClusterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "IN_PROGRESS": + case 5: + message.state = 5; + break; + case "SUCCESS": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.state = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.cancellable != null) + message.cancellable = Boolean(object.cancellable); + switch (object.sourceVersion) { + default: + if (typeof object.sourceVersion === "number") { + message.sourceVersion = object.sourceVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.sourceVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.sourceVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.sourceVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.sourceVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.sourceVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.sourceVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.sourceVersion = 6; + break; + } + switch (object.targetVersion) { + default: + if (typeof object.targetVersion === "number") { + message.targetVersion = object.targetVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.targetVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.targetVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.targetVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.targetVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.targetVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.targetVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.targetVersion = 6; + break; + } + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.stages: object expected"); + message.stages[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.fromObject(object.stages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} message UpgradeClusterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stages = []; + if (options.defaults) { + object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.cancellable = false; + object.sourceVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.targetVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] : message.state; + if (message.cancellable != null && message.hasOwnProperty("cancellable")) + object.cancellable = message.cancellable; + if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) + object.sourceVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.sourceVersion] === undefined ? message.sourceVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.sourceVersion] : message.sourceVersion; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + object.targetVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.targetVersion] === undefined ? message.targetVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.targetVersion] : message.targetVersion; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.toObject(message.stages[j], options); + } + return object; + }; + + /** + * Converts this UpgradeClusterStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus"; + }; + + UpgradeClusterStatus.StageStatus = (function() { + + /** + * Properties of a StageStatus. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @interface IStageStatus + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null} [readPoolInstancesUpgrade] StageStatus readPoolInstancesUpgrade + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null} [stage] StageStatus stage + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [state] StageStatus state + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null} [schedule] StageStatus schedule + */ + + /** + * Constructs a new StageStatus. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @classdesc Represents a StageStatus. + * @implements IStageStatus + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set + */ + function StageStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageStatus readPoolInstancesUpgrade. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null|undefined} readPoolInstancesUpgrade + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.readPoolInstancesUpgrade = null; + + /** + * StageStatus stage. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage} stage + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.stage = 0; + + /** + * StageStatus state. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} state + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.state = 0; + + /** + * StageStatus schedule. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null|undefined} schedule + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StageStatus stageSpecificStatus. + * @member {"readPoolInstancesUpgrade"|undefined} stageSpecificStatus + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @instance + */ + Object.defineProperty(StageStatus.prototype, "stageSpecificStatus", { + get: $util.oneOfGetter($oneOfFields = ["readPoolInstancesUpgrade"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StageStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus instance + */ + StageStatus.create = function create(properties) { + return new StageStatus(properties); + }; + + /** + * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.encode(message.schedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readPoolInstancesUpgrade != null && Object.hasOwnProperty.call(message, "readPoolInstancesUpgrade")) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.encode(message.readPoolInstancesUpgrade, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 11: { + message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.decode(reader, reader.uint32()); + break; + } + case 1: { + message.stage = reader.int32(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.schedule = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { + properties.stageSpecificStatus = 1; + { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify(message.readPoolInstancesUpgrade); + if (error) + return "readPoolInstancesUpgrade." + error; + } + } + if (message.stage != null && message.hasOwnProperty("stage")) + switch (message.stage) { + default: + return "stage: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + return null; + }; + + /** + * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus + */ + StageStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus(); + if (object.readPoolInstancesUpgrade != null) { + if (typeof object.readPoolInstancesUpgrade !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.readPoolInstancesUpgrade: object expected"); + message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.fromObject(object.readPoolInstancesUpgrade); + } + switch (object.stage) { + default: + if (typeof object.stage === "number") { + message.stage = object.stage; + break; + } + break; + case "STAGE_UNSPECIFIED": + case 0: + message.stage = 0; + break; + case "ALLOYDB_PRECHECK": + case 1: + message.stage = 1; + break; + case "PG_UPGRADE_CHECK": + case 2: + message.stage = 2; + break; + case "PREPARE_FOR_UPGRADE": + case 5: + message.stage = 5; + break; + case "PRIMARY_INSTANCE_UPGRADE": + case 3: + message.stage = 3; + break; + case "READ_POOL_INSTANCES_UPGRADE": + case 4: + message.stage = 4; + break; + case "ROLLBACK": + case 6: + message.stage = 6; + break; + case "CLEANUP": + case 7: + message.stage = 7; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "IN_PROGRESS": + case 5: + message.state = 5; + break; + case "SUCCESS": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.state = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.schedule: object expected"); + message.schedule = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.fromObject(object.schedule); + } + return message; + }; + + /** + * Creates a plain object from a StageStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} message StageStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.schedule = null; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] : message.stage; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] : message.state; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.toObject(message.schedule, options); + if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { + object.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.toObject(message.readPoolInstancesUpgrade, options); + if (options.oneofs) + object.stageSpecificStatus = "readPoolInstancesUpgrade"; + } + return object; + }; + + /** + * Converts this StageStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @instance + * @returns {Object.} JSON object + */ + StageStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus"; + }; + + StageStatus.StageSchedule = (function() { + + /** + * Properties of a StageSchedule. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @interface IStageSchedule + * @property {google.protobuf.ITimestamp|null} [estimatedStartTime] StageSchedule estimatedStartTime + * @property {google.protobuf.ITimestamp|null} [actualStartTime] StageSchedule actualStartTime + * @property {google.protobuf.ITimestamp|null} [estimatedEndTime] StageSchedule estimatedEndTime + * @property {google.protobuf.ITimestamp|null} [actualEndTime] StageSchedule actualEndTime + */ + + /** + * Constructs a new StageSchedule. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus + * @classdesc Represents a StageSchedule. + * @implements IStageSchedule + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set + */ + function StageSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageSchedule estimatedStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedStartTime + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.estimatedStartTime = null; + + /** + * StageSchedule actualStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} actualStartTime + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.actualStartTime = null; + + /** + * StageSchedule estimatedEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedEndTime + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.estimatedEndTime = null; + + /** + * StageSchedule actualEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} actualEndTime + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.actualEndTime = null; + + /** + * Creates a new StageSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule instance + */ + StageSchedule.create = function create(properties) { + return new StageSchedule(properties); + }; + + /** + * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedStartTime != null && Object.hasOwnProperty.call(message, "estimatedStartTime")) + $root.google.protobuf.Timestamp.encode(message.estimatedStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actualStartTime != null && Object.hasOwnProperty.call(message, "actualStartTime")) + $root.google.protobuf.Timestamp.encode(message.actualStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.estimatedEndTime != null && Object.hasOwnProperty.call(message, "estimatedEndTime")) + $root.google.protobuf.Timestamp.encode(message.estimatedEndTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.actualEndTime != null && Object.hasOwnProperty.call(message, "actualEndTime")) + $root.google.protobuf.Timestamp.encode(message.actualEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.estimatedStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.actualStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.estimatedEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.actualEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedStartTime); + if (error) + return "estimatedStartTime." + error; + } + if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.actualStartTime); + if (error) + return "actualStartTime." + error; + } + if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedEndTime); + if (error) + return "estimatedEndTime." + error; + } + if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.actualEndTime); + if (error) + return "actualEndTime." + error; + } + return null; + }; + + /** + * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + */ + StageSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule(); + if (object.estimatedStartTime != null) { + if (typeof object.estimatedStartTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedStartTime: object expected"); + message.estimatedStartTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedStartTime); + } + if (object.actualStartTime != null) { + if (typeof object.actualStartTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.actualStartTime: object expected"); + message.actualStartTime = $root.google.protobuf.Timestamp.fromObject(object.actualStartTime); + } + if (object.estimatedEndTime != null) { + if (typeof object.estimatedEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedEndTime: object expected"); + message.estimatedEndTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedEndTime); + } + if (object.actualEndTime != null) { + if (typeof object.actualEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.actualEndTime: object expected"); + message.actualEndTime = $root.google.protobuf.Timestamp.fromObject(object.actualEndTime); + } + return message; + }; + + /** + * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} message StageSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.estimatedStartTime = null; + object.actualStartTime = null; + object.estimatedEndTime = null; + object.actualEndTime = null; + } + if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) + object.estimatedStartTime = $root.google.protobuf.Timestamp.toObject(message.estimatedStartTime, options); + if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) + object.actualStartTime = $root.google.protobuf.Timestamp.toObject(message.actualStartTime, options); + if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) + object.estimatedEndTime = $root.google.protobuf.Timestamp.toObject(message.estimatedEndTime, options); + if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) + object.actualEndTime = $root.google.protobuf.Timestamp.toObject(message.actualEndTime, options); + return object; + }; + + /** + * Converts this StageSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + * @returns {Object.} JSON object + */ + StageSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule"; + }; + + return StageSchedule; + })(); + + return StageStatus; + })(); + + UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus = (function() { + + /** + * Properties of a ReadPoolInstancesUpgradeStageStatus. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @interface IReadPoolInstancesUpgradeStageStatus + * @property {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null} [upgradeStats] ReadPoolInstancesUpgradeStageStatus upgradeStats + */ + + /** + * Constructs a new ReadPoolInstancesUpgradeStageStatus. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus + * @classdesc Represents a ReadPoolInstancesUpgradeStageStatus. + * @implements IReadPoolInstancesUpgradeStageStatus + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set + */ + function ReadPoolInstancesUpgradeStageStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadPoolInstancesUpgradeStageStatus upgradeStats. + * @member {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null|undefined} upgradeStats + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @instance + */ + ReadPoolInstancesUpgradeStageStatus.prototype.upgradeStats = null; + + /** + * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus instance + */ + ReadPoolInstancesUpgradeStageStatus.create = function create(properties) { + return new ReadPoolInstancesUpgradeStageStatus(properties); + }; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolInstancesUpgradeStageStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upgradeStats != null && Object.hasOwnProperty.call(message, "upgradeStats")) + $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.encode(message.upgradeStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolInstancesUpgradeStageStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolInstancesUpgradeStageStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.upgradeStats = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolInstancesUpgradeStageStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolInstancesUpgradeStageStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolInstancesUpgradeStageStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) { + var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify(message.upgradeStats); + if (error) + return "upgradeStats." + error; + } + return null; + }; + + /** + * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + */ + ReadPoolInstancesUpgradeStageStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); + if (object.upgradeStats != null) { + if (typeof object.upgradeStats !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.upgradeStats: object expected"); + message.upgradeStats = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.fromObject(object.upgradeStats); + } + return message; + }; + + /** + * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolInstancesUpgradeStageStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.upgradeStats = null; + if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) + object.upgradeStats = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.toObject(message.upgradeStats, options); + return object; + }; + + /** + * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @instance + * @returns {Object.} JSON object + */ + ReadPoolInstancesUpgradeStageStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolInstancesUpgradeStageStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolInstancesUpgradeStageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus"; + }; + + ReadPoolInstancesUpgradeStageStatus.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @interface IStats + * @property {number|null} [notStarted] Stats notStarted + * @property {number|null} [ongoing] Stats ongoing + * @property {number|null} [success] Stats success + * @property {number|null} [failed] Stats failed + */ + + /** + * Constructs a new Stats. + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set + */ + function Stats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stats notStarted. + * @member {number} notStarted + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.notStarted = 0; + + /** + * Stats ongoing. + * @member {number} ongoing + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.ongoing = 0; + + /** + * Stats success. + * @member {number} success + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.success = 0; + + /** + * Stats failed. + * @member {number} failed + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.failed = 0; + + /** + * Creates a new Stats instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats instance + */ + Stats.create = function create(properties) { + return new Stats(properties); + }; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notStarted != null && Object.hasOwnProperty.call(message, "notStarted")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.notStarted); + if (message.ongoing != null && Object.hasOwnProperty.call(message, "ongoing")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ongoing); + if (message.success != null && Object.hasOwnProperty.call(message, "success")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.success); + if (message.failed != null && Object.hasOwnProperty.call(message, "failed")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failed); + return writer; + }; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notStarted = reader.int32(); + break; + } + case 2: { + message.ongoing = reader.int32(); + break; + } + case 3: { + message.success = reader.int32(); + break; + } + case 4: { + message.failed = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stats message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notStarted != null && message.hasOwnProperty("notStarted")) + if (!$util.isInteger(message.notStarted)) + return "notStarted: integer expected"; + if (message.ongoing != null && message.hasOwnProperty("ongoing")) + if (!$util.isInteger(message.ongoing)) + return "ongoing: integer expected"; + if (message.success != null && message.hasOwnProperty("success")) + if (!$util.isInteger(message.success)) + return "success: integer expected"; + if (message.failed != null && message.hasOwnProperty("failed")) + if (!$util.isInteger(message.failed)) + return "failed: integer expected"; + return null; + }; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + */ + Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); + if (object.notStarted != null) + message.notStarted = object.notStarted | 0; + if (object.ongoing != null) + message.ongoing = object.ongoing | 0; + if (object.success != null) + message.success = object.success | 0; + if (object.failed != null) + message.failed = object.failed | 0; + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notStarted = 0; + object.ongoing = 0; + object.success = 0; + object.failed = 0; + } + if (message.notStarted != null && message.hasOwnProperty("notStarted")) + object.notStarted = message.notStarted; + if (message.ongoing != null && message.hasOwnProperty("ongoing")) + object.ongoing = message.ongoing; + if (message.success != null && message.hasOwnProperty("success")) + object.success = message.success; + if (message.failed != null && message.hasOwnProperty("failed")) + object.failed = message.failed; + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stats + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats"; + }; + + return Stats; + })(); + + return ReadPoolInstancesUpgradeStageStatus; + })(); + + return UpgradeClusterStatus; + })(); + + v1alpha.ListUsersRequest = (function() { + + /** + * Properties of a ListUsersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + * @property {string|null} [filter] ListUsersRequest filter + * @property {string|null} [orderBy] ListUsersRequest orderBy + */ + + /** + * Constructs a new ListUsersRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest=} [properties] Properties to set + */ + function ListUsersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.parent = ""; + + /** + * ListUsersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageSize = 0; + + /** + * ListUsersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageToken = ""; + + /** + * ListUsersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.filter = ""; + + /** + * ListUsersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest instance + */ + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); + }; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListUsersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest + */ + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListUsersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListUsersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListUsersRequest} message ListUsersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListUsersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListUsersRequest"; + }; + + return ListUsersRequest; + })(); + + v1alpha.ListUsersResponse = (function() { + + /** + * Properties of a ListUsersResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsersResponse unreachable + */ + + /** + * Constructs a new ListUsersResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse=} [properties] Properties to set + */ + function ListUsersResponse(properties) { + this.users = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.users = $util.emptyArray; + + /** + * ListUsersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.nextPageToken = ""; + + /** + * ListUsersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse instance + */ + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); + }; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.cloud.alloydb.v1alpha.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListUsersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse + */ + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListUsersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.users[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListUsersResponse} message ListUsersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.users = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.cloud.alloydb.v1alpha.User.toObject(message.users[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUsersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListUsersResponse"; + }; + + return ListUsersResponse; + })(); + + v1alpha.GetUserRequest = (function() { + + /** + * Properties of a GetUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name + */ + + /** + * Constructs a new GetUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest=} [properties] Properties to set + */ + function GetUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @instance + */ + GetUserRequest.prototype.name = ""; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest instance + */ + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); + }; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest + */ + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.GetUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.GetUserRequest} message GetUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.GetUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetUserRequest"; + }; + + return GetUserRequest; + })(); + + v1alpha.CreateUserRequest = (function() { + + /** + * Properties of a CreateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.cloud.alloydb.v1alpha.IUser|null} [user] CreateUserRequest user + * @property {string|null} [requestId] CreateUserRequest requestId + * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly + */ + + /** + * Constructs a new CreateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest=} [properties] Properties to set + */ + function CreateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.parent = ""; + + /** + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.userId = ""; + + /** + * CreateUserRequest user. + * @member {google.cloud.alloydb.v1alpha.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.user = null; + + /** + * CreateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.requestId = ""; + + /** + * CreateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest instance + */ + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); + }; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1alpha.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.user = $root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest + */ + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateUserRequest} message CreateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userId = ""; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1alpha.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateUserRequest"; + }; + + return CreateUserRequest; + })(); + + v1alpha.UpdateUserRequest = (function() { + + /** + * Properties of an UpdateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IUpdateUserRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + * @property {google.cloud.alloydb.v1alpha.IUser|null} [user] UpdateUserRequest user + * @property {string|null} [requestId] UpdateUserRequest requestId + * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing + */ + + /** + * Constructs a new UpdateUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest=} [properties] Properties to set + */ + function UpdateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.updateMask = null; + + /** + * UpdateUserRequest user. + * @member {google.cloud.alloydb.v1alpha.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; + + /** + * UpdateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.requestId = ""; + + /** + * UpdateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.validateOnly = false; + + /** + * UpdateUserRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest instance + */ + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); + }; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1alpha.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.user = $root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest + */ + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.UpdateUserRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.UpdateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.UpdateUserRequest} message UpdateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1alpha.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateUserRequest"; + }; + + return UpdateUserRequest; + })(); + + v1alpha.DeleteUserRequest = (function() { + + /** + * Properties of a DeleteUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + * @property {string|null} [requestId] DeleteUserRequest requestId + * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly + */ + + /** + * Constructs a new DeleteUserRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest=} [properties] Properties to set + */ + function DeleteUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.name = ""; + + /** + * DeleteUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.requestId = ""; + + /** + * DeleteUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest instance + */ + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); + }; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest + */ + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1alpha.DeleteUserRequest} message DeleteUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteUserRequest"; + }; + + return DeleteUserRequest; + })(); + + v1alpha.ListDatabasesRequest = (function() { + + /** + * Properties of a ListDatabasesRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListDatabasesRequest + * @property {string|null} [parent] ListDatabasesRequest parent + * @property {number|null} [pageSize] ListDatabasesRequest pageSize + * @property {string|null} [pageToken] ListDatabasesRequest pageToken + * @property {string|null} [filter] ListDatabasesRequest filter + */ + + /** + * Constructs a new ListDatabasesRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListDatabasesRequest. + * @implements IListDatabasesRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest=} [properties] Properties to set + */ + function ListDatabasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.parent = ""; + + /** + * ListDatabasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageSize = 0; + + /** + * ListDatabasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageToken = ""; + + /** + * ListDatabasesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.filter = ""; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest instance + */ + ListDatabasesRequest.create = function create(properties) { + return new ListDatabasesRequest(properties); + }; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest + */ + ListDatabasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ListDatabasesRequest} message ListDatabasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListDatabasesRequest"; + }; + + return ListDatabasesRequest; + })(); + + v1alpha.ListDatabasesResponse = (function() { + + /** + * Properties of a ListDatabasesResponse. + * @memberof google.cloud.alloydb.v1alpha + * @interface IListDatabasesResponse + * @property {Array.|null} [databases] ListDatabasesResponse databases + * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabasesResponse. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a ListDatabasesResponse. + * @implements IListDatabasesResponse + * @constructor + * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse=} [properties] Properties to set + */ + function ListDatabasesResponse(properties) { + this.databases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesResponse databases. + * @member {Array.} databases + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.databases = $util.emptyArray; + + /** + * ListDatabasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse instance + */ + ListDatabasesResponse.create = function create(properties) { + return new ListDatabasesResponse(properties); + }; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databases != null && message.databases.length) + for (var i = 0; i < message.databases.length; ++i) + $root.google.cloud.alloydb.v1alpha.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databases && message.databases.length)) + message.databases = []; + message.databases.push($root.google.cloud.alloydb.v1alpha.Database.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databases != null && message.hasOwnProperty("databases")) { + if (!Array.isArray(message.databases)) + return "databases: array expected"; + for (var i = 0; i < message.databases.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.Database.verify(message.databases[i]); + if (error) + return "databases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse + */ + ListDatabasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse(); + if (object.databases) { + if (!Array.isArray(object.databases)) + throw TypeError(".google.cloud.alloydb.v1alpha.ListDatabasesResponse.databases: array expected"); + message.databases = []; + for (var i = 0; i < object.databases.length; ++i) { + if (typeof object.databases[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.ListDatabasesResponse.databases: object expected"); + message.databases[i] = $root.google.cloud.alloydb.v1alpha.Database.fromObject(object.databases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1alpha.ListDatabasesResponse} message ListDatabasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databases && message.databases.length) { + object.databases = []; + for (var j = 0; j < message.databases.length; ++j) + object.databases[j] = $root.google.cloud.alloydb.v1alpha.Database.toObject(message.databases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListDatabasesResponse"; + }; + + return ListDatabasesResponse; + })(); + + v1alpha.CreateDatabaseRequest = (function() { + + /** + * Properties of a CreateDatabaseRequest. + * @memberof google.cloud.alloydb.v1alpha + * @interface ICreateDatabaseRequest + * @property {string|null} [parent] CreateDatabaseRequest parent + * @property {string|null} [databaseId] CreateDatabaseRequest databaseId + * @property {google.cloud.alloydb.v1alpha.IDatabase|null} [database] CreateDatabaseRequest database + */ + + /** + * Constructs a new CreateDatabaseRequest. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a CreateDatabaseRequest. + * @implements ICreateDatabaseRequest + * @constructor + * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest=} [properties] Properties to set + */ + function CreateDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatabaseRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.parent = ""; + + /** + * CreateDatabaseRequest databaseId. + * @member {string} databaseId + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.databaseId = ""; + + /** + * CreateDatabaseRequest database. + * @member {google.cloud.alloydb.v1alpha.IDatabase|null|undefined} database + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.database = null; + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest instance + */ + CreateDatabaseRequest.create = function create(properties) { + return new CreateDatabaseRequest(properties); + }; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.cloud.alloydb.v1alpha.Database.encode(message.database, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.databaseId = reader.string(); + break; + } + case 3: { + message.database = $root.google.cloud.alloydb.v1alpha.Database.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatabaseRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.alloydb.v1alpha.Database.verify(message.database); + if (error) + return "database." + error; + } + return null; + }; + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest + */ + CreateDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.CreateDatabaseRequest.database: object expected"); + message.database = $root.google.cloud.alloydb.v1alpha.Database.fromObject(object.database); + } + return message; + }; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} message CreateDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.databaseId = ""; + object.database = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.alloydb.v1alpha.Database.toObject(message.database, options); + return object; + }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateDatabaseRequest"; + }; + + return CreateDatabaseRequest; + })(); + + v1alpha.SqlResult = (function() { + + /** + * Properties of a SqlResult. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISqlResult + * @property {Array.|null} [columns] SqlResult columns + * @property {Array.|null} [rows] SqlResult rows + */ + + /** + * Constructs a new SqlResult. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SqlResult. + * @implements ISqlResult + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISqlResult=} [properties] Properties to set + */ + function SqlResult(properties) { + this.columns = []; + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResult columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @instance + */ + SqlResult.prototype.columns = $util.emptyArray; + + /** + * SqlResult rows. + * @member {Array.} rows + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @instance + */ + SqlResult.prototype.rows = $util.emptyArray; + + /** + * Creates a new SqlResult instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResult=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult instance + */ + SqlResult.create = function create(properties) { + return new SqlResult(properties); + }; + + /** + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResult} message SqlResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.alloydb.v1alpha.SqlResultColumn.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.alloydb.v1alpha.SqlResultRow.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResult} message SqlResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.alloydb.v1alpha.SqlResultColumn.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.alloydb.v1alpha.SqlResultRow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResult message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.SqlResultColumn.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.SqlResultRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult + */ + SqlResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResult) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SqlResult(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.columns: object expected"); + message.columns[i] = $root.google.cloud.alloydb.v1alpha.SqlResultColumn.fromObject(object.columns[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.rows: object expected"); + message.rows[i] = $root.google.cloud.alloydb.v1alpha.SqlResultRow.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {google.cloud.alloydb.v1alpha.SqlResult} message SqlResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columns = []; + object.rows = []; + } + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.alloydb.v1alpha.SqlResultColumn.toObject(message.columns[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.alloydb.v1alpha.SqlResultRow.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this SqlResult to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @instance + * @returns {Object.} JSON object + */ + SqlResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResult + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SqlResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResult"; + }; + + return SqlResult; + })(); + + v1alpha.SqlResultColumn = (function() { + + /** + * Properties of a SqlResultColumn. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISqlResultColumn + * @property {string|null} [name] SqlResultColumn name + * @property {string|null} [type] SqlResultColumn type + */ + + /** + * Constructs a new SqlResultColumn. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SqlResultColumn. + * @implements ISqlResultColumn + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn=} [properties] Properties to set + */ + function SqlResultColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultColumn name. + * @member {string} name + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @instance + */ + SqlResultColumn.prototype.name = ""; + + /** + * SqlResultColumn type. + * @member {string} type + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @instance + */ + SqlResultColumn.prototype.type = ""; + + /** + * Creates a new SqlResultColumn instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn instance + */ + SqlResultColumn.create = function create(properties) { + return new SqlResultColumn(properties); + }; + + /** + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn} message SqlResultColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + return writer; + }; + + /** + * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn} message SqlResultColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultColumn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResultColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultColumn message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn + */ + SqlResultColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResultColumn) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SqlResultColumn(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1alpha.SqlResultColumn} message SqlResultColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this SqlResultColumn to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @instance + * @returns {Object.} JSON object + */ + SqlResultColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultColumn + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResultColumn"; + }; + + return SqlResultColumn; + })(); + + v1alpha.SqlResultRow = (function() { + + /** + * Properties of a SqlResultRow. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISqlResultRow + * @property {Array.|null} [values] SqlResultRow values + */ + + /** + * Constructs a new SqlResultRow. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SqlResultRow. + * @implements ISqlResultRow + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISqlResultRow=} [properties] Properties to set + */ + function SqlResultRow(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultRow values. + * @member {Array.} values + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @instance + */ + SqlResultRow.prototype.values = $util.emptyArray; + + /** + * Creates a new SqlResultRow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultRow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow instance + */ + SqlResultRow.create = function create(properties) { + return new SqlResultRow(properties); + }; + + /** + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultRow} message SqlResultRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.alloydb.v1alpha.SqlResultValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultRow} message SqlResultRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResultRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.alloydb.v1alpha.SqlResultValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultRow message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.alloydb.v1alpha.SqlResultValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow + */ + SqlResultRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResultRow) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SqlResultRow(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.alloydb.v1alpha.SqlResultRow.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.SqlResultRow.values: object expected"); + message.values[i] = $root.google.cloud.alloydb.v1alpha.SqlResultValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1alpha.SqlResultRow} message SqlResultRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.alloydb.v1alpha.SqlResultValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this SqlResultRow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @instance + * @returns {Object.} JSON object + */ + SqlResultRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultRow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SqlResultRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResultRow"; + }; + + return SqlResultRow; + })(); + + v1alpha.SqlResultValue = (function() { + + /** + * Properties of a SqlResultValue. + * @memberof google.cloud.alloydb.v1alpha + * @interface ISqlResultValue + * @property {string|null} [value] SqlResultValue value + * @property {boolean|null} [nullValue] SqlResultValue nullValue + */ + + /** + * Constructs a new SqlResultValue. + * @memberof google.cloud.alloydb.v1alpha + * @classdesc Represents a SqlResultValue. + * @implements ISqlResultValue + * @constructor + * @param {google.cloud.alloydb.v1alpha.ISqlResultValue=} [properties] Properties to set + */ + function SqlResultValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @instance + */ + SqlResultValue.prototype.value = null; + + /** + * SqlResultValue nullValue. + * @member {boolean|null|undefined} nullValue + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @instance + */ + SqlResultValue.prototype.nullValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlResultValue.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlResultValue.prototype, "_nullValue", { + get: $util.oneOfGetter($oneOfFields = ["nullValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlResultValue instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultValue=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue instance + */ + SqlResultValue.create = function create(properties) { + return new SqlResultValue(properties); + }; + + /** + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultValue} message SqlResultValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.nullValue); + return writer; + }; + + /** + * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1alpha.ISqlResultValue} message SqlResultValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResultValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.nullValue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultValue message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties._nullValue = 1; + if (typeof message.nullValue !== "boolean") + return "nullValue: boolean expected"; + } + return null; + }; + + /** + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue + */ + SqlResultValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResultValue) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.SqlResultValue(); + if (object.value != null) + message.value = String(object.value); + if (object.nullValue != null) + message.nullValue = Boolean(object.nullValue); + return message; + }; + + /** + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1alpha.SqlResultValue} message SqlResultValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = message.nullValue; + if (options.oneofs) + object._nullValue = "nullValue"; + } + return object; + }; + + /** + * Converts this SqlResultValue to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @instance + * @returns {Object.} JSON object + */ + SqlResultValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultValue + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.SqlResultValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResultValue"; + }; + + return SqlResultValue; + })(); + + return v1alpha; + })(); + + alloydb.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1beta = {}; + + v1beta.CloudSQLBackupRunSource = (function() { + + /** + * Properties of a CloudSQLBackupRunSource. + * @memberof google.cloud.alloydb.v1beta + * @interface ICloudSQLBackupRunSource + * @property {string|null} [project] CloudSQLBackupRunSource project + * @property {string|null} [instanceId] CloudSQLBackupRunSource instanceId + * @property {number|Long|null} [backupRunId] CloudSQLBackupRunSource backupRunId + */ + + /** + * Constructs a new CloudSQLBackupRunSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CloudSQLBackupRunSource. + * @implements ICloudSQLBackupRunSource + * @constructor + * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource=} [properties] Properties to set + */ + function CloudSQLBackupRunSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSQLBackupRunSource project. + * @member {string} project + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.project = ""; + + /** + * CloudSQLBackupRunSource instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.instanceId = ""; + + /** + * CloudSQLBackupRunSource backupRunId. + * @member {number|Long} backupRunId + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @instance + */ + CloudSQLBackupRunSource.prototype.backupRunId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CloudSQLBackupRunSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource instance + */ + CloudSQLBackupRunSource.create = function create(properties) { + return new CloudSQLBackupRunSource(properties); + }; + + /** + * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSQLBackupRunSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.backupRunId); + return writer; + }; + + /** + * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSQLBackupRunSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSQLBackupRunSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.backupRunId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSQLBackupRunSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSQLBackupRunSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSQLBackupRunSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) + return "backupRunId: integer|Long expected"; + return null; + }; + + /** + * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource + */ + CloudSQLBackupRunSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource(); + if (object.project != null) + message.project = String(object.project); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.backupRunId != null) + if ($util.Long) + (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; + else if (typeof object.backupRunId === "string") + message.backupRunId = parseInt(object.backupRunId, 10); + else if (typeof object.backupRunId === "number") + message.backupRunId = object.backupRunId; + else if (typeof object.backupRunId === "object") + message.backupRunId = new $util.LongBits(object.backupRunId.low >>> 0, object.backupRunId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} message CloudSQLBackupRunSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSQLBackupRunSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.instanceId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupRunId = options.longs === String ? "0" : 0; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (typeof message.backupRunId === "number") + object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; + else + object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; + return object; + }; + + /** + * Converts this CloudSQLBackupRunSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @instance + * @returns {Object.} JSON object + */ + CloudSQLBackupRunSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSQLBackupRunSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSQLBackupRunSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CloudSQLBackupRunSource"; + }; + + return CloudSQLBackupRunSource; + })(); + + v1beta.AlloyDBCSQLAdmin = (function() { + + /** + * Constructs a new AlloyDBCSQLAdmin service. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an AlloyDBCSQLAdmin + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AlloyDBCSQLAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBCSQLAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBCSQLAdmin; + + /** + * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AlloyDBCSQLAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBCSQLAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin|restoreFromCloudSQL}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin + * @typedef RestoreFromCloudSQLCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreFromCloudSQL. + * @function restoreFromCloudSQL + * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBCSQLAdmin.prototype.restoreFromCloudSQL = function restoreFromCloudSQL(request, callback) { + return this.rpcCall(restoreFromCloudSQL, $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreFromCloudSQL" }); + + /** + * Calls RestoreFromCloudSQL. + * @function restoreFromCloudSQL + * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBCSQLAdmin; + })(); + + v1beta.RestoreFromCloudSQLRequest = (function() { + + /** + * Properties of a RestoreFromCloudSQLRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IRestoreFromCloudSQLRequest + * @property {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] RestoreFromCloudSQLRequest cloudsqlBackupRunSource + * @property {string|null} [parent] RestoreFromCloudSQLRequest parent + * @property {string|null} [clusterId] RestoreFromCloudSQLRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] RestoreFromCloudSQLRequest cluster + */ + + /** + * Constructs a new RestoreFromCloudSQLRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a RestoreFromCloudSQLRequest. + * @implements IRestoreFromCloudSQLRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest=} [properties] Properties to set + */ + function RestoreFromCloudSQLRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreFromCloudSQLRequest cloudsqlBackupRunSource. + * @member {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.cloudsqlBackupRunSource = null; + + /** + * RestoreFromCloudSQLRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.parent = ""; + + /** + * RestoreFromCloudSQLRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.clusterId = ""; + + /** + * RestoreFromCloudSQLRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @instance + */ + RestoreFromCloudSQLRequest.prototype.cluster = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreFromCloudSQLRequest source. + * @member {"cloudsqlBackupRunSource"|undefined} source + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @instance + */ + Object.defineProperty(RestoreFromCloudSQLRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["cloudsqlBackupRunSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest instance + */ + RestoreFromCloudSQLRequest.create = function create(properties) { + return new RestoreFromCloudSQLRequest(properties); + }; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreFromCloudSQLRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) + $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreFromCloudSQLRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreFromCloudSQLRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 101: { + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreFromCloudSQLRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreFromCloudSQLRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreFromCloudSQLRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); + if (error) + return "cloudsqlBackupRunSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + return null; + }; + + /** + * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest + */ + RestoreFromCloudSQLRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest(); + if (object.cloudsqlBackupRunSource != null) { + if (typeof object.cloudsqlBackupRunSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.cloudsqlBackupRunSource: object expected"); + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + return message; + }; + + /** + * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreFromCloudSQLRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); + if (options.oneofs) + object.source = "cloudsqlBackupRunSource"; + } + return object; + }; + + /** + * Converts this RestoreFromCloudSQLRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreFromCloudSQLRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreFromCloudSQLRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreFromCloudSQLRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest"; + }; + + return RestoreFromCloudSQLRequest; + })(); + + /** + * InstanceView enum. + * @name google.cloud.alloydb.v1beta.InstanceView + * @enum {number} + * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value + * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value + * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value + */ + v1beta.InstanceView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; + values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; + return values; + })(); + + /** + * ClusterView enum. + * @name google.cloud.alloydb.v1beta.ClusterView + * @enum {number} + * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value + * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value + * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value + */ + v1beta.ClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; + values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; + return values; + })(); + + /** + * DatabaseVersion enum. + * @name google.cloud.alloydb.v1beta.DatabaseVersion + * @enum {number} + * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value + * @property {number} POSTGRES_13=1 POSTGRES_13 value + * @property {number} POSTGRES_14=2 POSTGRES_14 value + * @property {number} POSTGRES_15=3 POSTGRES_15 value + * @property {number} POSTGRES_16=4 POSTGRES_16 value + * @property {number} POSTGRES_17=5 POSTGRES_17 value + * @property {number} POSTGRES_18=6 POSTGRES_18 value + */ + v1beta.DatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSTGRES_13"] = 1; + values[valuesById[2] = "POSTGRES_14"] = 2; + values[valuesById[3] = "POSTGRES_15"] = 3; + values[valuesById[4] = "POSTGRES_16"] = 4; + values[valuesById[5] = "POSTGRES_17"] = 5; + values[valuesById[6] = "POSTGRES_18"] = 6; + return values; + })(); + + /** + * SubscriptionType enum. + * @name google.cloud.alloydb.v1beta.SubscriptionType + * @enum {number} + * @property {number} SUBSCRIPTION_TYPE_UNSPECIFIED=0 SUBSCRIPTION_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} TRIAL=2 TRIAL value + */ + v1beta.SubscriptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUBSCRIPTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "TRIAL"] = 2; + return values; + })(); + + v1beta.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.alloydb.v1beta + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set + */ + function UserPassword(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserPassword user. + * @member {string} user + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @instance + */ + UserPassword.prototype.user = ""; + + /** + * UserPassword password. + * @member {string} password + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @instance + */ + UserPassword.prototype.password = ""; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UserPassword) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UserPassword(); + if (object.user != null) + message.user = String(object.user); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {google.cloud.alloydb.v1beta.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = ""; + object.password = ""; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UserPassword"; + }; + + return UserPassword; + })(); + + v1beta.MigrationSource = (function() { + + /** + * Properties of a MigrationSource. + * @memberof google.cloud.alloydb.v1beta + * @interface IMigrationSource + * @property {string|null} [hostPort] MigrationSource hostPort + * @property {string|null} [referenceId] MigrationSource referenceId + * @property {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType + */ + + /** + * Constructs a new MigrationSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a MigrationSource. + * @implements IMigrationSource + * @constructor + * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set + */ + function MigrationSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationSource hostPort. + * @member {string} hostPort + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + */ + MigrationSource.prototype.hostPort = ""; + + /** + * MigrationSource referenceId. + * @member {string} referenceId + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + */ + MigrationSource.prototype.referenceId = ""; + + /** + * MigrationSource sourceType. + * @member {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType} sourceType + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + */ + MigrationSource.prototype.sourceType = 0; + + /** + * Creates a new MigrationSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource instance + */ + MigrationSource.create = function create(properties) { + return new MigrationSource(properties); + }; + + /** + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); + if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); + return writer; + }; + + /** + * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hostPort = reader.string(); + break; + } + case 2: { + message.referenceId = reader.string(); + break; + } + case 3: { + message.sourceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (!$util.isString(message.hostPort)) + return "hostPort: string expected"; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + if (!$util.isString(message.referenceId)) + return "referenceId: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource + */ + MigrationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MigrationSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); + if (object.hostPort != null) + message.hostPort = String(object.hostPort); + if (object.referenceId != null) + message.referenceId = String(object.referenceId); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "DMS": + case 1: + message.sourceType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {google.cloud.alloydb.v1beta.MigrationSource} message MigrationSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostPort = ""; + object.referenceId = ""; + object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.hostPort != null && message.hasOwnProperty("hostPort")) + object.hostPort = message.hostPort; + if (message.referenceId != null && message.hasOwnProperty("referenceId")) + object.referenceId = message.referenceId; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; + return object; + }; + + /** + * Converts this MigrationSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @instance + * @returns {Object.} JSON object + */ + MigrationSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MigrationSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MigrationSource"; + }; + + /** + * MigrationSourceType enum. + * @name google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType + * @enum {number} + * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value + * @property {number} DMS=1 DMS value + */ + MigrationSource.MigrationSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DMS"] = 1; + return values; + })(); + + return MigrationSource; + })(); + + v1beta.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {google.cloud.alloydb.v1beta.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1beta.EncryptionInfo = (function() { + + /** + * Properties of an EncryptionInfo. + * @memberof google.cloud.alloydb.v1beta + * @interface IEncryptionInfo + * @property {google.cloud.alloydb.v1beta.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType + * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + */ + + /** + * Constructs a new EncryptionInfo. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an EncryptionInfo. + * @implements IEncryptionInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set + */ + function EncryptionInfo(properties) { + this.kmsKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionInfo encryptionType. + * @member {google.cloud.alloydb.v1beta.EncryptionInfo.Type} encryptionType + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.encryptionType = 0; + + /** + * EncryptionInfo kmsKeyVersions. + * @member {Array.} kmsKeyVersions + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @instance + */ + EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + + /** + * Creates a new EncryptionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo instance + */ + EncryptionInfo.create = function create(properties) { + return new EncryptionInfo(properties); + }; + + /** + * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); + if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); + return writer; + }; + + /** + * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionType = reader.int32(); + break; + } + case 2: { + if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) + message.kmsKeyVersions = []; + message.kmsKeyVersions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + switch (message.encryptionType) { + default: + return "encryptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { + if (!Array.isArray(message.kmsKeyVersions)) + return "kmsKeyVersions: array expected"; + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + if (!$util.isString(message.kmsKeyVersions[i])) + return "kmsKeyVersions: string[] expected"; + } + return null; + }; + + /** + * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo + */ + EncryptionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); + switch (object.encryptionType) { + default: + if (typeof object.encryptionType === "number") { + message.encryptionType = object.encryptionType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.encryptionType = 0; + break; + case "GOOGLE_DEFAULT_ENCRYPTION": + case 1: + message.encryptionType = 1; + break; + case "CUSTOMER_MANAGED_ENCRYPTION": + case 2: + message.encryptionType = 2; + break; + } + if (object.kmsKeyVersions) { + if (!Array.isArray(object.kmsKeyVersions)) + throw TypeError(".google.cloud.alloydb.v1beta.EncryptionInfo.kmsKeyVersions: array expected"); + message.kmsKeyVersions = []; + for (var i = 0; i < object.kmsKeyVersions.length; ++i) + message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {google.cloud.alloydb.v1beta.EncryptionInfo} message EncryptionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.kmsKeyVersions = []; + if (options.defaults) + object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; + if (message.kmsKeyVersions && message.kmsKeyVersions.length) { + object.kmsKeyVersions = []; + for (var j = 0; j < message.kmsKeyVersions.length; ++j) + object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + } + return object; + }; + + /** + * Converts this EncryptionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @instance + * @returns {Object.} JSON object + */ + EncryptionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.EncryptionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionInfo"; + }; + + /** + * Type enum. + * @name google.cloud.alloydb.v1beta.EncryptionInfo.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value + * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value + */ + EncryptionInfo.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; + values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; + return values; + })(); + + return EncryptionInfo; + })(); + + v1beta.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface ISslConfig + * @property {google.cloud.alloydb.v1beta.SslConfig.SslMode|null} [sslMode] SslConfig sslMode + * @property {google.cloud.alloydb.v1beta.SslConfig.CaSource|null} [caSource] SslConfig caSource + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig sslMode. + * @member {google.cloud.alloydb.v1beta.SslConfig.SslMode} sslMode + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @instance + */ + SslConfig.prototype.sslMode = 0; + + /** + * SslConfig caSource. + * @member {google.cloud.alloydb.v1beta.SslConfig.CaSource} caSource + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @instance + */ + SslConfig.prototype.caSource = 0; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); + if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sslMode = reader.int32(); + break; + } + case 2: { + message.caSource = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + switch (message.sslMode) { + default: + return "sslMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.caSource != null && message.hasOwnProperty("caSource")) + switch (message.caSource) { + default: + return "caSource: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SslConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SslConfig(); + switch (object.sslMode) { + default: + if (typeof object.sslMode === "number") { + message.sslMode = object.sslMode; + break; + } + break; + case "SSL_MODE_UNSPECIFIED": + case 0: + message.sslMode = 0; + break; + case "SSL_MODE_ALLOW": + case 1: + message.sslMode = 1; + break; + case "SSL_MODE_REQUIRE": + case 2: + message.sslMode = 2; + break; + case "SSL_MODE_VERIFY_CA": + case 3: + message.sslMode = 3; + break; + case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": + case 4: + message.sslMode = 4; + break; + case "ENCRYPTED_ONLY": + case 5: + message.sslMode = 5; + break; + } + switch (object.caSource) { + default: + if (typeof object.caSource === "number") { + message.caSource = object.caSource; + break; + } + break; + case "CA_SOURCE_UNSPECIFIED": + case 0: + message.caSource = 0; + break; + case "CA_SOURCE_MANAGED": + case 1: + message.caSource = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {google.cloud.alloydb.v1beta.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; + object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; + } + if (message.sslMode != null && message.hasOwnProperty("sslMode")) + object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] : message.sslMode; + if (message.caSource != null && message.hasOwnProperty("caSource")) + object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] : message.caSource; + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SslConfig"; + }; + + /** + * SslMode enum. + * @name google.cloud.alloydb.v1beta.SslConfig.SslMode + * @enum {number} + * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value + * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value + * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value + * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value + * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value + * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value + */ + SslConfig.SslMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; + values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; + values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; + values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; + values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; + return values; + })(); + + /** + * CaSource enum. + * @name google.cloud.alloydb.v1beta.SslConfig.CaSource + * @enum {number} + * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value + * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value + */ + SslConfig.CaSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; + return values; + })(); + + return SslConfig; + })(); + + v1beta.AutomatedBackupPolicy = (function() { + + /** + * Properties of an AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1beta + * @interface IAutomatedBackupPolicy + * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule + * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention + * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention + * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled + * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig + * @property {string|null} [location] AutomatedBackupPolicy location + * @property {Object.|null} [labels] AutomatedBackupPolicy labels + */ + + /** + * Constructs a new AutomatedBackupPolicy. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an AutomatedBackupPolicy. + * @implements IAutomatedBackupPolicy + * @constructor + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set + */ + function AutomatedBackupPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedBackupPolicy weeklySchedule. + * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.weeklySchedule = null; + + /** + * AutomatedBackupPolicy timeBasedRetention. + * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.timeBasedRetention = null; + + /** + * AutomatedBackupPolicy quantityBasedRetention. + * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.quantityBasedRetention = null; + + /** + * AutomatedBackupPolicy enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.enabled = null; + + /** + * AutomatedBackupPolicy backupWindow. + * @member {google.protobuf.IDuration|null|undefined} backupWindow + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.backupWindow = null; + + /** + * AutomatedBackupPolicy encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.encryptionConfig = null; + + /** + * AutomatedBackupPolicy location. + * @member {string} location + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.location = ""; + + /** + * AutomatedBackupPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + AutomatedBackupPolicy.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutomatedBackupPolicy schedule. + * @member {"weeklySchedule"|undefined} schedule + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { + get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedBackupPolicy retention. + * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { + get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutomatedBackupPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy instance + */ + AutomatedBackupPolicy.create = function create(properties) { + return new AutomatedBackupPolicy(properties); + }; + + /** + * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); + break; + } + case 4: { + message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); + break; + } + case 5: { + message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); + break; + } + case 1: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedBackupPolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedBackupPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + properties.schedule = 1; + { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); + if (error) + return "weeklySchedule." + error; + } + } + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); + if (error) + return "timeBasedRetention." + error; + } + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + if (properties.retention === 1) + return "retention: multiple values"; + properties.retention = 1; + { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); + if (error) + return "quantityBasedRetention." + error; + } + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.protobuf.Duration.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy + */ + AutomatedBackupPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(); + if (object.weeklySchedule != null) { + if (typeof object.weeklySchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.weeklySchedule: object expected"); + message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); + } + if (object.timeBasedRetention != null) { + if (typeof object.timeBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.timeBasedRetention: object expected"); + message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); + } + if (object.quantityBasedRetention != null) { + if (typeof object.quantityBasedRetention !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.quantityBasedRetention: object expected"); + message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.backupWindow: object expected"); + message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedBackupPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.backupWindow = null; + object.location = ""; + object.encryptionConfig = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + object.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); + if (options.oneofs) + object.schedule = "weeklySchedule"; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); + if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { + object.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); + if (options.oneofs) + object.retention = "timeBasedRetention"; + } + if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { + object.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); + if (options.oneofs) + object.retention = "quantityBasedRetention"; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this AutomatedBackupPolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + * @returns {Object.} JSON object + */ + AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomatedBackupPolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy"; + }; + + AutomatedBackupPolicy.WeeklySchedule = (function() { + + /** + * Properties of a WeeklySchedule. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @interface IWeeklySchedule + * @property {Array.|null} [startTimes] WeeklySchedule startTimes + * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek + */ + + /** + * Constructs a new WeeklySchedule. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @classdesc Represents a WeeklySchedule. + * @implements IWeeklySchedule + * @constructor + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + */ + function WeeklySchedule(properties) { + this.startTimes = []; + this.daysOfWeek = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklySchedule startTimes. + * @member {Array.} startTimes + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.startTimes = $util.emptyArray; + + /** + * WeeklySchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @instance + */ + WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * Creates a new WeeklySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance + */ + WeeklySchedule.create = function create(properties) { + return new WeeklySchedule(properties); + }; + + /** + * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimes != null && message.startTimes.length) + for (var i = 0; i < message.startTimes.length; ++i) + $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.startTimes && message.startTimes.length)) + message.startTimes = []; + message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklySchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimes != null && message.hasOwnProperty("startTimes")) { + if (!Array.isArray(message.startTimes)) + return "startTimes: array expected"; + for (var i = 0; i < message.startTimes.length; ++i) { + var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); + if (error) + return "startTimes." + error; + } + } + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + */ + WeeklySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); + if (object.startTimes) { + if (!Array.isArray(object.startTimes)) + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); + message.startTimes = []; + for (var i = 0; i < object.startTimes.length; ++i) { + if (typeof object.startTimes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); + message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); + } + } + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startTimes = []; + object.daysOfWeek = []; + } + if (message.startTimes && message.startTimes.length) { + object.startTimes = []; + for (var j = 0; j < message.startTimes.length; ++j) + object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); + } + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + return object; + }; + + /** + * Converts this WeeklySchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @instance + * @returns {Object.} JSON object + */ + WeeklySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeeklySchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule"; + }; + + return WeeklySchedule; + })(); + + AutomatedBackupPolicy.TimeBasedRetention = (function() { + + /** + * Properties of a TimeBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @interface ITimeBasedRetention + * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod + */ + + /** + * Constructs a new TimeBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @classdesc Represents a TimeBasedRetention. + * @implements ITimeBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + */ + function TimeBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeBasedRetention retentionPeriod. + * @member {google.protobuf.IDuration|null|undefined} retentionPeriod + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @instance + */ + TimeBasedRetention.prototype.retentionPeriod = null; + + /** + * Creates a new TimeBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance + */ + TimeBasedRetention.create = function create(properties) { + return new TimeBasedRetention(properties); + }; + + /** + * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) + $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); + if (error) + return "retentionPeriod." + error; + } + return null; + }; + + /** + * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention + */ + TimeBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); + if (object.retentionPeriod != null) { + if (typeof object.retentionPeriod !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); + message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); + } + return message; + }; + + /** + * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionPeriod = null; + if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) + object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); + return object; + }; + + /** + * Converts this TimeBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @instance + * @returns {Object.} JSON object + */ + TimeBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention"; + }; + + return TimeBasedRetention; + })(); + + AutomatedBackupPolicy.QuantityBasedRetention = (function() { + + /** + * Properties of a QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @interface IQuantityBasedRetention + * @property {number|null} [count] QuantityBasedRetention count + */ + + /** + * Constructs a new QuantityBasedRetention. + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @classdesc Represents a QuantityBasedRetention. + * @implements IQuantityBasedRetention + * @constructor + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + */ + function QuantityBasedRetention(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedRetention count. + * @member {number} count + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + */ + QuantityBasedRetention.prototype.count = 0; + + /** + * Creates a new QuantityBasedRetention instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance + */ + QuantityBasedRetention.create = function create(properties) { + return new QuantityBasedRetention(properties); + }; + + /** + * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); + return writer; + }; + + /** + * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedRetention message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedRetention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention + */ + QuantityBasedRetention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) + return object; + var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedRetention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.count = 0; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this QuantityBasedRetention to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedRetention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedRetention + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention"; + }; + + return QuantityBasedRetention; + })(); + + return AutomatedBackupPolicy; + })(); + + v1beta.ContinuousBackupConfig = (function() { + + /** + * Properties of a ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IContinuousBackupConfig + * @property {boolean|null} [enabled] ContinuousBackupConfig enabled + * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig + */ + + /** + * Constructs a new ContinuousBackupConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ContinuousBackupConfig. + * @implements IContinuousBackupConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set + */ + function ContinuousBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.enabled = null; + + /** + * ContinuousBackupConfig recoveryWindowDays. + * @member {number} recoveryWindowDays + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.recoveryWindowDays = 0; + + /** + * ContinuousBackupConfig encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + ContinuousBackupConfig.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContinuousBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig instance + */ + ContinuousBackupConfig.create = function create(properties) { + return new ContinuousBackupConfig(properties); + }; + + /** + * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 4: { + message.recoveryWindowDays = reader.int32(); + break; + } + case 3: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + if (!$util.isInteger(message.recoveryWindowDays)) + return "recoveryWindowDays: integer expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig + */ + ContinuousBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.recoveryWindowDays != null) + message.recoveryWindowDays = object.recoveryWindowDays | 0; + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {google.cloud.alloydb.v1beta.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encryptionConfig = null; + object.recoveryWindowDays = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) + object.recoveryWindowDays = message.recoveryWindowDays; + return object; + }; + + /** + * Converts this ContinuousBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupConfig"; + }; + + return ContinuousBackupConfig; + })(); + + v1beta.ContinuousBackupInfo = (function() { + + /** + * Properties of a ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1beta + * @interface IContinuousBackupInfo + * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo + * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime + * @property {Array.|null} [schedule] ContinuousBackupInfo schedule + * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime + */ + + /** + * Constructs a new ContinuousBackupInfo. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ContinuousBackupInfo. + * @implements IContinuousBackupInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set + */ + function ContinuousBackupInfo(properties) { + this.schedule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupInfo encryptionInfo. + * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.encryptionInfo = null; + + /** + * ContinuousBackupInfo enabledTime. + * @member {google.protobuf.ITimestamp|null|undefined} enabledTime + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.enabledTime = null; + + /** + * ContinuousBackupInfo schedule. + * @member {Array.} schedule + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.schedule = $util.emptyArray; + + /** + * ContinuousBackupInfo earliestRestorableTime. + * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + */ + ContinuousBackupInfo.prototype.earliestRestorableTime = null; + + /** + * Creates a new ContinuousBackupInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo instance + */ + ContinuousBackupInfo.create = function create(properties) { + return new ContinuousBackupInfo(properties); + }; + + /** + * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) + $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schedule != null && message.schedule.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.schedule.length; ++i) + writer.int32(message.schedule[i]); + writer.ldelim(); + } + if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) + $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.schedule && message.schedule.length)) + message.schedule = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.schedule.push(reader.int32()); + } else + message.schedule.push(reader.int32()); + break; + } + case 4: { + message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); + if (error) + return "enabledTime." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + if (!Array.isArray(message.schedule)) + return "schedule: array expected"; + for (var i = 0; i < message.schedule.length; ++i) + switch (message.schedule[i]) { + default: + return "schedule: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); + if (error) + return "earliestRestorableTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo + */ + ContinuousBackupInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.enabledTime != null) { + if (typeof object.enabledTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.enabledTime: object expected"); + message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); + } + if (object.schedule) { + if (!Array.isArray(object.schedule)) + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.schedule: array expected"); + message.schedule = []; + for (var i = 0; i < object.schedule.length; ++i) + switch (object.schedule[i]) { + default: + if (typeof object.schedule[i] === "number") { + message.schedule[i] = object.schedule[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.schedule[i] = 0; + break; + case "MONDAY": + case 1: + message.schedule[i] = 1; + break; + case "TUESDAY": + case 2: + message.schedule[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.schedule[i] = 3; + break; + case "THURSDAY": + case 4: + message.schedule[i] = 4; + break; + case "FRIDAY": + case 5: + message.schedule[i] = 5; + break; + case "SATURDAY": + case 6: + message.schedule[i] = 6; + break; + case "SUNDAY": + case 7: + message.schedule[i] = 7; + break; + } + } + if (object.earliestRestorableTime != null) { + if (typeof object.earliestRestorableTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.earliestRestorableTime: object expected"); + message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {google.cloud.alloydb.v1beta.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schedule = []; + if (options.defaults) { + object.encryptionInfo = null; + object.enabledTime = null; + object.earliestRestorableTime = null; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) + object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); + if (message.schedule && message.schedule.length) { + object.schedule = []; + for (var j = 0; j < message.schedule.length; ++j) + object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; + } + if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) + object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupInfo"; + }; + + return ContinuousBackupInfo; + })(); + + v1beta.BackupSource = (function() { + + /** + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1beta + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName + */ + + /** + * Constructs a new BackupSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a BackupSource. + * @implements IBackupSource + * @constructor + * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set + */ + function BackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @instance + */ + BackupSource.prototype.backupUid = ""; + + /** + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @instance + */ + BackupSource.prototype.backupName = ""; + + /** + * Creates a new BackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource instance + */ + BackupSource.create = function create(properties) { + return new BackupSource(properties); + }; + + /** + * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); + if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); + return writer; + }; + + /** + * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.backupUid = reader.string(); + break; + } + case 1: { + message.backupName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + if (!$util.isString(message.backupUid)) + return "backupUid: string expected"; + if (message.backupName != null && message.hasOwnProperty("backupName")) + if (!$util.isString(message.backupName)) + return "backupName: string expected"; + return null; + }; + + /** + * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource + */ + BackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.BackupSource(); + if (object.backupUid != null) + message.backupUid = String(object.backupUid); + if (object.backupName != null) + message.backupName = String(object.backupName); + return message; + }; + + /** + * Creates a plain object from a BackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {google.cloud.alloydb.v1beta.BackupSource} message BackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupName = ""; + object.backupUid = ""; + } + if (message.backupName != null && message.hasOwnProperty("backupName")) + object.backupName = message.backupName; + if (message.backupUid != null && message.hasOwnProperty("backupUid")) + object.backupUid = message.backupUid; + return object; + }; + + /** + * Converts this BackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @instance + * @returns {Object.} JSON object + */ + BackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.BackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BackupSource"; + }; + + return BackupSource; + })(); + + v1beta.ContinuousBackupSource = (function() { + + /** + * Properties of a ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1beta + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + */ + + /** + * Constructs a new ContinuousBackupSource. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource + * @constructor + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set + */ + function ContinuousBackupSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.cluster = ""; + + /** + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @instance + */ + ContinuousBackupSource.prototype.pointInTime = null; + + /** + * Creates a new ContinuousBackupSource instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource instance + */ + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); + }; + + /** + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousBackupSource message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousBackupSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); + if (error) + return "pointInTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource + */ + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupSource) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.pointInTime != null) { + if (typeof object.pointInTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupSource.pointInTime: object expected"); + message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {google.cloud.alloydb.v1beta.ContinuousBackupSource} message ContinuousBackupSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousBackupSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.pointInTime = null; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); + return object; + }; + + /** + * Converts this ContinuousBackupSource to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @instance + * @returns {Object.} JSON object + */ + ContinuousBackupSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContinuousBackupSource + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupSource"; + }; + + return ContinuousBackupSource; + })(); + + v1beta.MaintenanceUpdatePolicy = (function() { + + /** + * Properties of a MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1beta + * @interface IMaintenanceUpdatePolicy + * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows + * @property {Array.|null} [denyMaintenancePeriods] MaintenanceUpdatePolicy denyMaintenancePeriods + */ + + /** + * Constructs a new MaintenanceUpdatePolicy. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a MaintenanceUpdatePolicy. + * @implements IMaintenanceUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy=} [properties] Properties to set + */ + function MaintenanceUpdatePolicy(properties) { + this.maintenanceWindows = []; + this.denyMaintenancePeriods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceUpdatePolicy maintenanceWindows. + * @member {Array.} maintenanceWindows + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; + + /** + * MaintenanceUpdatePolicy denyMaintenancePeriods. + * @member {Array.} denyMaintenancePeriods + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @instance + */ + MaintenanceUpdatePolicy.prototype.denyMaintenancePeriods = $util.emptyArray; + + /** + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance + */ + MaintenanceUpdatePolicy.create = function create(properties) { + return new MaintenanceUpdatePolicy(properties); + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maintenanceWindows != null && message.maintenanceWindows.length) + for (var i = 0; i < message.maintenanceWindows.length; ++i) + $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) + for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) + $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.maintenanceWindows && message.maintenanceWindows.length)) + message.maintenanceWindows = []; + message.maintenanceWindows.push($root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.denyMaintenancePeriods && message.denyMaintenancePeriods.length)) + message.denyMaintenancePeriods = []; + message.denyMaintenancePeriods.push($root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceUpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceUpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { + if (!Array.isArray(message.maintenanceWindows)) + return "maintenanceWindows: array expected"; + for (var i = 0; i < message.maintenanceWindows.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); + if (error) + return "maintenanceWindows." + error; + } + } + if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { + if (!Array.isArray(message.denyMaintenancePeriods)) + return "denyMaintenancePeriods: array expected"; + for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify(message.denyMaintenancePeriods[i]); + if (error) + return "denyMaintenancePeriods." + error; + } + } + return null; + }; + + /** + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy + */ + MaintenanceUpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy(); + if (object.maintenanceWindows) { + if (!Array.isArray(object.maintenanceWindows)) + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); + message.maintenanceWindows = []; + for (var i = 0; i < object.maintenanceWindows.length; ++i) { + if (typeof object.maintenanceWindows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); + message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); + } + } + if (object.denyMaintenancePeriods) { + if (!Array.isArray(object.denyMaintenancePeriods)) + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.denyMaintenancePeriods: array expected"); + message.denyMaintenancePeriods = []; + for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { + if (typeof object.denyMaintenancePeriods[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.denyMaintenancePeriods: object expected"); + message.denyMaintenancePeriods[i] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceUpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.maintenanceWindows = []; + object.denyMaintenancePeriods = []; + } + if (message.maintenanceWindows && message.maintenanceWindows.length) { + object.maintenanceWindows = []; + for (var j = 0; j < message.maintenanceWindows.length; ++j) + object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); + } + if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { + object.denyMaintenancePeriods = []; + for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) + object.denyMaintenancePeriods[j] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); + } + return object; + }; + + /** + * Converts this MaintenanceUpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceUpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy"; + }; + + MaintenanceUpdatePolicy.MaintenanceWindow = (function() { + + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @interface IMaintenanceWindow + * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day + * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime + */ + + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.day = 0; + + /** + * MaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.day = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.day != null && message.hasOwnProperty("day")) + switch (message.day) { + default: + return "day: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.day = 0; + break; + case "MONDAY": + case 1: + message.day = 1; + break; + case "TUESDAY": + case 2: + message.day = 2; + break; + case "WEDNESDAY": + case 3: + message.day = 3; + break; + case "THURSDAY": + case 4: + message.day = 4; + break; + case "FRIDAY": + case 5: + message.day = 5; + break; + case "SATURDAY": + case 6: + message.day = 6; + break; + case "SUNDAY": + case 7: + message.day = 7; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.startTime = null; + } + if (message.day != null && message.hasOwnProperty("day")) + object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + MaintenanceUpdatePolicy.DenyMaintenancePeriod = (function() { + + /** + * Properties of a DenyMaintenancePeriod. + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @interface IDenyMaintenancePeriod + * @property {google.type.IDate|null} [startDate] DenyMaintenancePeriod startDate + * @property {google.type.IDate|null} [endDate] DenyMaintenancePeriod endDate + * @property {google.type.ITimeOfDay|null} [time] DenyMaintenancePeriod time + */ + + /** + * Constructs a new DenyMaintenancePeriod. + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy + * @classdesc Represents a DenyMaintenancePeriod. + * @implements IDenyMaintenancePeriod + * @constructor + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set + */ + function DenyMaintenancePeriod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DenyMaintenancePeriod startDate. + * @member {google.type.IDate|null|undefined} startDate + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.startDate = null; + + /** + * DenyMaintenancePeriod endDate. + * @member {google.type.IDate|null|undefined} endDate + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.endDate = null; + + /** + * DenyMaintenancePeriod time. + * @member {google.type.ITimeOfDay|null|undefined} time + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + */ + DenyMaintenancePeriod.prototype.time = null; + + /** + * Creates a new DenyMaintenancePeriod instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod instance + */ + DenyMaintenancePeriod.create = function create(properties) { + return new DenyMaintenancePeriod(properties); + }; + + /** + * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenyMaintenancePeriod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) + $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) + $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenyMaintenancePeriod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 3: { + message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DenyMaintenancePeriod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DenyMaintenancePeriod message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DenyMaintenancePeriod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startDate != null && message.hasOwnProperty("startDate")) { + var error = $root.google.type.Date.verify(message.startDate); + if (error) + return "startDate." + error; + } + if (message.endDate != null && message.hasOwnProperty("endDate")) { + var error = $root.google.type.Date.verify(message.endDate); + if (error) + return "endDate." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.type.TimeOfDay.verify(message.time); + if (error) + return "time." + error; + } + return null; + }; + + /** + * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod + */ + DenyMaintenancePeriod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); + if (object.startDate != null) { + if (typeof object.startDate !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.startDate: object expected"); + message.startDate = $root.google.type.Date.fromObject(object.startDate); + } + if (object.endDate != null) { + if (typeof object.endDate !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.endDate: object expected"); + message.endDate = $root.google.type.Date.fromObject(object.endDate); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.time: object expected"); + message.time = $root.google.type.TimeOfDay.fromObject(object.time); + } + return message; + }; + + /** + * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} message DenyMaintenancePeriod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DenyMaintenancePeriod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startDate = null; + object.endDate = null; + object.time = null; + } + if (message.startDate != null && message.hasOwnProperty("startDate")) + object.startDate = $root.google.type.Date.toObject(message.startDate, options); + if (message.endDate != null && message.hasOwnProperty("endDate")) + object.endDate = $root.google.type.Date.toObject(message.endDate, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.type.TimeOfDay.toObject(message.time, options); + return object; + }; + + /** + * Converts this DenyMaintenancePeriod to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @instance + * @returns {Object.} JSON object + */ + DenyMaintenancePeriod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DenyMaintenancePeriod + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DenyMaintenancePeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod"; + }; + + return DenyMaintenancePeriod; + })(); + + return MaintenanceUpdatePolicy; + })(); + + v1beta.MaintenanceSchedule = (function() { + + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1beta + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + */ + + /** + * Constructs a new MaintenanceSchedule. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule=} [properties] Properties to set + */ + function MaintenanceSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1beta.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceSchedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {google.cloud.alloydb.v1beta.MaintenanceSchedule} message MaintenanceSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTime = null; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceSchedule"; + }; + + return MaintenanceSchedule; + })(); + + v1beta.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.alloydb.v1beta + * @interface ICluster + * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] Cluster backupSource + * @property {google.cloud.alloydb.v1beta.IMigrationSource|null} [migrationSource] Cluster migrationSource + * @property {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] Cluster cloudsqlBackupRunSource + * @property {string|null} [name] Cluster name + * @property {string|null} [displayName] Cluster displayName + * @property {string|null} [uid] Cluster uid + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.alloydb.v1beta.Cluster.State|null} [state] Cluster state + * @property {google.cloud.alloydb.v1beta.Cluster.ClusterType|null} [clusterType] Cluster clusterType + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig + * @property {string|null} [network] Cluster network + * @property {string|null} [etag] Cluster etag + * @property {Object.|null} [annotations] Cluster annotations + * @property {boolean|null} [reconciling] Cluster reconciling + * @property {google.cloud.alloydb.v1beta.IUserPassword|null} [initialUser] Cluster initialUser + * @property {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy + * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] Cluster sslConfig + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig + * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo + * @property {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig + * @property {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo + * @property {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig + * @property {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig + * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs + * @property {google.cloud.alloydb.v1beta.Cluster.IPscConfig|null} [pscConfig] Cluster pscConfig + * @property {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy + * @property {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule + * @property {google.cloud.alloydb.v1beta.IGeminiClusterConfig|null} [geminiConfig] Cluster geminiConfig + * @property {google.cloud.alloydb.v1beta.SubscriptionType|null} [subscriptionType] Cluster subscriptionType + * @property {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata + * @property {Object.|null} [tags] Cluster tags + * @property {string|null} [serviceAccountEmail] Cluster serviceAccountEmail + * @property {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.labels = {}; + this.annotations = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster backupSource. + * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.backupSource = null; + + /** + * Cluster migrationSource. + * @member {google.cloud.alloydb.v1beta.IMigrationSource|null|undefined} migrationSource + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.migrationSource = null; + + /** + * Cluster cloudsqlBackupRunSource. + * @member {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.cloudsqlBackupRunSource = null; + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.displayName = ""; + + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.uid = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.deleteTime = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster state. + * @member {google.cloud.alloydb.v1beta.Cluster.State} state + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster clusterType. + * @member {google.cloud.alloydb.v1beta.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.clusterType = 0; + + /** + * Cluster databaseVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.databaseVersion = 0; + + /** + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.networkConfig = null; + + /** + * Cluster network. + * @member {string} network + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.network = ""; + + /** + * Cluster etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.etag = ""; + + /** + * Cluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.annotations = $util.emptyObject; + + /** + * Cluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.reconciling = false; + + /** + * Cluster initialUser. + * @member {google.cloud.alloydb.v1beta.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.initialUser = null; + + /** + * Cluster automatedBackupPolicy. + * @member {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.automatedBackupPolicy = null; + + /** + * Cluster sslConfig. + * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.sslConfig = null; + + /** + * Cluster encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.encryptionConfig = null; + + /** + * Cluster encryptionInfo. + * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.encryptionInfo = null; + + /** + * Cluster continuousBackupConfig. + * @member {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null|undefined} continuousBackupConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.continuousBackupConfig = null; + + /** + * Cluster continuousBackupInfo. + * @member {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null|undefined} continuousBackupInfo + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.continuousBackupInfo = null; + + /** + * Cluster secondaryConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null|undefined} secondaryConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.secondaryConfig = null; + + /** + * Cluster primaryConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null|undefined} primaryConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.primaryConfig = null; + + /** + * Cluster satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.satisfiesPzs = false; + + /** + * Cluster pscConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.IPscConfig|null|undefined} pscConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.pscConfig = null; + + /** + * Cluster maintenanceUpdatePolicy. + * @member {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.maintenanceUpdatePolicy = null; + + /** + * Cluster maintenanceSchedule. + * @member {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.maintenanceSchedule = null; + + /** + * Cluster geminiConfig. + * @member {google.cloud.alloydb.v1beta.IGeminiClusterConfig|null|undefined} geminiConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.geminiConfig = null; + + /** + * Cluster subscriptionType. + * @member {google.cloud.alloydb.v1beta.SubscriptionType} subscriptionType + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.subscriptionType = 0; + + /** + * Cluster trialMetadata. + * @member {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null|undefined} trialMetadata + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.trialMetadata = null; + + /** + * Cluster tags. + * @member {Object.} tags + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.tags = $util.emptyObject; + + /** + * Cluster serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.serviceAccountEmail = ""; + + /** + * Cluster dataplexConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null|undefined} dataplexConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.dataplexConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|"cloudsqlBackupRunSource"|undefined} source + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource", "cloudsqlBackupRunSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.alloydb.v1beta.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) + $root.google.cloud.alloydb.v1beta.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) + $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); + if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) + $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) + $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.encode(message.pscConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) + $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) + $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.encode(message.geminiConfig, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.subscriptionType != null && Object.hasOwnProperty.call(message, "subscriptionType")) + writer.uint32(/* id 38, wireType 0 =*/304).int32(message.subscriptionType); + if (message.trialMetadata != null && Object.hasOwnProperty.call(message, "trialMetadata")) + $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.encode(message.trialMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) + $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 46, wireType 2 =*/370).string(message.serviceAccountEmail); + if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 15: { + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); + break; + } + case 16: { + message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.decode(reader, reader.uint32()); + break; + } + case 42: { + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 24: { + message.clusterType = reader.int32(); + break; + } + case 9: { + message.databaseVersion = reader.int32(); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.network = reader.string(); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 12: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 13: { + message.reconciling = reader.bool(); + break; + } + case 14: { + message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.decode(reader, reader.uint32()); + break; + } + case 17: { + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.decode(reader, reader.uint32()); + break; + } + case 18: { + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 27: { + message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.decode(reader, reader.uint32()); + break; + } + case 22: { + message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.decode(reader, reader.uint32()); + break; + } + case 30: { + message.satisfiesPzs = reader.bool(); + break; + } + case 31: { + message.pscConfig = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.decode(reader, reader.uint32()); + break; + } + case 32: { + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); + break; + } + case 37: { + message.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.decode(reader, reader.uint32()); + break; + } + case 36: { + message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.decode(reader, reader.uint32()); + break; + } + case 38: { + message.subscriptionType = reader.int32(); + break; + } + case 39: { + message.trialMetadata = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.decode(reader, reader.uint32()); + break; + } + case 41: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + case 46: { + message.serviceAccountEmail = reader.string(); + break; + } + case 47: { + message.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.MigrationSource.verify(message.migrationSource); + if (error) + return "migrationSource." + error; + } + } + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); + if (error) + return "cloudsqlBackupRunSource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.alloydb.v1beta.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { + var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); + if (error) + return "automatedBackupPolicy." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { + var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify(message.continuousBackupConfig); + if (error) + return "continuousBackupConfig." + error; + } + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { + var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify(message.continuousBackupInfo); + if (error) + return "continuousBackupInfo." + error; + } + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify(message.secondaryConfig); + if (error) + return "secondaryConfig." + error; + } + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify(message.primaryConfig); + if (error) + return "primaryConfig." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.verify(message.pscConfig); + if (error) + return "pscConfig." + error; + } + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); + if (error) + return "maintenanceUpdatePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { + var error = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.verify(message.geminiConfig); + if (error) + return "geminiConfig." + error; + } + if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) + switch (message.subscriptionType) { + default: + return "subscriptionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify(message.trialMetadata); + if (error) + return "trialMetadata." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify(message.dataplexConfig); + if (error) + return "dataplexConfig." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); + } + if (object.migrationSource != null) { + if (typeof object.migrationSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.migrationSource: object expected"); + message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.fromObject(object.migrationSource); + } + if (object.cloudsqlBackupRunSource != null) { + if (typeof object.cloudsqlBackupRunSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.cloudsqlBackupRunSource: object expected"); + message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "EMPTY": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 7: + message.state = 7; + break; + case "MAINTENANCE": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.databaseVersion = 6; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.fromObject(object.networkConfig); + } + if (object.network != null) + message.network = String(object.network); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.initialUser: object expected"); + message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.fromObject(object.initialUser); + } + if (object.automatedBackupPolicy != null) { + if (typeof object.automatedBackupPolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.automatedBackupPolicy: object expected"); + message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.continuousBackupConfig != null) { + if (typeof object.continuousBackupConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupConfig: object expected"); + message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); + } + if (object.continuousBackupInfo != null) { + if (typeof object.continuousBackupInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupInfo: object expected"); + message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); + } + if (object.secondaryConfig != null) { + if (typeof object.secondaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.secondaryConfig: object expected"); + message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); + } + if (object.primaryConfig != null) { + if (typeof object.primaryConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.primaryConfig: object expected"); + message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.fromObject(object.primaryConfig); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.pscConfig != null) { + if (typeof object.pscConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.pscConfig: object expected"); + message.pscConfig = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.fromObject(object.pscConfig); + } + if (object.maintenanceUpdatePolicy != null) { + if (typeof object.maintenanceUpdatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.maintenanceUpdatePolicy: object expected"); + message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } + if (object.geminiConfig != null) { + if (typeof object.geminiConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.geminiConfig: object expected"); + message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.fromObject(object.geminiConfig); + } + switch (object.subscriptionType) { + default: + if (typeof object.subscriptionType === "number") { + message.subscriptionType = object.subscriptionType; + break; + } + break; + case "SUBSCRIPTION_TYPE_UNSPECIFIED": + case 0: + message.subscriptionType = 0; + break; + case "STANDARD": + case 1: + message.subscriptionType = 1; + break; + case "TRIAL": + case 2: + message.subscriptionType = 2; + break; + } + if (object.trialMetadata != null) { + if (typeof object.trialMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.trialMetadata: object expected"); + message.trialMetadata = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.fromObject(object.trialMetadata); + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.dataplexConfig != null) { + if (typeof object.dataplexConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.dataplexConfig: object expected"); + message.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.fromObject(object.dataplexConfig); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {google.cloud.alloydb.v1beta.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.network = ""; + object.etag = ""; + object.reconciling = false; + object.initialUser = null; + object.automatedBackupPolicy = null; + object.sslConfig = null; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.secondaryConfig = null; + object.primaryConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.continuousBackupConfig = null; + object.continuousBackupInfo = null; + object.networkConfig = null; + object.satisfiesPzs = false; + object.pscConfig = null; + object.maintenanceUpdatePolicy = null; + object.geminiConfig = null; + object.maintenanceSchedule = null; + object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; + object.trialMetadata = null; + object.serviceAccountEmail = ""; + object.dataplexConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] : message.state; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.toObject(message.initialUser, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { + object.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.toObject(message.migrationSource, options); + if (options.oneofs) + object.source = "migrationSource"; + } + if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) + object.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) + object.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); + if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) + object.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) + object.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); + if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) + object.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.toObject(message.networkConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) + object.pscConfig = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.toObject(message.pscConfig, options); + if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) + object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) + object.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.toObject(message.geminiConfig, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); + if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) + object.subscriptionType = options.enums === String ? $root.google.cloud.alloydb.v1beta.SubscriptionType[message.subscriptionType] === undefined ? message.subscriptionType : $root.google.cloud.alloydb.v1beta.SubscriptionType[message.subscriptionType] : message.subscriptionType; + if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) + object.trialMetadata = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.toObject(message.trialMetadata, options); + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { + object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); + if (options.oneofs) + object.source = "cloudsqlBackupRunSource"; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) + object.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster"; + }; + + Cluster.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.NetworkConfig"; + }; + + return NetworkConfig; + })(); + + Cluster.SecondaryConfig = (function() { + + /** + * Properties of a SecondaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface ISecondaryConfig + * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName + */ + + /** + * Constructs a new SecondaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a SecondaryConfig. + * @implements ISecondaryConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set + */ + function SecondaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecondaryConfig primaryClusterName. + * @member {string} primaryClusterName + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @instance + */ + SecondaryConfig.prototype.primaryClusterName = ""; + + /** + * Creates a new SecondaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig instance + */ + SecondaryConfig.create = function create(properties) { + return new SecondaryConfig(properties); + }; + + /** + * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); + return writer; + }; + + /** + * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.primaryClusterName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecondaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecondaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + if (!$util.isString(message.primaryClusterName)) + return "primaryClusterName: string expected"; + return null; + }; + + /** + * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig + */ + SecondaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); + if (object.primaryClusterName != null) + message.primaryClusterName = String(object.primaryClusterName); + return message; + }; + + /** + * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} message SecondaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecondaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.primaryClusterName = ""; + if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) + object.primaryClusterName = message.primaryClusterName; + return object; + }; + + /** + * Converts this SecondaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @instance + * @returns {Object.} JSON object + */ + SecondaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecondaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.SecondaryConfig"; + }; + + return SecondaryConfig; + })(); + + Cluster.PrimaryConfig = (function() { + + /** + * Properties of a PrimaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface IPrimaryConfig + * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames + */ + + /** + * Constructs a new PrimaryConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a PrimaryConfig. + * @implements IPrimaryConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set + */ + function PrimaryConfig(properties) { + this.secondaryClusterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryConfig secondaryClusterNames. + * @member {Array.} secondaryClusterNames + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @instance + */ + PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; + + /** + * Creates a new PrimaryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig instance + */ + PrimaryConfig.create = function create(properties) { + return new PrimaryConfig(properties); + }; + + /** + * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); + return writer; + }; + + /** + * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) + message.secondaryClusterNames = []; + message.secondaryClusterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { + if (!Array.isArray(message.secondaryClusterNames)) + return "secondaryClusterNames: array expected"; + for (var i = 0; i < message.secondaryClusterNames.length; ++i) + if (!$util.isString(message.secondaryClusterNames[i])) + return "secondaryClusterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig + */ + PrimaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); + if (object.secondaryClusterNames) { + if (!Array.isArray(object.secondaryClusterNames)) + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); + message.secondaryClusterNames = []; + for (var i = 0; i < object.secondaryClusterNames.length; ++i) + message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} message PrimaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryClusterNames = []; + if (message.secondaryClusterNames && message.secondaryClusterNames.length) { + object.secondaryClusterNames = []; + for (var j = 0; j < message.secondaryClusterNames.length; ++j) + object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; + } + return object; + }; + + /** + * Converts this PrimaryConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @instance + * @returns {Object.} JSON object + */ + PrimaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.PrimaryConfig"; + }; + + return PrimaryConfig; + })(); + + Cluster.PscConfig = (function() { + + /** + * Properties of a PscConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface IPscConfig + * @property {boolean|null} [pscEnabled] PscConfig pscEnabled + * @property {number|Long|null} [serviceOwnedProjectNumber] PscConfig serviceOwnedProjectNumber + */ + + /** + * Constructs a new PscConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a PscConfig. + * @implements IPscConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig=} [properties] Properties to set + */ + function PscConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscConfig pscEnabled. + * @member {boolean} pscEnabled + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @instance + */ + PscConfig.prototype.pscEnabled = false; + + /** + * PscConfig serviceOwnedProjectNumber. + * @member {number|Long} serviceOwnedProjectNumber + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @instance + */ + PscConfig.prototype.serviceOwnedProjectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PscConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig instance + */ + PscConfig.create = function create(properties) { + return new PscConfig(properties); + }; + + /** + * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig} message PscConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); + if (message.serviceOwnedProjectNumber != null && Object.hasOwnProperty.call(message, "serviceOwnedProjectNumber")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.serviceOwnedProjectNumber); + return writer; + }; + + /** + * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig} message PscConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.PscConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pscEnabled = reader.bool(); + break; + } + case 3: { + message.serviceOwnedProjectNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (typeof message.pscEnabled !== "boolean") + return "pscEnabled: boolean expected"; + if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) + if (!$util.isInteger(message.serviceOwnedProjectNumber) && !(message.serviceOwnedProjectNumber && $util.isInteger(message.serviceOwnedProjectNumber.low) && $util.isInteger(message.serviceOwnedProjectNumber.high))) + return "serviceOwnedProjectNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig + */ + PscConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.PscConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.PscConfig(); + if (object.pscEnabled != null) + message.pscEnabled = Boolean(object.pscEnabled); + if (object.serviceOwnedProjectNumber != null) + if ($util.Long) + (message.serviceOwnedProjectNumber = $util.Long.fromValue(object.serviceOwnedProjectNumber)).unsigned = false; + else if (typeof object.serviceOwnedProjectNumber === "string") + message.serviceOwnedProjectNumber = parseInt(object.serviceOwnedProjectNumber, 10); + else if (typeof object.serviceOwnedProjectNumber === "number") + message.serviceOwnedProjectNumber = object.serviceOwnedProjectNumber; + else if (typeof object.serviceOwnedProjectNumber === "object") + message.serviceOwnedProjectNumber = new $util.LongBits(object.serviceOwnedProjectNumber.low >>> 0, object.serviceOwnedProjectNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PscConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.PscConfig} message PscConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pscEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.serviceOwnedProjectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.serviceOwnedProjectNumber = options.longs === String ? "0" : 0; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) + if (typeof message.serviceOwnedProjectNumber === "number") + object.serviceOwnedProjectNumber = options.longs === String ? String(message.serviceOwnedProjectNumber) : message.serviceOwnedProjectNumber; + else + object.serviceOwnedProjectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.serviceOwnedProjectNumber) : options.longs === Number ? new $util.LongBits(message.serviceOwnedProjectNumber.low >>> 0, message.serviceOwnedProjectNumber.high >>> 0).toNumber() : message.serviceOwnedProjectNumber; + return object; + }; + + /** + * Converts this PscConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @instance + * @returns {Object.} JSON object + */ + PscConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.PscConfig"; + }; + + return PscConfig; + })(); + + Cluster.TrialMetadata = (function() { + + /** + * Properties of a TrialMetadata. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface ITrialMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] TrialMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TrialMetadata endTime + * @property {google.protobuf.ITimestamp|null} [upgradeTime] TrialMetadata upgradeTime + * @property {google.protobuf.ITimestamp|null} [graceEndTime] TrialMetadata graceEndTime + */ + + /** + * Constructs a new TrialMetadata. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a TrialMetadata. + * @implements ITrialMetadata + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata=} [properties] Properties to set + */ + function TrialMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.startTime = null; + + /** + * TrialMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.endTime = null; + + /** + * TrialMetadata upgradeTime. + * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.upgradeTime = null; + + /** + * TrialMetadata graceEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} graceEndTime + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @instance + */ + TrialMetadata.prototype.graceEndTime = null; + + /** + * Creates a new TrialMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata instance + */ + TrialMetadata.create = function create(properties) { + return new TrialMetadata(properties); + }; + + /** + * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) + $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.graceEndTime != null && Object.hasOwnProperty.call(message, "graceEndTime")) + $root.google.protobuf.Timestamp.encode(message.graceEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.graceEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); + if (error) + return "upgradeTime." + error; + } + if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.graceEndTime); + if (error) + return "graceEndTime." + error; + } + return null; + }; + + /** + * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata + */ + TrialMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.upgradeTime != null) { + if (typeof object.upgradeTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.upgradeTime: object expected"); + message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); + } + if (object.graceEndTime != null) { + if (typeof object.graceEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.graceEndTime: object expected"); + message.graceEndTime = $root.google.protobuf.Timestamp.fromObject(object.graceEndTime); + } + return message; + }; + + /** + * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} message TrialMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.upgradeTime = null; + object.graceEndTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) + object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); + if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) + object.graceEndTime = $root.google.protobuf.Timestamp.toObject(message.graceEndTime, options); + return object; + }; + + /** + * Converts this TrialMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @instance + * @returns {Object.} JSON object + */ + TrialMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.TrialMetadata"; + }; + + return TrialMetadata; + })(); + + Cluster.DataplexConfig = (function() { + + /** + * Properties of a DataplexConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface IDataplexConfig + * @property {boolean|null} [enabled] DataplexConfig enabled + */ + + /** + * Constructs a new DataplexConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a DataplexConfig. + * @implements IDataplexConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig=} [properties] Properties to set + */ + function DataplexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataplexConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @instance + */ + DataplexConfig.prototype.enabled = false; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig instance + */ + DataplexConfig.create = function create(properties) { + return new DataplexConfig(properties); + }; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataplexConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataplexConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig + */ + DataplexConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} message DataplexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataplexConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this DataplexConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @instance + * @returns {Object.} JSON object + */ + DataplexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataplexConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.DataplexConfig"; + }; + + return DataplexConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1beta.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} EMPTY=3 EMPTY value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value + * @property {number} MAINTENANCE=8 MAINTENANCE value + * @property {number} PROMOTING=9 PROMOTING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "EMPTY"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "BOOTSTRAPPING"] = 7; + values[valuesById[8] = "MAINTENANCE"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * ClusterType enum. + * @name google.cloud.alloydb.v1beta.Cluster.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} SECONDARY=2 SECONDARY value + */ + Cluster.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "SECONDARY"] = 2; + return values; + })(); + + return Cluster; + })(); + + v1beta.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.alloydb.v1beta + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {string|null} [uid] Instance uid + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {Object.|null} [labels] Instance labels + * @property {google.cloud.alloydb.v1beta.Instance.State|null} [state] Instance state + * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [instanceType] Instance instanceType + * @property {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig + * @property {google.cloud.alloydb.v1beta.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType + * @property {string|null} [gceZone] Instance gceZone + * @property {Object.|null} [databaseFlags] Instance databaseFlags + * @property {google.cloud.alloydb.v1beta.Instance.INode|null} [writableNode] Instance writableNode + * @property {Array.|null} [nodes] Instance nodes + * @property {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig + * @property {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null} [observabilityConfig] Instance observabilityConfig + * @property {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig + * @property {string|null} [ipAddress] Instance ipAddress + * @property {string|null} [publicIpAddress] Instance publicIpAddress + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy + * @property {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig + * @property {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig + * @property {google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null} [geminiConfig] Instance geminiConfig + * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses + * @property {google.cloud.alloydb.v1beta.Instance.ActivationPolicy|null} [activationPolicy] Instance activationPolicy + * @property {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null} [connectionPoolConfig] Instance connectionPoolConfig + * @property {google.cloud.alloydb.v1beta.IGCAInstanceConfig|null} [gcaConfig] Instance gcaConfig + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.databaseFlags = {}; + this.nodes = []; + this.annotations = {}; + this.outboundPublicIpAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance state. + * @member {google.cloud.alloydb.v1beta.Instance.State} state + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance instanceType. + * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.instanceType = 0; + + /** + * Instance machineConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.machineConfig = null; + + /** + * Instance availabilityType. + * @member {google.cloud.alloydb.v1beta.Instance.AvailabilityType} availabilityType + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.availabilityType = 0; + + /** + * Instance gceZone. + * @member {string} gceZone + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.gceZone = ""; + + /** + * Instance databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.databaseFlags = $util.emptyObject; + + /** + * Instance writableNode. + * @member {google.cloud.alloydb.v1beta.Instance.INode|null|undefined} writableNode + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.writableNode = null; + + /** + * Instance nodes. + * @member {Array.} nodes + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.nodes = $util.emptyArray; + + /** + * Instance queryInsightsConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.queryInsightsConfig = null; + + /** + * Instance observabilityConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null|undefined} observabilityConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.observabilityConfig = null; + + /** + * Instance readPoolConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null|undefined} readPoolConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.readPoolConfig = null; + + /** + * Instance ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.ipAddress = ""; + + /** + * Instance publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.publicIpAddress = ""; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.etag = ""; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance updatePolicy. + * @member {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null|undefined} updatePolicy + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.updatePolicy = null; + + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + + /** + * Instance satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = false; + + /** + * Instance pscInstanceConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null|undefined} pscInstanceConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.pscInstanceConfig = null; + + /** + * Instance networkConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.networkConfig = null; + + /** + * Instance geminiConfig. + * @member {google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null|undefined} geminiConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.geminiConfig = null; + + /** + * Instance outboundPublicIpAddresses. + * @member {Array.} outboundPublicIpAddresses + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; + + /** + * Instance activationPolicy. + * @member {google.cloud.alloydb.v1beta.Instance.ActivationPolicy} activationPolicy + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.activationPolicy = 0; + + /** + * Instance connectionPoolConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null|undefined} connectionPoolConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.connectionPoolConfig = null; + + /** + * Instance gcaConfig. + * @member {google.cloud.alloydb.v1beta.IGCAInstanceConfig|null|undefined} gcaConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.gcaConfig = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) + $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) + $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) + $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) + $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); + if (message.observabilityConfig != null && Object.hasOwnProperty.call(message, "observabilityConfig")) + $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.encode(message.observabilityConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.publicIpAddress); + if (message.pscInstanceConfig != null && Object.hasOwnProperty.call(message, "pscInstanceConfig")) + $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) + $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) + writer.uint32(/* id 35, wireType 0 =*/280).int32(message.activationPolicy); + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) + $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.gcaConfig != null && Object.hasOwnProperty.call(message, "gcaConfig")) + $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.encode(message.gcaConfig, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.instanceType = reader.int32(); + break; + } + case 10: { + message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.availabilityType = reader.int32(); + break; + } + case 12: { + message.gceZone = reader.string(); + break; + } + case 13: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.databaseFlags[key] = value; + break; + } + case 19: { + message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 26: { + message.observabilityConfig = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ipAddress = reader.string(); + break; + } + case 27: { + message.publicIpAddress = reader.string(); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 18: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 22: { + message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.decode(reader, reader.uint32()); + break; + } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } + case 24: { + message.satisfiesPzs = reader.bool(); + break; + } + case 28: { + message.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); + break; + } + case 33: { + message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 34: { + if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) + message.outboundPublicIpAddresses = []; + message.outboundPublicIpAddresses.push(reader.string()); + break; + } + case 35: { + message.activationPolicy = reader.int32(); + break; + } + case 37: { + message.connectionPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.decode(reader, reader.uint32()); + break; + } + case 38: { + message.gcaConfig = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.verify(message.machineConfig); + if (error) + return "machineConfig." + error; + } + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (!$util.isString(message.gceZone)) + return "gceZone: string expected"; + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.writableNode); + if (error) + return "writableNode." + error; + } + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); + if (error) + return "queryInsightsConfig." + error; + } + if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify(message.observabilityConfig); + if (error) + return "observabilityConfig." + error; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify(message.readPoolConfig); + if (error) + return "readPoolConfig." + error; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify(message.updatePolicy); + if (error) + return "updatePolicy." + error; + } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify(message.pscInstanceConfig); + if (error) + return "pscInstanceConfig." + error; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { + var error = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify(message.geminiConfig); + if (error) + return "geminiConfig." + error; + } + if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { + if (!Array.isArray(message.outboundPublicIpAddresses)) + return "outboundPublicIpAddresses: array expected"; + for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) + if (!$util.isString(message.outboundPublicIpAddresses[i])) + return "outboundPublicIpAddresses: string[] expected"; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + switch (message.activationPolicy) { + default: + return "activationPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify(message.connectionPoolConfig); + if (error) + return "connectionPoolConfig." + error; + } + if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) { + var error = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.verify(message.gcaConfig); + if (error) + return "gcaConfig." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "STOPPED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "MAINTENANCE": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "BOOTSTRAPPING": + case 8: + message.state = 8; + break; + case "PROMOTING": + case 9: + message.state = 9; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.fromObject(object.machineConfig); + } + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + if (object.gceZone != null) + message.gceZone = String(object.gceZone); + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.writableNode != null) { + if (typeof object.writableNode !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.writableNode: object expected"); + message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.writableNode); + } + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: object expected"); + message.nodes[i] = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.nodes[i]); + } + } + if (object.queryInsightsConfig != null) { + if (typeof object.queryInsightsConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.queryInsightsConfig: object expected"); + message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); + } + if (object.observabilityConfig != null) { + if (typeof object.observabilityConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.observabilityConfig: object expected"); + message.observabilityConfig = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.fromObject(object.observabilityConfig); + } + if (object.readPoolConfig != null) { + if (typeof object.readPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.readPoolConfig: object expected"); + message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); + } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.updatePolicy != null) { + if (typeof object.updatePolicy !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.updatePolicy: object expected"); + message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.fromObject(object.updatePolicy); + } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.pscInstanceConfig != null) { + if (typeof object.pscInstanceConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.pscInstanceConfig: object expected"); + message.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.fromObject(object.pscInstanceConfig); + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); + } + if (object.geminiConfig != null) { + if (typeof object.geminiConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.geminiConfig: object expected"); + message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.fromObject(object.geminiConfig); + } + if (object.outboundPublicIpAddresses) { + if (!Array.isArray(object.outboundPublicIpAddresses)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.outboundPublicIpAddresses: array expected"); + message.outboundPublicIpAddresses = []; + for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) + message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); + } + switch (object.activationPolicy) { + default: + if (typeof object.activationPolicy === "number") { + message.activationPolicy = object.activationPolicy; + break; + } + break; + case "ACTIVATION_POLICY_UNSPECIFIED": + case 0: + message.activationPolicy = 0; + break; + case "ALWAYS": + case 1: + message.activationPolicy = 1; + break; + case "NEVER": + case 2: + message.activationPolicy = 2; + break; + } + if (object.connectionPoolConfig != null) { + if (typeof object.connectionPoolConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.connectionPoolConfig: object expected"); + message.connectionPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.fromObject(object.connectionPoolConfig); + } + if (object.gcaConfig != null) { + if (typeof object.gcaConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.gcaConfig: object expected"); + message.gcaConfig = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.fromObject(object.gcaConfig); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {google.cloud.alloydb.v1beta.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nodes = []; + object.outboundPublicIpAddresses = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.databaseFlags = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.machineConfig = null; + object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.gceZone = ""; + object.readPoolConfig = null; + object.ipAddress = ""; + object.reconciling = false; + object.etag = ""; + object.writableNode = null; + object.queryInsightsConfig = null; + object.updatePolicy = null; + object.clientConnectionConfig = null; + object.satisfiesPzs = false; + object.observabilityConfig = null; + object.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = null; + object.geminiConfig = null; + object.activationPolicy = options.enums === String ? "ACTIVATION_POLICY_UNSPECIFIED" : 0; + object.connectionPoolConfig = null; + object.gcaConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Instance.State[message.state] : message.state; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] : message.instanceType; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.toObject(message.machineConfig, options); + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; + if (message.gceZone != null && message.hasOwnProperty("gceZone")) + object.gceZone = message.gceZone; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) + object.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.writableNode != null && message.hasOwnProperty("writableNode")) + object.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.writableNode, options); + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.nodes[j], options); + } + if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) + object.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) + object.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.toObject(message.updatePolicy, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) + object.observabilityConfig = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.toObject(message.observabilityConfig, options); + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) + object.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); + if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) + object.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.toObject(message.geminiConfig, options); + if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { + object.outboundPublicIpAddresses = []; + for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) + object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + object.activationPolicy = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.ActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.alloydb.v1beta.Instance.ActivationPolicy[message.activationPolicy] : message.activationPolicy; + if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) + object.connectionPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); + if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) + object.gcaConfig = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.toObject(message.gcaConfig, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance"; + }; + + Instance.MachineConfig = (function() { + + /** + * Properties of a MachineConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + * @property {string|null} [machineType] MachineConfig machineType + */ + + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; + + /** + * MachineConfig machineType. + * @member {string} machineType + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @instance + */ + MachineConfig.prototype.machineType = ""; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 4: { + message.machineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + return null; + }; + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig + */ + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.MachineConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.MachineConfig} message MachineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.machineType = ""; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; + + /** + * Converts this MachineConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @instance + * @returns {Object.} JSON object + */ + MachineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.MachineConfig"; + }; + + return MachineConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface INode + * @property {string|null} [zoneId] Node zoneId + * @property {string|null} [id] Node id + * @property {string|null} [ip] Node ip + * @property {string|null} [state] Node state + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node zoneId. + * @member {string} zoneId + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.zoneId = ""; + + /** + * Node id. + * @member {string} id + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.id = ""; + + /** + * Node ip. + * @member {string} ip + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.ip = ""; + + /** + * Node state. + * @member {string} state + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + */ + Node.prototype.state = ""; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zoneId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.ip = reader.string(); + break; + } + case 4: { + message.state = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.ip != null && message.hasOwnProperty("ip")) + if (!$util.isString(message.ip)) + return "ip: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.Node) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.id != null) + message.id = String(object.id); + if (object.ip != null) + message.ip = String(object.ip); + if (object.state != null) + message.state = String(object.state); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {google.cloud.alloydb.v1beta.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zoneId = ""; + object.id = ""; + object.ip = ""; + object.state = ""; + } + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.ip != null && message.hasOwnProperty("ip")) + object.ip = message.ip; + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.Node"; + }; + + return Node; + })(); + + Instance.QueryInsightsInstanceConfig = (function() { + + /** + * Properties of a QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IQueryInsightsInstanceConfig + * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags + * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress + * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength + * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute + */ + + /** + * Constructs a new QueryInsightsInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a QueryInsightsInstanceConfig. + * @implements IQueryInsightsInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + */ + function QueryInsightsInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInsightsInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; + + /** + * QueryInsightsInstanceConfig recordClientAddress. + * @member {boolean|null|undefined} recordClientAddress + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.recordClientAddress = null; + + /** + * QueryInsightsInstanceConfig queryStringLength. + * @member {number} queryStringLength + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryStringLength = 0; + + /** + * QueryInsightsInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInsightsInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance + */ + QueryInsightsInstanceConfig.create = function create(properties) { + return new QueryInsightsInstanceConfig(properties); + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); + return writer; + }; + + /** + * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.recordApplicationTags = reader.bool(); + break; + } + case 3: { + message.recordClientAddress = reader.bool(); + break; + } + case 4: { + message.queryStringLength = reader.uint32(); + break; + } + case 5: { + message.queryPlansPerMinute = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInsightsInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInsightsInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + properties._recordClientAddress = 1; + if (typeof message.recordClientAddress !== "boolean") + return "recordClientAddress: boolean expected"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + if (!$util.isInteger(message.queryStringLength)) + return "queryStringLength: integer expected"; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + return null; + }; + + /** + * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig + */ + QueryInsightsInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.recordClientAddress != null) + message.recordClientAddress = Boolean(object.recordClientAddress); + if (object.queryStringLength != null) + message.queryStringLength = object.queryStringLength >>> 0; + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; + return message; + }; + + /** + * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInsightsInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryStringLength = 0; + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { + object.recordClientAddress = message.recordClientAddress; + if (options.oneofs) + object._recordClientAddress = "recordClientAddress"; + } + if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) + object.queryStringLength = message.queryStringLength; + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + return object; + }; + + /** + * Converts this QueryInsightsInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInsightsInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig"; + }; + + return QueryInsightsInstanceConfig; + })(); + + Instance.ObservabilityInstanceConfig = (function() { + + /** + * Properties of an ObservabilityInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IObservabilityInstanceConfig + * @property {boolean|null} [enabled] ObservabilityInstanceConfig enabled + * @property {boolean|null} [preserveComments] ObservabilityInstanceConfig preserveComments + * @property {boolean|null} [trackWaitEvents] ObservabilityInstanceConfig trackWaitEvents + * @property {boolean|null} [trackWaitEventTypes] ObservabilityInstanceConfig trackWaitEventTypes + * @property {number|null} [maxQueryStringLength] ObservabilityInstanceConfig maxQueryStringLength + * @property {boolean|null} [recordApplicationTags] ObservabilityInstanceConfig recordApplicationTags + * @property {number|null} [queryPlansPerMinute] ObservabilityInstanceConfig queryPlansPerMinute + * @property {boolean|null} [trackActiveQueries] ObservabilityInstanceConfig trackActiveQueries + * @property {boolean|null} [trackClientAddress] ObservabilityInstanceConfig trackClientAddress + * @property {boolean|null} [assistiveExperiencesEnabled] ObservabilityInstanceConfig assistiveExperiencesEnabled + */ + + /** + * Constructs a new ObservabilityInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents an ObservabilityInstanceConfig. + * @implements IObservabilityInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig=} [properties] Properties to set + */ + function ObservabilityInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObservabilityInstanceConfig enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.enabled = null; + + /** + * ObservabilityInstanceConfig preserveComments. + * @member {boolean|null|undefined} preserveComments + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.preserveComments = null; + + /** + * ObservabilityInstanceConfig trackWaitEvents. + * @member {boolean|null|undefined} trackWaitEvents + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackWaitEvents = null; + + /** + * ObservabilityInstanceConfig trackWaitEventTypes. + * @member {boolean|null|undefined} trackWaitEventTypes + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackWaitEventTypes = null; + + /** + * ObservabilityInstanceConfig maxQueryStringLength. + * @member {number|null|undefined} maxQueryStringLength + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.maxQueryStringLength = null; + + /** + * ObservabilityInstanceConfig recordApplicationTags. + * @member {boolean|null|undefined} recordApplicationTags + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.recordApplicationTags = null; + + /** + * ObservabilityInstanceConfig queryPlansPerMinute. + * @member {number|null|undefined} queryPlansPerMinute + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.queryPlansPerMinute = null; + + /** + * ObservabilityInstanceConfig trackActiveQueries. + * @member {boolean|null|undefined} trackActiveQueries + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackActiveQueries = null; + + /** + * ObservabilityInstanceConfig trackClientAddress. + * @member {boolean|null|undefined} trackClientAddress + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.trackClientAddress = null; + + /** + * ObservabilityInstanceConfig assistiveExperiencesEnabled. + * @member {boolean|null|undefined} assistiveExperiencesEnabled + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + */ + ObservabilityInstanceConfig.prototype.assistiveExperiencesEnabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_preserveComments", { + get: $util.oneOfGetter($oneOfFields = ["preserveComments"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEvents", { + get: $util.oneOfGetter($oneOfFields = ["trackWaitEvents"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEventTypes", { + get: $util.oneOfGetter($oneOfFields = ["trackWaitEventTypes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_maxQueryStringLength", { + get: $util.oneOfGetter($oneOfFields = ["maxQueryStringLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_queryPlansPerMinute", { + get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackActiveQueries", { + get: $util.oneOfGetter($oneOfFields = ["trackActiveQueries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["trackClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ObservabilityInstanceConfig.prototype, "_assistiveExperiencesEnabled", { + get: $util.oneOfGetter($oneOfFields = ["assistiveExperiencesEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObservabilityInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig instance + */ + ObservabilityInstanceConfig.create = function create(properties) { + return new ObservabilityInstanceConfig(properties); + }; + + /** + * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservabilityInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.preserveComments != null && Object.hasOwnProperty.call(message, "preserveComments")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.preserveComments); + if (message.trackWaitEvents != null && Object.hasOwnProperty.call(message, "trackWaitEvents")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trackWaitEvents); + if (message.trackWaitEventTypes != null && Object.hasOwnProperty.call(message, "trackWaitEventTypes")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.trackWaitEventTypes); + if (message.maxQueryStringLength != null && Object.hasOwnProperty.call(message, "maxQueryStringLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxQueryStringLength); + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recordApplicationTags); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryPlansPerMinute); + if (message.trackActiveQueries != null && Object.hasOwnProperty.call(message, "trackActiveQueries")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.trackActiveQueries); + if (message.trackClientAddress != null && Object.hasOwnProperty.call(message, "trackClientAddress")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trackClientAddress); + if (message.assistiveExperiencesEnabled != null && Object.hasOwnProperty.call(message, "assistiveExperiencesEnabled")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.assistiveExperiencesEnabled); + return writer; + }; + + /** + * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservabilityInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservabilityInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.preserveComments = reader.bool(); + break; + } + case 3: { + message.trackWaitEvents = reader.bool(); + break; + } + case 4: { + message.trackWaitEventTypes = reader.bool(); + break; + } + case 5: { + message.maxQueryStringLength = reader.int32(); + break; + } + case 6: { + message.recordApplicationTags = reader.bool(); + break; + } + case 7: { + message.queryPlansPerMinute = reader.int32(); + break; + } + case 8: { + message.trackActiveQueries = reader.bool(); + break; + } + case 9: { + message.trackClientAddress = reader.bool(); + break; + } + case 10: { + message.assistiveExperiencesEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservabilityInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObservabilityInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObservabilityInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { + properties._preserveComments = 1; + if (typeof message.preserveComments !== "boolean") + return "preserveComments: boolean expected"; + } + if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { + properties._trackWaitEvents = 1; + if (typeof message.trackWaitEvents !== "boolean") + return "trackWaitEvents: boolean expected"; + } + if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { + properties._trackWaitEventTypes = 1; + if (typeof message.trackWaitEventTypes !== "boolean") + return "trackWaitEventTypes: boolean expected"; + } + if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { + properties._maxQueryStringLength = 1; + if (!$util.isInteger(message.maxQueryStringLength)) + return "maxQueryStringLength: integer expected"; + } + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + properties._recordApplicationTags = 1; + if (typeof message.recordApplicationTags !== "boolean") + return "recordApplicationTags: boolean expected"; + } + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + properties._queryPlansPerMinute = 1; + if (!$util.isInteger(message.queryPlansPerMinute)) + return "queryPlansPerMinute: integer expected"; + } + if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { + properties._trackActiveQueries = 1; + if (typeof message.trackActiveQueries !== "boolean") + return "trackActiveQueries: boolean expected"; + } + if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { + properties._trackClientAddress = 1; + if (typeof message.trackClientAddress !== "boolean") + return "trackClientAddress: boolean expected"; + } + if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { + properties._assistiveExperiencesEnabled = 1; + if (typeof message.assistiveExperiencesEnabled !== "boolean") + return "assistiveExperiencesEnabled: boolean expected"; + } + return null; + }; + + /** + * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig + */ + ObservabilityInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.preserveComments != null) + message.preserveComments = Boolean(object.preserveComments); + if (object.trackWaitEvents != null) + message.trackWaitEvents = Boolean(object.trackWaitEvents); + if (object.trackWaitEventTypes != null) + message.trackWaitEventTypes = Boolean(object.trackWaitEventTypes); + if (object.maxQueryStringLength != null) + message.maxQueryStringLength = object.maxQueryStringLength | 0; + if (object.recordApplicationTags != null) + message.recordApplicationTags = Boolean(object.recordApplicationTags); + if (object.queryPlansPerMinute != null) + message.queryPlansPerMinute = object.queryPlansPerMinute | 0; + if (object.trackActiveQueries != null) + message.trackActiveQueries = Boolean(object.trackActiveQueries); + if (object.trackClientAddress != null) + message.trackClientAddress = Boolean(object.trackClientAddress); + if (object.assistiveExperiencesEnabled != null) + message.assistiveExperiencesEnabled = Boolean(object.assistiveExperiencesEnabled); + return message; + }; + + /** + * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} message ObservabilityInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObservabilityInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { + object.preserveComments = message.preserveComments; + if (options.oneofs) + object._preserveComments = "preserveComments"; + } + if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { + object.trackWaitEvents = message.trackWaitEvents; + if (options.oneofs) + object._trackWaitEvents = "trackWaitEvents"; + } + if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { + object.trackWaitEventTypes = message.trackWaitEventTypes; + if (options.oneofs) + object._trackWaitEventTypes = "trackWaitEventTypes"; + } + if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { + object.maxQueryStringLength = message.maxQueryStringLength; + if (options.oneofs) + object._maxQueryStringLength = "maxQueryStringLength"; + } + if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { + object.recordApplicationTags = message.recordApplicationTags; + if (options.oneofs) + object._recordApplicationTags = "recordApplicationTags"; + } + if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + object.queryPlansPerMinute = message.queryPlansPerMinute; + if (options.oneofs) + object._queryPlansPerMinute = "queryPlansPerMinute"; + } + if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { + object.trackActiveQueries = message.trackActiveQueries; + if (options.oneofs) + object._trackActiveQueries = "trackActiveQueries"; + } + if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { + object.trackClientAddress = message.trackClientAddress; + if (options.oneofs) + object._trackClientAddress = "trackClientAddress"; + } + if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { + object.assistiveExperiencesEnabled = message.assistiveExperiencesEnabled; + if (options.oneofs) + object._assistiveExperiencesEnabled = "assistiveExperiencesEnabled"; + } + return object; + }; + + /** + * Converts this ObservabilityInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ObservabilityInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObservabilityInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObservabilityInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig"; + }; + + return ObservabilityInstanceConfig; + })(); + + Instance.ReadPoolConfig = (function() { + + /** + * Properties of a ReadPoolConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IReadPoolConfig + * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + */ + + /** + * Constructs a new ReadPoolConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a ReadPoolConfig. + * @implements IReadPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set + */ + function ReadPoolConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadPoolConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @instance + */ + ReadPoolConfig.prototype.nodeCount = 0; + + /** + * Creates a new ReadPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig instance + */ + ReadPoolConfig.create = function create(properties) { + return new ReadPoolConfig(properties); + }; + + /** + * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + return null; + }; + + /** + * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig + */ + ReadPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} message ReadPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeCount = 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + return object; + }; + + /** + * Converts this ReadPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ReadPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ReadPoolConfig"; + }; + + return ReadPoolConfig; + })(); + + Instance.UpdatePolicy = (function() { + + /** + * Properties of an UpdatePolicy. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IUpdatePolicy + * @property {google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|null} [mode] UpdatePolicy mode + */ + + /** + * Constructs a new UpdatePolicy. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents an UpdatePolicy. + * @implements IUpdatePolicy + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy=} [properties] Properties to set + */ + function UpdatePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePolicy mode. + * @member {google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode} mode + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @instance + */ + UpdatePolicy.prototype.mode = 0; + + /** + * Creates a new UpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy instance + */ + UpdatePolicy.create = function create(properties) { + return new UpdatePolicy(properties); + }; + + /** + * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePolicy message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy + */ + UpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DEFAULT": + case 1: + message.mode = 1; + break; + case "FORCE_APPLY": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} message UpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this UpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + UpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePolicy + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.UpdatePolicy"; + }; + + /** + * Mode enum. + * @name google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} FORCE_APPLY=2 FORCE_APPLY value + */ + UpdatePolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "FORCE_APPLY"] = 2; + return values; + })(); + + return UpdatePolicy; + })(); + + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + + Instance.PscInterfaceConfig = (function() { + + /** + * Properties of a PscInterfaceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IPscInterfaceConfig + * @property {string|null} [networkAttachmentResource] PscInterfaceConfig networkAttachmentResource + */ + + /** + * Constructs a new PscInterfaceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a PscInterfaceConfig. + * @implements IPscInterfaceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig=} [properties] Properties to set + */ + function PscInterfaceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscInterfaceConfig networkAttachmentResource. + * @member {string} networkAttachmentResource + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.networkAttachmentResource = ""; + + /** + * Creates a new PscInterfaceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig instance + */ + PscInterfaceConfig.create = function create(properties) { + return new PscInterfaceConfig(properties); + }; + + /** + * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInterfaceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkAttachmentResource != null && Object.hasOwnProperty.call(message, "networkAttachmentResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkAttachmentResource); + return writer; + }; + + /** + * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInterfaceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInterfaceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.networkAttachmentResource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInterfaceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscInterfaceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscInterfaceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) + if (!$util.isString(message.networkAttachmentResource)) + return "networkAttachmentResource: string expected"; + return null; + }; + + /** + * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig + */ + PscInterfaceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig(); + if (object.networkAttachmentResource != null) + message.networkAttachmentResource = String(object.networkAttachmentResource); + return message; + }; + + /** + * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} message PscInterfaceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscInterfaceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.networkAttachmentResource = ""; + if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) + object.networkAttachmentResource = message.networkAttachmentResource; + return object; + }; + + /** + * Converts this PscInterfaceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @instance + * @returns {Object.} JSON object + */ + PscInterfaceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscInterfaceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscInterfaceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig"; + }; + + return PscInterfaceConfig; + })(); + + Instance.PscAutoConnectionConfig = (function() { + + /** + * Properties of a PscAutoConnectionConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IPscAutoConnectionConfig + * @property {string|null} [consumerProject] PscAutoConnectionConfig consumerProject + * @property {string|null} [consumerNetwork] PscAutoConnectionConfig consumerNetwork + * @property {string|null} [ipAddress] PscAutoConnectionConfig ipAddress + * @property {string|null} [status] PscAutoConnectionConfig status + * @property {string|null} [consumerNetworkStatus] PscAutoConnectionConfig consumerNetworkStatus + */ + + /** + * Constructs a new PscAutoConnectionConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a PscAutoConnectionConfig. + * @implements IPscAutoConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig=} [properties] Properties to set + */ + function PscAutoConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscAutoConnectionConfig consumerProject. + * @member {string} consumerProject + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerProject = ""; + + /** + * PscAutoConnectionConfig consumerNetwork. + * @member {string} consumerNetwork + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerNetwork = ""; + + /** + * PscAutoConnectionConfig ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.ipAddress = ""; + + /** + * PscAutoConnectionConfig status. + * @member {string} status + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.status = ""; + + /** + * PscAutoConnectionConfig consumerNetworkStatus. + * @member {string} consumerNetworkStatus + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @instance + */ + PscAutoConnectionConfig.prototype.consumerNetworkStatus = ""; + + /** + * Creates a new PscAutoConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig instance + */ + PscAutoConnectionConfig.create = function create(properties) { + return new PscAutoConnectionConfig(properties); + }; + + /** + * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscAutoConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNetwork); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.consumerNetworkStatus); + return writer; + }; + + /** + * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscAutoConnectionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consumerProject = reader.string(); + break; + } + case 2: { + message.consumerNetwork = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + case 4: { + message.status = reader.string(); + break; + } + case 5: { + message.consumerNetworkStatus = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscAutoConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscAutoConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscAutoConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (!$util.isString(message.consumerProject)) + return "consumerProject: string expected"; + if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (!$util.isString(message.consumerNetwork)) + return "consumerNetwork: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) + if (!$util.isString(message.consumerNetworkStatus)) + return "consumerNetworkStatus: string expected"; + return null; + }; + + /** + * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig + */ + PscAutoConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig(); + if (object.consumerProject != null) + message.consumerProject = String(object.consumerProject); + if (object.consumerNetwork != null) + message.consumerNetwork = String(object.consumerNetwork); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.status != null) + message.status = String(object.status); + if (object.consumerNetworkStatus != null) + message.consumerNetworkStatus = String(object.consumerNetworkStatus); + return message; + }; + + /** + * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} message PscAutoConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscAutoConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.consumerProject = ""; + object.consumerNetwork = ""; + object.ipAddress = ""; + object.status = ""; + object.consumerNetworkStatus = ""; + } + if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + object.consumerProject = message.consumerProject; + if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + object.consumerNetwork = message.consumerNetwork; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) + object.consumerNetworkStatus = message.consumerNetworkStatus; + return object; + }; + + /** + * Converts this PscAutoConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + PscAutoConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscAutoConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscAutoConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig"; + }; + + return PscAutoConnectionConfig; + })(); + + Instance.PscInstanceConfig = (function() { + + /** + * Properties of a PscInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IPscInstanceConfig + * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink + * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects + * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName + * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs + * @property {Array.|null} [pscAutoConnections] PscInstanceConfig pscAutoConnections + */ + + /** + * Constructs a new PscInstanceConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a PscInstanceConfig. + * @implements IPscInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig=} [properties] Properties to set + */ + function PscInstanceConfig(properties) { + this.allowedConsumerProjects = []; + this.pscInterfaceConfigs = []; + this.pscAutoConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PscInstanceConfig serviceAttachmentLink. + * @member {string} serviceAttachmentLink + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.serviceAttachmentLink = ""; + + /** + * PscInstanceConfig allowedConsumerProjects. + * @member {Array.} allowedConsumerProjects + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.allowedConsumerProjects = $util.emptyArray; + + /** + * PscInstanceConfig pscDnsName. + * @member {string} pscDnsName + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscDnsName = ""; + + /** + * PscInstanceConfig pscInterfaceConfigs. + * @member {Array.} pscInterfaceConfigs + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; + + /** + * PscInstanceConfig pscAutoConnections. + * @member {Array.} pscAutoConnections + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscAutoConnections = $util.emptyArray; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig instance + */ + PscInstanceConfig.create = function create(properties) { + return new PscInstanceConfig(properties); + }; + + /** + * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAttachmentLink != null && Object.hasOwnProperty.call(message, "serviceAttachmentLink")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachmentLink); + if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) + for (var i = 0; i < message.allowedConsumerProjects.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); + if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscDnsName); + if (message.pscInterfaceConfigs != null && message.pscInterfaceConfigs.length) + for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.encode(message.pscInterfaceConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.pscAutoConnections != null && message.pscAutoConnections.length) + for (var i = 0; i < message.pscAutoConnections.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.serviceAttachmentLink = reader.string(); + break; + } + case 2: { + if (!(message.allowedConsumerProjects && message.allowedConsumerProjects.length)) + message.allowedConsumerProjects = []; + message.allowedConsumerProjects.push(reader.string()); + break; + } + case 7: { + message.pscDnsName = reader.string(); + break; + } + case 8: { + if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) + message.pscInterfaceConfigs = []; + message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.pscAutoConnections && message.pscAutoConnections.length)) + message.pscAutoConnections = []; + message.pscAutoConnections.push($root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PscInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PscInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) + if (!$util.isString(message.serviceAttachmentLink)) + return "serviceAttachmentLink: string expected"; + if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { + if (!Array.isArray(message.allowedConsumerProjects)) + return "allowedConsumerProjects: array expected"; + for (var i = 0; i < message.allowedConsumerProjects.length; ++i) + if (!$util.isString(message.allowedConsumerProjects[i])) + return "allowedConsumerProjects: string[] expected"; + } + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + if (!$util.isString(message.pscDnsName)) + return "pscDnsName: string expected"; + if (message.pscInterfaceConfigs != null && message.hasOwnProperty("pscInterfaceConfigs")) { + if (!Array.isArray(message.pscInterfaceConfigs)) + return "pscInterfaceConfigs: array expected"; + for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify(message.pscInterfaceConfigs[i]); + if (error) + return "pscInterfaceConfigs." + error; + } + } + if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (!Array.isArray(message.pscAutoConnections)) + return "pscAutoConnections: array expected"; + for (var i = 0; i < message.pscAutoConnections.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify(message.pscAutoConnections[i]); + if (error) + return "pscAutoConnections." + error; + } + } + return null; + }; + + /** + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig + */ + PscInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig(); + if (object.serviceAttachmentLink != null) + message.serviceAttachmentLink = String(object.serviceAttachmentLink); + if (object.allowedConsumerProjects) { + if (!Array.isArray(object.allowedConsumerProjects)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.allowedConsumerProjects: array expected"); + message.allowedConsumerProjects = []; + for (var i = 0; i < object.allowedConsumerProjects.length; ++i) + message.allowedConsumerProjects[i] = String(object.allowedConsumerProjects[i]); + } + if (object.pscDnsName != null) + message.pscDnsName = String(object.pscDnsName); + if (object.pscInterfaceConfigs) { + if (!Array.isArray(object.pscInterfaceConfigs)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscInterfaceConfigs: array expected"); + message.pscInterfaceConfigs = []; + for (var i = 0; i < object.pscInterfaceConfigs.length; ++i) { + if (typeof object.pscInterfaceConfigs[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscInterfaceConfigs: object expected"); + message.pscInterfaceConfigs[i] = $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.fromObject(object.pscInterfaceConfigs[i]); + } + } + if (object.pscAutoConnections) { + if (!Array.isArray(object.pscAutoConnections)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscAutoConnections: array expected"); + message.pscAutoConnections = []; + for (var i = 0; i < object.pscAutoConnections.length; ++i) { + if (typeof object.pscAutoConnections[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscAutoConnections: object expected"); + message.pscAutoConnections[i] = $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} message PscInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PscInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedConsumerProjects = []; + object.pscInterfaceConfigs = []; + object.pscAutoConnections = []; + } + if (options.defaults) { + object.serviceAttachmentLink = ""; + object.pscDnsName = ""; + } + if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) + object.serviceAttachmentLink = message.serviceAttachmentLink; + if (message.allowedConsumerProjects && message.allowedConsumerProjects.length) { + object.allowedConsumerProjects = []; + for (var j = 0; j < message.allowedConsumerProjects.length; ++j) + object.allowedConsumerProjects[j] = message.allowedConsumerProjects[j]; + } + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + object.pscDnsName = message.pscDnsName; + if (message.pscInterfaceConfigs && message.pscInterfaceConfigs.length) { + object.pscInterfaceConfigs = []; + for (var j = 0; j < message.pscInterfaceConfigs.length; ++j) + object.pscInterfaceConfigs[j] = $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.toObject(message.pscInterfaceConfigs[j], options); + } + if (message.pscAutoConnections && message.pscAutoConnections.length) { + object.pscAutoConnections = []; + for (var j = 0; j < message.pscAutoConnections.length; ++j) + object.pscAutoConnections[j] = $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + } + return object; + }; + + /** + * Converts this PscInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + PscInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PscInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.PscInstanceConfig"; + }; + + return PscInstanceConfig; + })(); + + Instance.InstanceNetworkConfig = (function() { + + /** + * Properties of an InstanceNetworkConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IInstanceNetworkConfig + * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks + * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp + * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp + * @property {string|null} [network] InstanceNetworkConfig network + * @property {string|null} [allocatedIpRangeOverride] InstanceNetworkConfig allocatedIpRangeOverride + */ + + /** + * Constructs a new InstanceNetworkConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents an InstanceNetworkConfig. + * @implements IInstanceNetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig=} [properties] Properties to set + */ + function InstanceNetworkConfig(properties) { + this.authorizedExternalNetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceNetworkConfig authorizedExternalNetworks. + * @member {Array.} authorizedExternalNetworks + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; + + /** + * InstanceNetworkConfig enablePublicIp. + * @member {boolean} enablePublicIp + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enablePublicIp = false; + + /** + * InstanceNetworkConfig enableOutboundPublicIp. + * @member {boolean} enableOutboundPublicIp + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; + + /** + * InstanceNetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.network = ""; + + /** + * InstanceNetworkConfig allocatedIpRangeOverride. + * @member {string} allocatedIpRangeOverride + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.allocatedIpRangeOverride = ""; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance + */ + InstanceNetworkConfig.create = function create(properties) { + return new InstanceNetworkConfig(properties); + }; + + /** + * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceNetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizedExternalNetworks != null && message.authorizedExternalNetworks.length) + for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); + if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); + if (message.allocatedIpRangeOverride != null && Object.hasOwnProperty.call(message, "allocatedIpRangeOverride")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRangeOverride); + return writer; + }; + + /** + * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceNetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.authorizedExternalNetworks && message.authorizedExternalNetworks.length)) + message.authorizedExternalNetworks = []; + message.authorizedExternalNetworks.push($root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.decode(reader, reader.uint32())); + break; + } + case 2: { + message.enablePublicIp = reader.bool(); + break; + } + case 3: { + message.enableOutboundPublicIp = reader.bool(); + break; + } + case 4: { + message.network = reader.string(); + break; + } + case 5: { + message.allocatedIpRangeOverride = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceNetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceNetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authorizedExternalNetworks != null && message.hasOwnProperty("authorizedExternalNetworks")) { + if (!Array.isArray(message.authorizedExternalNetworks)) + return "authorizedExternalNetworks: array expected"; + for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify(message.authorizedExternalNetworks[i]); + if (error) + return "authorizedExternalNetworks." + error; + } + } + if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) + if (typeof message.enablePublicIp !== "boolean") + return "enablePublicIp: boolean expected"; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + if (typeof message.enableOutboundPublicIp !== "boolean") + return "enableOutboundPublicIp: boolean expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) + if (!$util.isString(message.allocatedIpRangeOverride)) + return "allocatedIpRangeOverride: string expected"; + return null; + }; + + /** + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig + */ + InstanceNetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig(); + if (object.authorizedExternalNetworks) { + if (!Array.isArray(object.authorizedExternalNetworks)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.authorizedExternalNetworks: array expected"); + message.authorizedExternalNetworks = []; + for (var i = 0; i < object.authorizedExternalNetworks.length; ++i) { + if (typeof object.authorizedExternalNetworks[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.authorizedExternalNetworks: object expected"); + message.authorizedExternalNetworks[i] = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.fromObject(object.authorizedExternalNetworks[i]); + } + } + if (object.enablePublicIp != null) + message.enablePublicIp = Boolean(object.enablePublicIp); + if (object.enableOutboundPublicIp != null) + message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRangeOverride != null) + message.allocatedIpRangeOverride = String(object.allocatedIpRangeOverride); + return message; + }; + + /** + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} message InstanceNetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceNetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedExternalNetworks = []; + if (options.defaults) { + object.enablePublicIp = false; + object.enableOutboundPublicIp = false; + object.network = ""; + object.allocatedIpRangeOverride = ""; + } + if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { + object.authorizedExternalNetworks = []; + for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) + object.authorizedExternalNetworks[j] = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.toObject(message.authorizedExternalNetworks[j], options); + } + if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) + object.enablePublicIp = message.enablePublicIp; + if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) + object.enableOutboundPublicIp = message.enableOutboundPublicIp; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) + object.allocatedIpRangeOverride = message.allocatedIpRangeOverride; + return object; + }; + + /** + * Converts this InstanceNetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceNetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceNetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceNetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig"; + }; + + InstanceNetworkConfig.AuthorizedNetwork = (function() { + + /** + * Properties of an AuthorizedNetwork. + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @interface IAuthorizedNetwork + * @property {string|null} [cidrRange] AuthorizedNetwork cidrRange + */ + + /** + * Constructs a new AuthorizedNetwork. + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig + * @classdesc Represents an AuthorizedNetwork. + * @implements IAuthorizedNetwork + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set + */ + function AuthorizedNetwork(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizedNetwork cidrRange. + * @member {string} cidrRange + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @instance + */ + AuthorizedNetwork.prototype.cidrRange = ""; + + /** + * Creates a new AuthorizedNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork instance + */ + AuthorizedNetwork.create = function create(properties) { + return new AuthorizedNetwork(properties); + }; + + /** + * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedNetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cidrRange != null && Object.hasOwnProperty.call(message, "cidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cidrRange); + return writer; + }; + + /** + * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizedNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedNetwork.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cidrRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizedNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizedNetwork message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizedNetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) + if (!$util.isString(message.cidrRange)) + return "cidrRange: string expected"; + return null; + }; + + /** + * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork + */ + AuthorizedNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork(); + if (object.cidrRange != null) + message.cidrRange = String(object.cidrRange); + return message; + }; + + /** + * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} message AuthorizedNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizedNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cidrRange = ""; + if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) + object.cidrRange = message.cidrRange; + return object; + }; + + /** + * Converts this AuthorizedNetwork to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @instance + * @returns {Object.} JSON object + */ + AuthorizedNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizedNetwork + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizedNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork"; + }; + + return AuthorizedNetwork; + })(); + + return InstanceNetworkConfig; + })(); + + Instance.ConnectionPoolConfig = (function() { + + /** + * Properties of a ConnectionPoolConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IConnectionPoolConfig + * @property {boolean|null} [enabled] ConnectionPoolConfig enabled + * @property {Object.|null} [flags] ConnectionPoolConfig flags + * @property {number|null} [poolerCount] ConnectionPoolConfig poolerCount + */ + + /** + * Constructs a new ConnectionPoolConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a ConnectionPoolConfig. + * @implements IConnectionPoolConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig=} [properties] Properties to set + */ + function ConnectionPoolConfig(properties) { + this.flags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionPoolConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.enabled = false; + + /** + * ConnectionPoolConfig flags. + * @member {Object.} flags + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.flags = $util.emptyObject; + + /** + * ConnectionPoolConfig poolerCount. + * @member {number} poolerCount + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @instance + */ + ConnectionPoolConfig.prototype.poolerCount = 0; + + /** + * Creates a new ConnectionPoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig instance + */ + ConnectionPoolConfig.create = function create(properties) { + return new ConnectionPoolConfig(properties); + }; + + /** + * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enabled); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + for (var keys = Object.keys(message.flags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.flags[keys[i]]).ldelim(); + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.poolerCount); + return writer; + }; + + /** + * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 12: { + message.enabled = reader.bool(); + break; + } + case 13: { + if (message.flags === $util.emptyObject) + message.flags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.flags[key] = value; + break; + } + case 14: { + message.poolerCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionPoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionPoolConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionPoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isObject(message.flags)) + return "flags: object expected"; + var key = Object.keys(message.flags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.flags[key[i]])) + return "flags: string{k:string} expected"; + } + if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) + if (!$util.isInteger(message.poolerCount)) + return "poolerCount: integer expected"; + return null; + }; + + /** + * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig + */ + ConnectionPoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.flags) { + if (typeof object.flags !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.flags: object expected"); + message.flags = {}; + for (var keys = Object.keys(object.flags), i = 0; i < keys.length; ++i) + message.flags[keys[i]] = String(object.flags[keys[i]]); + } + if (object.poolerCount != null) + message.poolerCount = object.poolerCount | 0; + return message; + }; + + /** + * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} message ConnectionPoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionPoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.flags = {}; + if (options.defaults) { + object.enabled = false; + object.poolerCount = 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + var keys2; + if (message.flags && (keys2 = Object.keys(message.flags)).length) { + object.flags = {}; + for (var j = 0; j < keys2.length; ++j) + object.flags[keys2[j]] = message.flags[keys2[j]]; + } + if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) + object.poolerCount = message.poolerCount; + return object; + }; + + /** + * Converts this ConnectionPoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @instance + * @returns {Object.} JSON object + */ + ConnectionPoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionPoolConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig"; + }; + + return ConnectionPoolConfig; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1beta.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} STOPPED=2 STOPPED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} MAINTENANCE=5 MAINTENANCE value + * @property {number} FAILED=6 FAILED value + * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value + * @property {number} PROMOTING=9 PROMOTING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "STOPPED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "MAINTENANCE"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[8] = "BOOTSTRAPPING"] = 8; + values[valuesById[9] = "PROMOTING"] = 9; + return values; + })(); + + /** + * InstanceType enum. + * @name google.cloud.alloydb.v1beta.Instance.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} READ_POOL=2 READ_POOL value + * @property {number} SECONDARY=3 SECONDARY value + */ + Instance.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "READ_POOL"] = 2; + values[valuesById[3] = "SECONDARY"] = 3; + return values; + })(); + + /** + * AvailabilityType enum. + * @name google.cloud.alloydb.v1beta.Instance.AvailabilityType + * @enum {number} + * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + Instance.AvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + /** + * ActivationPolicy enum. + * @name google.cloud.alloydb.v1beta.Instance.ActivationPolicy + * @enum {number} + * @property {number} ACTIVATION_POLICY_UNSPECIFIED=0 ACTIVATION_POLICY_UNSPECIFIED value + * @property {number} ALWAYS=1 ALWAYS value + * @property {number} NEVER=2 NEVER value + */ + Instance.ActivationPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTIVATION_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALWAYS"] = 1; + values[valuesById[2] = "NEVER"] = 2; + return values; + })(); + + return Instance; + })(); + + v1beta.ConnectionInfo = (function() { + + /** + * Properties of a ConnectionInfo. + * @memberof google.cloud.alloydb.v1beta + * @interface IConnectionInfo + * @property {string|null} [name] ConnectionInfo name + * @property {string|null} [ipAddress] ConnectionInfo ipAddress + * @property {string|null} [publicIpAddress] ConnectionInfo publicIpAddress + * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain + * @property {string|null} [instanceUid] ConnectionInfo instanceUid + * @property {string|null} [pscDnsName] ConnectionInfo pscDnsName + */ + + /** + * Constructs a new ConnectionInfo. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ConnectionInfo. + * @implements IConnectionInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set + */ + function ConnectionInfo(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionInfo name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.name = ""; + + /** + * ConnectionInfo ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.ipAddress = ""; + + /** + * ConnectionInfo publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.publicIpAddress = ""; + + /** + * ConnectionInfo pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; + + /** + * ConnectionInfo instanceUid. + * @member {string} instanceUid + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.instanceUid = ""; + + /** + * ConnectionInfo pscDnsName. + * @member {string} pscDnsName + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.pscDnsName = ""; + + /** + * Creates a new ConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo instance + */ + ConnectionInfo.create = function create(properties) { + return new ConnectionInfo(properties); + }; + + /** + * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); + if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); + if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicIpAddress); + if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pscDnsName); + return writer; + }; + + /** + * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ipAddress = reader.string(); + break; + } + case 5: { + message.publicIpAddress = reader.string(); + break; + } + case 3: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 4: { + message.instanceUid = reader.string(); + break; + } + case 6: { + message.pscDnsName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + if (!$util.isString(message.publicIpAddress)) + return "publicIpAddress: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + if (!$util.isString(message.instanceUid)) + return "instanceUid: string expected"; + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + if (!$util.isString(message.pscDnsName)) + return "pscDnsName: string expected"; + return null; + }; + + /** + * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo + */ + ConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ConnectionInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.publicIpAddress != null) + message.publicIpAddress = String(object.publicIpAddress); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1beta.ConnectionInfo.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.instanceUid != null) + message.instanceUid = String(object.instanceUid); + if (object.pscDnsName != null) + message.pscDnsName = String(object.pscDnsName); + return message; + }; + + /** + * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {google.cloud.alloydb.v1beta.ConnectionInfo} message ConnectionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) { + object.name = ""; + object.ipAddress = ""; + object.instanceUid = ""; + object.publicIpAddress = ""; + object.pscDnsName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) + object.instanceUid = message.instanceUid; + if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) + object.publicIpAddress = message.publicIpAddress; + if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) + object.pscDnsName = message.pscDnsName; + return object; + }; + + /** + * Converts this ConnectionInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @instance + * @returns {Object.} JSON object + */ + ConnectionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ConnectionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ConnectionInfo"; + }; + + return ConnectionInfo; + })(); + + v1beta.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.alloydb.v1beta + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [displayName] Backup displayName + * @property {string|null} [uid] Backup uid + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime + * @property {google.protobuf.ITimestamp|null} [createCompletionTime] Backup createCompletionTime + * @property {Object.|null} [labels] Backup labels + * @property {google.cloud.alloydb.v1beta.Backup.State|null} [state] Backup state + * @property {google.cloud.alloydb.v1beta.Backup.Type|null} [type] Backup type + * @property {string|null} [description] Backup description + * @property {string|null} [clusterUid] Backup clusterUid + * @property {string|null} [clusterName] Backup clusterName + * @property {boolean|null} [reconciling] Backup reconciling + * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig + * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo + * @property {string|null} [etag] Backup etag + * @property {Object.|null} [annotations] Backup annotations + * @property {number|Long|null} [sizeBytes] Backup sizeBytes + * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * @property {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity + * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Backup databaseVersion + * @property {Object.|null} [tags] Backup tags + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + this.annotations = {}; + this.tags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup displayName. + * @member {string} displayName + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.displayName = ""; + + /** + * Backup uid. + * @member {string} uid + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.uid = ""; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.deleteTime = null; + + /** + * Backup createCompletionTime. + * @member {google.protobuf.ITimestamp|null|undefined} createCompletionTime + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.createCompletionTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup state. + * @member {google.cloud.alloydb.v1beta.Backup.State} state + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup type. + * @member {google.cloud.alloydb.v1beta.Backup.Type} type + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.type = 0; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup clusterUid. + * @member {string} clusterUid + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.clusterUid = ""; + + /** + * Backup clusterName. + * @member {string} clusterName + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.clusterName = ""; + + /** + * Backup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.reconciling = false; + + /** + * Backup encryptionConfig. + * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.encryptionConfig = null; + + /** + * Backup encryptionInfo. + * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.encryptionInfo = null; + + /** + * Backup etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.etag = ""; + + /** + * Backup annotations. + * @member {Object.} annotations + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.annotations = $util.emptyObject; + + /** + * Backup sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup expiryTime. + * @member {google.protobuf.ITimestamp|null|undefined} expiryTime + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.expiryTime = null; + + /** + * Backup expiryQuantity. + * @member {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.expiryQuantity = null; + + /** + * Backup satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = false; + + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + + /** + * Backup tags. + * @member {Object.} tags + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.tags = $util.emptyObject; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); + if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) + $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); + if (message.createCompletionTime != null && Object.hasOwnProperty.call(message, "createCompletionTime")) + $root.google.protobuf.Timestamp.encode(message.createCompletionTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.createCompletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 18: { + message.clusterUid = reader.string(); + break; + } + case 10: { + message.clusterName = reader.string(); + break; + } + case 11: { + message.reconciling = reader.bool(); + break; + } + case 12: { + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 16: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 17: { + message.sizeBytes = reader.int64(); + break; + } + case 19: { + message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); + break; + } + case 21: { + message.satisfiesPzs = reader.bool(); + break; + } + case 22: { + message.databaseVersion = reader.int32(); + break; + } + case 25: { + if (message.tags === $util.emptyObject) + message.tags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createCompletionTime); + if (error) + return "createCompletionTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + if (!$util.isString(message.clusterUid)) + return "clusterUid: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); + if (error) + return "encryptionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); + if (error) + return "expiryTime." + error; + } + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { + var error = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); + if (error) + return "expiryQuantity." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!$util.isObject(message.tags)) + return "tags: object expected"; + var key = Object.keys(message.tags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.tags[key[i]])) + return "tags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Backup) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.createCompletionTime != null) { + if (typeof object.createCompletionTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.createCompletionTime: object expected"); + message.createCompletionTime = $root.google.protobuf.Timestamp.fromObject(object.createCompletionTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ON_DEMAND": + case 1: + message.type = 1; + break; + case "AUTOMATED": + case 2: + message.type = 2; + break; + case "CONTINUOUS": + case 3: + message.type = 3; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.clusterUid != null) + message.clusterUid = String(object.clusterUid); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.encryptionInfo != null) { + if (typeof object.encryptionInfo !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionInfo: object expected"); + message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.expiryTime != null) { + if (typeof object.expiryTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryTime: object expected"); + message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); + } + if (object.expiryQuantity != null) { + if (typeof object.expiryQuantity !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryQuantity: object expected"); + message.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.databaseVersion = 6; + break; + } + if (object.tags) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.tags: object expected"); + message.tags = {}; + for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) + message.tags[keys[i]] = String(object.tags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {google.cloud.alloydb.v1beta.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + object.tags = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.clusterName = ""; + object.reconciling = false; + object.encryptionConfig = null; + object.encryptionInfo = null; + object.etag = ""; + object.deleteTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.clusterUid = ""; + object.expiryTime = null; + object.expiryQuantity = null; + object.satisfiesPzs = false; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.createCompletionTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Backup.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] : message.type; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) + object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) + object.clusterUid = message.clusterUid; + if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) + object.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.tags && (keys2 = Object.keys(message.tags)).length) { + object.tags = {}; + for (var j = 0; j < keys2.length; ++j) + object.tags[keys2[j]] = message.tags[keys2[j]]; + } + if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) + object.createCompletionTime = $root.google.protobuf.Timestamp.toObject(message.createCompletionTime, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup"; + }; + + Backup.QuantityBasedExpiry = (function() { + + /** + * Properties of a QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1beta.Backup + * @interface IQuantityBasedExpiry + * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount + * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount + */ + + /** + * Constructs a new QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1beta.Backup + * @classdesc Represents a QuantityBasedExpiry. + * @implements IQuantityBasedExpiry + * @constructor + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry=} [properties] Properties to set + */ + function QuantityBasedExpiry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedExpiry retentionCount. + * @member {number} retentionCount + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.retentionCount = 0; + + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + */ + QuantityBasedExpiry.create = function create(properties) { + return new QuantityBasedExpiry(properties); + }; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); + if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); + return writer; + }; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionCount = reader.int32(); + break; + } + case 2: { + message.totalRetentionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedExpiry message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedExpiry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + if (!$util.isInteger(message.retentionCount)) + return "retentionCount: integer expected"; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + if (!$util.isInteger(message.totalRetentionCount)) + return "totalRetentionCount: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry + */ + QuantityBasedExpiry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry(); + if (object.retentionCount != null) + message.retentionCount = object.retentionCount | 0; + if (object.totalRetentionCount != null) + message.totalRetentionCount = object.totalRetentionCount | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedExpiry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionCount = 0; + object.totalRetentionCount = 0; + } + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + object.retentionCount = message.retentionCount; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + object.totalRetentionCount = message.totalRetentionCount; + return object; + }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedExpiry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry"; + }; + + return QuantityBasedExpiry; + })(); + + /** + * State enum. + * @name google.cloud.alloydb.v1beta.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.alloydb.v1beta.Backup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} AUTOMATED=2 AUTOMATED value + * @property {number} CONTINUOUS=3 CONTINUOUS value + */ + Backup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "AUTOMATED"] = 2; + values[valuesById[3] = "CONTINUOUS"] = 3; + return values; + })(); + + return Backup; + })(); + + v1beta.SupportedDatabaseFlag = (function() { + + /** + * Properties of a SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1beta + * @interface ISupportedDatabaseFlag + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions + * @property {string|null} [recommendedStringValue] SupportedDatabaseFlag recommendedStringValue + * @property {google.protobuf.IInt64Value|null} [recommendedIntegerValue] SupportedDatabaseFlag recommendedIntegerValue + * @property {string|null} [name] SupportedDatabaseFlag name + * @property {string|null} [flagName] SupportedDatabaseFlag flagName + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType + * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues + * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions + * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null} [scope] SupportedDatabaseFlag scope + */ + + /** + * Constructs a new SupportedDatabaseFlag. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SupportedDatabaseFlag. + * @implements ISupportedDatabaseFlag + * @constructor + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set + */ + function SupportedDatabaseFlag(properties) { + this.supportedDbVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.stringRestrictions = null; + + /** + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.integerRestrictions = null; + + /** + * SupportedDatabaseFlag recommendedStringValue. + * @member {string|null|undefined} recommendedStringValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.recommendedStringValue = null; + + /** + * SupportedDatabaseFlag recommendedIntegerValue. + * @member {google.protobuf.IInt64Value|null|undefined} recommendedIntegerValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.recommendedIntegerValue = null; + + /** + * SupportedDatabaseFlag name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.name = ""; + + /** + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.flagName = ""; + + /** + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.valueType = 0; + + /** + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; + + /** + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + + /** + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.requiresDbRestart = false; + + /** + * SupportedDatabaseFlag scope. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} scope + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + SupportedDatabaseFlag.prototype.scope = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SupportedDatabaseFlag recommendedValue. + * @member {"recommendedStringValue"|"recommendedIntegerValue"|undefined} recommendedValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + */ + Object.defineProperty(SupportedDatabaseFlag.prototype, "recommendedValue", { + get: $util.oneOfGetter($oneOfFields = ["recommendedStringValue", "recommendedIntegerValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SupportedDatabaseFlag instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag instance + */ + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); + }; + + /** + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); + if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); + if (message.supportedDbVersions != null && message.supportedDbVersions.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedDbVersions.length; ++i) + writer.int32(message.supportedDbVersions[i]); + writer.ldelim(); + } + if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); + if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) + $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) + $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recommendedStringValue); + if (message.recommendedIntegerValue != null && Object.hasOwnProperty.call(message, "recommendedIntegerValue")) + $root.google.protobuf.Int64Value.encode(message.recommendedIntegerValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); + break; + } + case 8: { + message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.recommendedStringValue = reader.string(); + break; + } + case 11: { + message.recommendedIntegerValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.flagName = reader.string(); + break; + } + case 3: { + message.valueType = reader.int32(); + break; + } + case 4: { + message.acceptsMultipleValues = reader.bool(); + break; + } + case 5: { + if (!(message.supportedDbVersions && message.supportedDbVersions.length)) + message.supportedDbVersions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedDbVersions.push(reader.int32()); + } else + message.supportedDbVersions.push(reader.int32()); + break; + } + case 6: { + message.requiresDbRestart = reader.bool(); + break; + } + case 9: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedDatabaseFlag message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedDatabaseFlag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); + if (error) + return "stringRestrictions." + error; + } + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + if (properties.restrictions === 1) + return "restrictions: multiple values"; + properties.restrictions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); + if (error) + return "integerRestrictions." + error; + } + } + if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + properties.recommendedValue = 1; + if (!$util.isString(message.recommendedStringValue)) + return "recommendedStringValue: string expected"; + } + if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { + if (properties.recommendedValue === 1) + return "recommendedValue: multiple values"; + properties.recommendedValue = 1; + { + var error = $root.google.protobuf.Int64Value.verify(message.recommendedIntegerValue); + if (error) + return "recommendedIntegerValue." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.flagName != null && message.hasOwnProperty("flagName")) + if (!$util.isString(message.flagName)) + return "flagName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + if (typeof message.acceptsMultipleValues !== "boolean") + return "acceptsMultipleValues: boolean expected"; + if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { + if (!Array.isArray(message.supportedDbVersions)) + return "supportedDbVersions: array expected"; + for (var i = 0; i < message.supportedDbVersions.length; ++i) + switch (message.supportedDbVersions[i]) { + default: + return "supportedDbVersions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag + */ + SupportedDatabaseFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); + if (object.stringRestrictions != null) { + if (typeof object.stringRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.stringRestrictions: object expected"); + message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); + } + if (object.integerRestrictions != null) { + if (typeof object.integerRestrictions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.integerRestrictions: object expected"); + message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); + } + if (object.recommendedStringValue != null) + message.recommendedStringValue = String(object.recommendedStringValue); + if (object.recommendedIntegerValue != null) { + if (typeof object.recommendedIntegerValue !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.recommendedIntegerValue: object expected"); + message.recommendedIntegerValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntegerValue); + } + if (object.name != null) + message.name = String(object.name); + if (object.flagName != null) + message.flagName = String(object.flagName); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INTEGER": + case 2: + message.valueType = 2; + break; + case "FLOAT": + case 3: + message.valueType = 3; + break; + case "NONE": + case 4: + message.valueType = 4; + break; + } + if (object.acceptsMultipleValues != null) + message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); + if (object.supportedDbVersions) { + if (!Array.isArray(object.supportedDbVersions)) + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.supportedDbVersions: array expected"); + message.supportedDbVersions = []; + for (var i = 0; i < object.supportedDbVersions.length; ++i) + switch (object.supportedDbVersions[i]) { + default: + if (typeof object.supportedDbVersions[i] === "number") { + message.supportedDbVersions[i] = object.supportedDbVersions[i]; + break; + } + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.supportedDbVersions[i] = 0; + break; + case "POSTGRES_13": + case 1: + message.supportedDbVersions[i] = 1; + break; + case "POSTGRES_14": + case 2: + message.supportedDbVersions[i] = 2; + break; + case "POSTGRES_15": + case 3: + message.supportedDbVersions[i] = 3; + break; + case "POSTGRES_16": + case 4: + message.supportedDbVersions[i] = 4; + break; + case "POSTGRES_17": + case 5: + message.supportedDbVersions[i] = 5; + break; + case "POSTGRES_18": + case 6: + message.supportedDbVersions[i] = 6; + break; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "DATABASE": + case 1: + message.scope = 1; + break; + case "CONNECTION_POOL": + case 2: + message.scope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedDatabaseFlag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDbVersions = []; + if (options.defaults) { + object.name = ""; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.flagName != null && message.hasOwnProperty("flagName")) + object.flagName = message.flagName; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; + if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) + object.acceptsMultipleValues = message.acceptsMultipleValues; + if (message.supportedDbVersions && message.supportedDbVersions.length) { + object.supportedDbVersions = []; + for (var j = 0; j < message.supportedDbVersions.length; ++j) + object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + object.requiresDbRestart = message.requiresDbRestart; + if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { + object.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); + if (options.oneofs) + object.restrictions = "stringRestrictions"; + } + if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { + object.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); + if (options.oneofs) + object.restrictions = "integerRestrictions"; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] : message.scope; + if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + object.recommendedStringValue = message.recommendedStringValue; + if (options.oneofs) + object.recommendedValue = "recommendedStringValue"; + } + if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { + object.recommendedIntegerValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntegerValue, options); + if (options.oneofs) + object.recommendedValue = "recommendedIntegerValue"; + } + return object; + }; + + /** + * Converts this SupportedDatabaseFlag to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @instance + * @returns {Object.} JSON object + */ + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupportedDatabaseFlag + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag"; + }; + + SupportedDatabaseFlag.StringRestrictions = (function() { + + /** + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues + */ + + /** + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions + * @constructor + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + */ + function StringRestrictions(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @instance + */ + StringRestrictions.prototype.allowedValues = $util.emptyArray; + + /** + * Creates a new StringRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance + */ + StringRestrictions.create = function create(properties) { + return new StringRestrictions(properties); + }; + + /** + * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + return writer; + }; + + /** + * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + return null; + }; + + /** + * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions + */ + StringRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + return object; + }; + + /** + * Converts this StringRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @instance + * @returns {Object.} JSON object + */ + StringRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions"; + }; + + return StringRestrictions; + })(); + + SupportedDatabaseFlag.IntegerRestrictions = (function() { + + /** + * Properties of an IntegerRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @interface IIntegerRestrictions + * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue + * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue + */ + + /** + * Constructs a new IntegerRestrictions. + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag + * @classdesc Represents an IntegerRestrictions. + * @implements IIntegerRestrictions + * @constructor + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + */ + function IntegerRestrictions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntegerRestrictions minValue. + * @member {google.protobuf.IInt64Value|null|undefined} minValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.minValue = null; + + /** + * IntegerRestrictions maxValue. + * @member {google.protobuf.IInt64Value|null|undefined} maxValue + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @instance + */ + IntegerRestrictions.prototype.maxValue = null; + + /** + * Creates a new IntegerRestrictions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance + */ + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); + }; + + /** + * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerRestrictions message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + return null; + }; + + /** + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions + */ + IntegerRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); + message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); + message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); + } + return message; + }; + + /** + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minValue = null; + object.maxValue = null; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); + return object; + }; + + /** + * Converts this IntegerRestrictions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @instance + * @returns {Object.} JSON object + */ + IntegerRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRestrictions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions"; + }; + + return IntegerRestrictions; + })(); + + /** + * ValueType enum. + * @name google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} FLOAT=3 FLOAT value + * @property {number} NONE=4 NONE value + */ + SupportedDatabaseFlag.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "FLOAT"] = 3; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + /** + * Scope enum. + * @name google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} DATABASE=1 DATABASE value + * @property {number} CONNECTION_POOL=2 CONNECTION_POOL value + */ + SupportedDatabaseFlag.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATABASE"] = 1; + values[valuesById[2] = "CONNECTION_POOL"] = 2; + return values; + })(); + + return SupportedDatabaseFlag; + })(); + + v1beta.User = (function() { + + /** + * Properties of a User. + * @memberof google.cloud.alloydb.v1beta + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [password] User password + * @property {Array.|null} [databaseRoles] User databaseRoles + * @property {google.cloud.alloydb.v1beta.User.UserType|null} [userType] User userType + * @property {boolean|null} [keepExtraRoles] User keepExtraRoles + */ + + /** + * Constructs a new User. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.cloud.alloydb.v1beta.IUser=} [properties] Properties to set + */ + function User(properties) { + this.databaseRoles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.name = ""; + + /** + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.password = ""; + + /** + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.databaseRoles = $util.emptyArray; + + /** + * User userType. + * @member {google.cloud.alloydb.v1beta.User.UserType} userType + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.userType = 0; + + /** + * User keepExtraRoles. + * @member {boolean} keepExtraRoles + * @memberof google.cloud.alloydb.v1beta.User + * @instance + */ + User.prototype.keepExtraRoles = false; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.IUser=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.databaseRoles != null && message.databaseRoles.length) + for (var i = 0; i < message.databaseRoles.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); + if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); + if (message.keepExtraRoles != null && Object.hasOwnProperty.call(message, "keepExtraRoles")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.keepExtraRoles); + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 4: { + if (!(message.databaseRoles && message.databaseRoles.length)) + message.databaseRoles = []; + message.databaseRoles.push(reader.string()); + break; + } + case 5: { + message.userType = reader.int32(); + break; + } + case 6: { + message.keepExtraRoles = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (!Array.isArray(message.databaseRoles)) + return "databaseRoles: array expected"; + for (var i = 0; i < message.databaseRoles.length; ++i) + if (!$util.isString(message.databaseRoles[i])) + return "databaseRoles: string[] expected"; + } + if (message.userType != null && message.hasOwnProperty("userType")) + switch (message.userType) { + default: + return "userType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) + if (typeof message.keepExtraRoles !== "boolean") + return "keepExtraRoles: boolean expected"; + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.User) + return object; + var message = new $root.google.cloud.alloydb.v1beta.User(); + if (object.name != null) + message.name = String(object.name); + if (object.password != null) + message.password = String(object.password); + if (object.databaseRoles) { + if (!Array.isArray(object.databaseRoles)) + throw TypeError(".google.cloud.alloydb.v1beta.User.databaseRoles: array expected"); + message.databaseRoles = []; + for (var i = 0; i < object.databaseRoles.length; ++i) + message.databaseRoles[i] = String(object.databaseRoles[i]); + } + switch (object.userType) { + default: + if (typeof object.userType === "number") { + message.userType = object.userType; + break; + } + break; + case "USER_TYPE_UNSPECIFIED": + case 0: + message.userType = 0; + break; + case "ALLOYDB_BUILT_IN": + case 1: + message.userType = 1; + break; + case "ALLOYDB_IAM_USER": + case 2: + message.userType = 2; + break; + } + if (object.keepExtraRoles != null) + message.keepExtraRoles = Boolean(object.keepExtraRoles); + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {google.cloud.alloydb.v1beta.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseRoles = []; + if (options.defaults) { + object.name = ""; + object.password = ""; + object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; + object.keepExtraRoles = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.databaseRoles && message.databaseRoles.length) { + object.databaseRoles = []; + for (var j = 0; j < message.databaseRoles.length; ++j) + object.databaseRoles[j] = message.databaseRoles[j]; + } + if (message.userType != null && message.hasOwnProperty("userType")) + object.userType = options.enums === String ? $root.google.cloud.alloydb.v1beta.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1beta.User.UserType[message.userType] : message.userType; + if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) + object.keepExtraRoles = message.keepExtraRoles; + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.User"; + }; + + /** + * UserType enum. + * @name google.cloud.alloydb.v1beta.User.UserType + * @enum {number} + * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value + * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value + * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value + */ + User.UserType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; + values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; + return values; + })(); + + return User; + })(); + + v1beta.Database = (function() { + + /** + * Properties of a Database. + * @memberof google.cloud.alloydb.v1beta + * @interface IDatabase + * @property {string|null} [name] Database name + * @property {string|null} [charset] Database charset + * @property {string|null} [collation] Database collation + * @property {string|null} [characterType] Database characterType + * @property {boolean|null} [isTemplate] Database isTemplate + * @property {string|null} [databaseTemplate] Database databaseTemplate + * @property {boolean|null} [isTemplateDatabase] Database isTemplateDatabase + */ + + /** + * Constructs a new Database. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a Database. + * @implements IDatabase + * @constructor + * @param {google.cloud.alloydb.v1beta.IDatabase=} [properties] Properties to set + */ + function Database(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Database name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.name = ""; + + /** + * Database charset. + * @member {string} charset + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.charset = ""; + + /** + * Database collation. + * @member {string} collation + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.collation = ""; + + /** + * Database characterType. + * @member {string} characterType + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.characterType = ""; + + /** + * Database isTemplate. + * @member {boolean} isTemplate + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.isTemplate = false; + + /** + * Database databaseTemplate. + * @member {string} databaseTemplate + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.databaseTemplate = ""; + + /** + * Database isTemplateDatabase. + * @member {boolean|null|undefined} isTemplateDatabase + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + */ + Database.prototype.isTemplateDatabase = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Database.prototype, "_isTemplateDatabase", { + get: $util.oneOfGetter($oneOfFields = ["isTemplateDatabase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Database instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {google.cloud.alloydb.v1beta.IDatabase=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Database} Database instance + */ + Database.create = function create(properties) { + return new Database(properties); + }; + + /** + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {google.cloud.alloydb.v1beta.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.charset); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.collation); + if (message.characterType != null && Object.hasOwnProperty.call(message, "characterType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.characterType); + if (message.isTemplate != null && Object.hasOwnProperty.call(message, "isTemplate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isTemplate); + if (message.databaseTemplate != null && Object.hasOwnProperty.call(message, "databaseTemplate")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseTemplate); + if (message.isTemplateDatabase != null && Object.hasOwnProperty.call(message, "isTemplateDatabase")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isTemplateDatabase); + return writer; + }; + + /** + * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {google.cloud.alloydb.v1beta.IDatabase} message Database message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Database.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Database message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Database(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.charset = reader.string(); + break; + } + case 3: { + message.collation = reader.string(); + break; + } + case 4: { + message.characterType = reader.string(); + break; + } + case 5: { + message.isTemplate = reader.bool(); + break; + } + case 6: { + message.databaseTemplate = reader.string(); + break; + } + case 7: { + message.isTemplateDatabase = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Database message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Database} Database + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Database.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Database message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Database.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.charset != null && message.hasOwnProperty("charset")) + if (!$util.isString(message.charset)) + return "charset: string expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isString(message.collation)) + return "collation: string expected"; + if (message.characterType != null && message.hasOwnProperty("characterType")) + if (!$util.isString(message.characterType)) + return "characterType: string expected"; + if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) + if (typeof message.isTemplate !== "boolean") + return "isTemplate: boolean expected"; + if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) + if (!$util.isString(message.databaseTemplate)) + return "databaseTemplate: string expected"; + if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { + properties._isTemplateDatabase = 1; + if (typeof message.isTemplateDatabase !== "boolean") + return "isTemplateDatabase: boolean expected"; + } + return null; + }; + + /** + * Creates a Database message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Database} Database + */ + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Database) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Database(); + if (object.name != null) + message.name = String(object.name); + if (object.charset != null) + message.charset = String(object.charset); + if (object.collation != null) + message.collation = String(object.collation); + if (object.characterType != null) + message.characterType = String(object.characterType); + if (object.isTemplate != null) + message.isTemplate = Boolean(object.isTemplate); + if (object.databaseTemplate != null) + message.databaseTemplate = String(object.databaseTemplate); + if (object.isTemplateDatabase != null) + message.isTemplateDatabase = Boolean(object.isTemplateDatabase); + return message; + }; + + /** + * Creates a plain object from a Database message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {google.cloud.alloydb.v1beta.Database} message Database + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Database.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.charset = ""; + object.collation = ""; + object.characterType = ""; + object.isTemplate = false; + object.databaseTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.charset != null && message.hasOwnProperty("charset")) + object.charset = message.charset; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.characterType != null && message.hasOwnProperty("characterType")) + object.characterType = message.characterType; + if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) + object.isTemplate = message.isTemplate; + if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) + object.databaseTemplate = message.databaseTemplate; + if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { + object.isTemplateDatabase = message.isTemplateDatabase; + if (options.oneofs) + object._isTemplateDatabase = "isTemplateDatabase"; + } + return object; + }; + + /** + * Converts this Database to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Database + * @instance + * @returns {Object.} JSON object + */ + Database.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Database + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Database + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Database"; + }; + + return Database; + })(); + + /** + * GCAEntitlementType enum. + * @name google.cloud.alloydb.v1beta.GCAEntitlementType + * @enum {number} + * @property {number} GCA_ENTITLEMENT_TYPE_UNSPECIFIED=0 GCA_ENTITLEMENT_TYPE_UNSPECIFIED value + * @property {number} GCA_STANDARD=1 GCA_STANDARD value + */ + v1beta.GCAEntitlementType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GCA_ENTITLEMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCA_STANDARD"] = 1; + return values; + })(); + + v1beta.GeminiClusterConfig = (function() { + + /** + * Properties of a GeminiClusterConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IGeminiClusterConfig + * @property {boolean|null} [entitled] GeminiClusterConfig entitled + */ + + /** + * Constructs a new GeminiClusterConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GeminiClusterConfig. + * @implements IGeminiClusterConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig=} [properties] Properties to set + */ + function GeminiClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeminiClusterConfig entitled. + * @member {boolean} entitled + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @instance + */ + GeminiClusterConfig.prototype.entitled = false; + + /** + * Creates a new GeminiClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig instance + */ + GeminiClusterConfig.create = function create(properties) { + return new GeminiClusterConfig(properties); + }; + + /** + * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); + return writer; + }; + + /** + * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GeminiClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entitled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeminiClusterConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeminiClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitled != null && message.hasOwnProperty("entitled")) + if (typeof message.entitled !== "boolean") + return "entitled: boolean expected"; + return null; + }; + + /** + * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig + */ + GeminiClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GeminiClusterConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GeminiClusterConfig(); + if (object.entitled != null) + message.entitled = Boolean(object.entitled); + return message; + }; + + /** + * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {google.cloud.alloydb.v1beta.GeminiClusterConfig} message GeminiClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeminiClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entitled = false; + if (message.entitled != null && message.hasOwnProperty("entitled")) + object.entitled = message.entitled; + return object; + }; + + /** + * Converts this GeminiClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @instance + * @returns {Object.} JSON object + */ + GeminiClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeminiClusterConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeminiClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GeminiClusterConfig"; + }; + + return GeminiClusterConfig; + })(); + + v1beta.GeminiInstanceConfig = (function() { + + /** + * Properties of a GeminiInstanceConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IGeminiInstanceConfig + * @property {boolean|null} [entitled] GeminiInstanceConfig entitled + */ + + /** + * Constructs a new GeminiInstanceConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GeminiInstanceConfig. + * @implements IGeminiInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig=} [properties] Properties to set + */ + function GeminiInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeminiInstanceConfig entitled. + * @member {boolean} entitled + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @instance + */ + GeminiInstanceConfig.prototype.entitled = false; + + /** + * Creates a new GeminiInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig instance + */ + GeminiInstanceConfig.create = function create(properties) { + return new GeminiInstanceConfig(properties); + }; + + /** + * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); + return writer; + }; + + /** + * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeminiInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entitled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeminiInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeminiInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeminiInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitled != null && message.hasOwnProperty("entitled")) + if (typeof message.entitled !== "boolean") + return "entitled: boolean expected"; + return null; + }; + + /** + * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig + */ + GeminiInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig(); + if (object.entitled != null) + message.entitled = Boolean(object.entitled); + return message; + }; + + /** + * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.GeminiInstanceConfig} message GeminiInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeminiInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entitled = false; + if (message.entitled != null && message.hasOwnProperty("entitled")) + object.entitled = message.entitled; + return object; + }; + + /** + * Converts this GeminiInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + GeminiInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeminiInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeminiInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GeminiInstanceConfig"; + }; + + return GeminiInstanceConfig; + })(); + + v1beta.GCAInstanceConfig = (function() { + + /** + * Properties of a GCAInstanceConfig. + * @memberof google.cloud.alloydb.v1beta + * @interface IGCAInstanceConfig + * @property {google.cloud.alloydb.v1beta.GCAEntitlementType|null} [gcaEntitlement] GCAInstanceConfig gcaEntitlement + */ + + /** + * Constructs a new GCAInstanceConfig. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GCAInstanceConfig. + * @implements IGCAInstanceConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig=} [properties] Properties to set + */ + function GCAInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCAInstanceConfig gcaEntitlement. + * @member {google.cloud.alloydb.v1beta.GCAEntitlementType} gcaEntitlement + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @instance + */ + GCAInstanceConfig.prototype.gcaEntitlement = 0; + + /** + * Creates a new GCAInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig instance + */ + GCAInstanceConfig.create = function create(properties) { + return new GCAInstanceConfig(properties); + }; + + /** + * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCAInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcaEntitlement != null && Object.hasOwnProperty.call(message, "gcaEntitlement")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.gcaEntitlement); + return writer; + }; + + /** + * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCAInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCAInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GCAInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcaEntitlement = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCAInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCAInstanceConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCAInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) + switch (message.gcaEntitlement) { + default: + return "gcaEntitlement: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig + */ + GCAInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GCAInstanceConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GCAInstanceConfig(); + switch (object.gcaEntitlement) { + default: + if (typeof object.gcaEntitlement === "number") { + message.gcaEntitlement = object.gcaEntitlement; + break; + } + break; + case "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": + case 0: + message.gcaEntitlement = 0; + break; + case "GCA_STANDARD": + case 1: + message.gcaEntitlement = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {google.cloud.alloydb.v1beta.GCAInstanceConfig} message GCAInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCAInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcaEntitlement = options.enums === String ? "GCA_ENTITLEMENT_TYPE_UNSPECIFIED" : 0; + if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) + object.gcaEntitlement = options.enums === String ? $root.google.cloud.alloydb.v1beta.GCAEntitlementType[message.gcaEntitlement] === undefined ? message.gcaEntitlement : $root.google.cloud.alloydb.v1beta.GCAEntitlementType[message.gcaEntitlement] : message.gcaEntitlement; + return object; + }; + + /** + * Converts this GCAInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + GCAInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCAInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCAInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GCAInstanceConfig"; + }; + + return GCAInstanceConfig; + })(); + + v1beta.AlloyDBAdmin = (function() { + + /** + * Constructs a new AlloyDBAdmin service. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an AlloyDBAdmin + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + + /** + * Creates new AlloyDBAdmin service using the specified rpc implementation. + * @function create + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1beta.ListClustersRequest, $root.google.cloud.alloydb.v1beta.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1beta.GetClusterRequest, $root.google.cloud.alloydb.v1beta.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1beta.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1beta.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|exportCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ExportClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportCluster. + * @function exportCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} request ExportClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.exportCluster = function exportCluster(request, callback) { + return this.rpcCall(exportCluster, $root.google.cloud.alloydb.v1beta.ExportClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportCluster" }); + + /** + * Calls ExportCluster. + * @function exportCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} request ExportClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|importCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ImportClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportCluster. + * @function importCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} request ImportClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.importCluster = function importCluster(request, callback) { + return this.rpcCall(importCluster, $root.google.cloud.alloydb.v1beta.ImportClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportCluster" }); + + /** + * Calls ImportCluster. + * @function importCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} request ImportClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|upgradeCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpgradeClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpgradeCluster. + * @function upgradeCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.upgradeCluster = function upgradeCluster(request, callback) { + return this.rpcCall(upgradeCluster, $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpgradeCluster" }); + + /** + * Calls UpgradeCluster. + * @function upgradeCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1beta.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef PromoteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { + return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1beta.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteCluster" }); + + /** + * Calls PromoteCluster. + * @function promoteCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|switchoverCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef SwitchoverClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SwitchoverCluster. + * @function switchoverCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.switchoverCluster = function switchoverCluster(request, callback) { + return this.rpcCall(switchoverCluster, $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SwitchoverCluster" }); + + /** + * Calls SwitchoverCluster. + * @function switchoverCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef RestoreClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { + return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1beta.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreCluster" }); + + /** + * Calls RestoreCluster. + * @function restoreCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateSecondaryClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { + return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryCluster" }); + + /** + * Calls CreateSecondaryCluster. + * @function createSecondaryCluster + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1beta.ListInstancesRequest, $root.google.cloud.alloydb.v1beta.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1beta.GetInstanceRequest, $root.google.cloud.alloydb.v1beta.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1beta.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateSecondaryInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { + return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecondaryInstance" }); + + /** + * Calls CreateSecondaryInstance. + * @function createSecondaryInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef BatchCreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { + return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateInstances" }); + + /** + * Calls BatchCreateInstances. + * @function batchCreateInstances + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef FailoverInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { + return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FailoverInstance" }); + + /** + * Calls FailoverInstance. + * @function failoverInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|injectFault}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef InjectFaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { + return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1beta.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InjectFault" }); + + /** + * Calls InjectFault. + * @function injectFault + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} request InjectFaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1beta.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|executeSql}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ExecuteSqlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ExecuteSqlResponse} [response] ExecuteSqlResponse + */ + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ExecuteSqlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.executeSql = function executeSql(request, callback) { + return this.rpcCall(executeSql, $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest, $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse, request, callback); + }, "name", { value: "ExecuteSql" }); + + /** + * Calls ExecuteSql. + * @function executeSql + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1beta.ListBackupsRequest, $root.google.cloud.alloydb.v1beta.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1beta.GetBackupRequest, $root.google.cloud.alloydb.v1beta.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1beta.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1beta.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1beta.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListSupportedDatabaseFlagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse + */ + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { + return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, request, callback); + }, "name", { value: "ListSupportedDatabaseFlags" }); + + /** + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GenerateClientCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse + */ + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { + return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, request, callback); + }, "name", { value: "GenerateClientCertificate" }); + + /** + * Calls GenerateClientCertificate. + * @function generateClientCertificate + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetConnectionInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ConnectionInfo} [response] ConnectionInfo + */ + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { + return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1beta.ConnectionInfo, request, callback); + }, "name", { value: "GetConnectionInfo" }); + + /** + * Calls GetConnectionInfo. + * @function getConnectionInfo + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listUsers}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListUsersResponse} [response] ListUsersResponse + */ + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1beta.ListUsersRequest, $root.google.cloud.alloydb.v1beta.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.User} [response] User + */ + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.cloud.alloydb.v1beta.GetUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); + }, "name", { value: "GetUser" }); + + /** + * Calls GetUser. + * @function getUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.User} [response] User + */ + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.cloud.alloydb.v1beta.CreateUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1beta.UpdateUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); + }, "name", { value: "UpdateUser" }); + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteUser}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1beta.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listDatabases}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef ListDatabasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.ListDatabasesResponse} [response] ListDatabasesResponse + */ + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.listDatabases = function listDatabases(request, callback) { + return this.rpcCall(listDatabases, $root.google.cloud.alloydb.v1beta.ListDatabasesRequest, $root.google.cloud.alloydb.v1beta.ListDatabasesResponse, request, callback); + }, "name", { value: "ListDatabases" }); + + /** + * Calls ListDatabases. + * @function listDatabases + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} request ListDatabasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createDatabase}. + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @typedef CreateDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.alloydb.v1beta.Database} [response] Database + */ + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Database + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlloyDBAdmin.prototype.createDatabase = function createDatabase(request, callback) { + return this.rpcCall(createDatabase, $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest, $root.google.cloud.alloydb.v1beta.Database, request, callback); + }, "name", { value: "CreateDatabase" }); + + /** + * Calls CreateDatabase. + * @function createDatabase + * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin + * @instance + * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AlloyDBAdmin; + })(); + + v1beta.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {google.cloud.alloydb.v1beta.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1beta.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.clusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1beta.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + * @property {google.cloud.alloydb.v1beta.ClusterView|null} [view] GetClusterRequest view + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1beta.ClusterView} view + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.view = 0; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CLUSTER_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CLUSTER_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CLUSTER_VIEW_CONTINUOUS_BACKUP": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.ClusterView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1beta.CreateSecondaryClusterRequest = (function() { + + /** + * Properties of a CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateSecondaryClusterRequest + * @property {string|null} [parent] CreateSecondaryClusterRequest parent + * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster + * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly + */ + + /** + * Constructs a new CreateSecondaryClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateSecondaryClusterRequest. + * @implements ICreateSecondaryClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set + */ + function CreateSecondaryClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecondaryClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.parent = ""; + + /** + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.clusterId = ""; + + /** + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.cluster = null; + + /** + * CreateSecondaryClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.requestId = ""; + + /** + * CreateSecondaryClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance + */ + CreateSecondaryClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance + */ + CreateSecondaryClusterRequest.create = function create(properties) { + return new CreateSecondaryClusterRequest(properties); + }; + + /** + * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecondaryClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecondaryClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + */ + CreateSecondaryClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecondaryClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateSecondaryClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecondaryClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest"; + }; + + return CreateSecondaryClusterRequest; + })(); + + v1beta.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1beta.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.validateOnly = false; + + /** + * UpdateClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1beta.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.alloydb.v1beta + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.alloydb.v1beta.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination uri. + * @member {string} uri + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {google.cloud.alloydb.v1beta.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {google.cloud.alloydb.v1beta.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {google.cloud.alloydb.v1beta.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GcsDestination) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {google.cloud.alloydb.v1beta.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1beta.ExportClusterRequest = (function() { + + /** + * Properties of an ExportClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IExportClusterRequest + * @property {google.cloud.alloydb.v1beta.IGcsDestination|null} [gcsDestination] ExportClusterRequest gcsDestination + * @property {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null} [csvExportOptions] ExportClusterRequest csvExportOptions + * @property {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null} [sqlExportOptions] ExportClusterRequest sqlExportOptions + * @property {string|null} [name] ExportClusterRequest name + * @property {string|null} [database] ExportClusterRequest database + */ + + /** + * Constructs a new ExportClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ExportClusterRequest. + * @implements IExportClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IExportClusterRequest=} [properties] Properties to set + */ + function ExportClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportClusterRequest gcsDestination. + * @member {google.cloud.alloydb.v1beta.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.gcsDestination = null; + + /** + * ExportClusterRequest csvExportOptions. + * @member {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null|undefined} csvExportOptions + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.csvExportOptions = null; + + /** + * ExportClusterRequest sqlExportOptions. + * @member {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null|undefined} sqlExportOptions + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.sqlExportOptions = null; + + /** + * ExportClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.name = ""; + + /** + * ExportClusterRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + ExportClusterRequest.prototype.database = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportClusterRequest destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + Object.defineProperty(ExportClusterRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExportClusterRequest exportOptions. + * @member {"csvExportOptions"|"sqlExportOptions"|undefined} exportOptions + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + */ + Object.defineProperty(ExportClusterRequest.prototype, "exportOptions", { + get: $util.oneOfGetter($oneOfFields = ["csvExportOptions", "sqlExportOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IExportClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest instance + */ + ExportClusterRequest.create = function create(properties) { + return new ExportClusterRequest(properties); + }; + + /** + * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} message ExportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.alloydb.v1beta.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) + $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) + $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} message ExportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.csvExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sqlExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.database = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.alloydb.v1beta.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + properties.exportOptions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify(message.csvExportOptions); + if (error) + return "csvExportOptions." + error; + } + } + if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + if (properties.exportOptions === 1) + return "exportOptions: multiple values"; + properties.exportOptions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify(message.sqlExportOptions); + if (error) + return "sqlExportOptions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + return null; + }; + + /** + * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest + */ + ExportClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.fromObject(object.gcsDestination); + } + if (object.csvExportOptions != null) { + if (typeof object.csvExportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.csvExportOptions: object expected"); + message.csvExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.fromObject(object.csvExportOptions); + } + if (object.sqlExportOptions != null) { + if (typeof object.sqlExportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.sqlExportOptions: object expected"); + message.sqlExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.fromObject(object.sqlExportOptions); + } + if (object.name != null) + message.name = String(object.name); + if (object.database != null) + message.database = String(object.database); + return message; + }; + + /** + * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest} message ExportClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.database = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + object.csvExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.toObject(message.csvExportOptions, options); + if (options.oneofs) + object.exportOptions = "csvExportOptions"; + } + if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + object.sqlExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.toObject(message.sqlExportOptions, options); + if (options.oneofs) + object.exportOptions = "sqlExportOptions"; + } + return object; + }; + + /** + * Converts this ExportClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @instance + * @returns {Object.} JSON object + */ + ExportClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterRequest"; + }; + + ExportClusterRequest.CsvExportOptions = (function() { + + /** + * Properties of a CsvExportOptions. + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @interface ICsvExportOptions + * @property {string|null} [selectQuery] CsvExportOptions selectQuery + * @property {string|null} [fieldDelimiter] CsvExportOptions fieldDelimiter + * @property {string|null} [quoteCharacter] CsvExportOptions quoteCharacter + * @property {string|null} [escapeCharacter] CsvExportOptions escapeCharacter + */ + + /** + * Constructs a new CsvExportOptions. + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @classdesc Represents a CsvExportOptions. + * @implements ICsvExportOptions + * @constructor + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set + */ + function CsvExportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvExportOptions selectQuery. + * @member {string} selectQuery + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.selectQuery = ""; + + /** + * CsvExportOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.fieldDelimiter = ""; + + /** + * CsvExportOptions quoteCharacter. + * @member {string} quoteCharacter + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.quoteCharacter = ""; + + /** + * CsvExportOptions escapeCharacter. + * @member {string} escapeCharacter + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @instance + */ + CsvExportOptions.prototype.escapeCharacter = ""; + + /** + * Creates a new CsvExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions instance + */ + CsvExportOptions.create = function create(properties) { + return new CsvExportOptions(properties); + }; + + /** + * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldDelimiter); + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.quoteCharacter); + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.escapeCharacter); + return writer; + }; + + /** + * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvExportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selectQuery = reader.string(); + break; + } + case 2: { + message.fieldDelimiter = reader.string(); + break; + } + case 3: { + message.quoteCharacter = reader.string(); + break; + } + case 4: { + message.escapeCharacter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvExportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (!$util.isString(message.selectQuery)) + return "selectQuery: string expected"; + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (!$util.isString(message.quoteCharacter)) + return "quoteCharacter: string expected"; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (!$util.isString(message.escapeCharacter)) + return "escapeCharacter: string expected"; + return null; + }; + + /** + * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions + */ + CsvExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions(); + if (object.selectQuery != null) + message.selectQuery = String(object.selectQuery); + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.quoteCharacter != null) + message.quoteCharacter = String(object.quoteCharacter); + if (object.escapeCharacter != null) + message.escapeCharacter = String(object.escapeCharacter); + return message; + }; + + /** + * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} message CsvExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selectQuery = ""; + object.fieldDelimiter = ""; + object.quoteCharacter = ""; + object.escapeCharacter = ""; + } + if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + object.selectQuery = message.selectQuery; + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + object.quoteCharacter = message.quoteCharacter; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + object.escapeCharacter = message.escapeCharacter; + return object; + }; + + /** + * Converts this CsvExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @instance + * @returns {Object.} JSON object + */ + CsvExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvExportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions"; + }; + + return CsvExportOptions; + })(); + + ExportClusterRequest.SqlExportOptions = (function() { + + /** + * Properties of a SqlExportOptions. + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @interface ISqlExportOptions + * @property {Array.|null} [tables] SqlExportOptions tables + * @property {boolean|null} [schemaOnly] SqlExportOptions schemaOnly + * @property {boolean|null} [cleanTargetObjects] SqlExportOptions cleanTargetObjects + * @property {boolean|null} [ifExistTargetObjects] SqlExportOptions ifExistTargetObjects + */ + + /** + * Constructs a new SqlExportOptions. + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest + * @classdesc Represents a SqlExportOptions. + * @implements ISqlExportOptions + * @constructor + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set + */ + function SqlExportOptions(properties) { + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlExportOptions tables. + * @member {Array.} tables + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.tables = $util.emptyArray; + + /** + * SqlExportOptions schemaOnly. + * @member {boolean|null|undefined} schemaOnly + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.schemaOnly = null; + + /** + * SqlExportOptions cleanTargetObjects. + * @member {boolean|null|undefined} cleanTargetObjects + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.cleanTargetObjects = null; + + /** + * SqlExportOptions ifExistTargetObjects. + * @member {boolean|null|undefined} ifExistTargetObjects + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @instance + */ + SqlExportOptions.prototype.ifExistTargetObjects = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_schemaOnly", { + get: $util.oneOfGetter($oneOfFields = ["schemaOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_cleanTargetObjects", { + get: $util.oneOfGetter($oneOfFields = ["cleanTargetObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlExportOptions.prototype, "_ifExistTargetObjects", { + get: $util.oneOfGetter($oneOfFields = ["ifExistTargetObjects"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions instance + */ + SqlExportOptions.create = function create(properties) { + return new SqlExportOptions(properties); + }; + + /** + * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.schemaOnly); + if (message.cleanTargetObjects != null && Object.hasOwnProperty.call(message, "cleanTargetObjects")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanTargetObjects); + if (message.ifExistTargetObjects != null && Object.hasOwnProperty.call(message, "ifExistTargetObjects")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ifExistTargetObjects); + return writer; + }; + + /** + * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlExportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push(reader.string()); + break; + } + case 2: { + message.schemaOnly = reader.bool(); + break; + } + case 3: { + message.cleanTargetObjects = reader.bool(); + break; + } + case 4: { + message.ifExistTargetObjects = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlExportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) + if (!$util.isString(message.tables[i])) + return "tables: string[] expected"; + } + if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + properties._schemaOnly = 1; + if (typeof message.schemaOnly !== "boolean") + return "schemaOnly: boolean expected"; + } + if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { + properties._cleanTargetObjects = 1; + if (typeof message.cleanTargetObjects !== "boolean") + return "cleanTargetObjects: boolean expected"; + } + if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { + properties._ifExistTargetObjects = 1; + if (typeof message.ifExistTargetObjects !== "boolean") + return "ifExistTargetObjects: boolean expected"; + } + return null; + }; + + /** + * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions + */ + SqlExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions(); + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) + message.tables[i] = String(object.tables[i]); + } + if (object.schemaOnly != null) + message.schemaOnly = Boolean(object.schemaOnly); + if (object.cleanTargetObjects != null) + message.cleanTargetObjects = Boolean(object.cleanTargetObjects); + if (object.ifExistTargetObjects != null) + message.ifExistTargetObjects = Boolean(object.ifExistTargetObjects); + return message; + }; + + /** + * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} message SqlExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tables = []; + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = message.tables[j]; + } + if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + object.schemaOnly = message.schemaOnly; + if (options.oneofs) + object._schemaOnly = "schemaOnly"; + } + if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { + object.cleanTargetObjects = message.cleanTargetObjects; + if (options.oneofs) + object._cleanTargetObjects = "cleanTargetObjects"; + } + if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { + object.ifExistTargetObjects = message.ifExistTargetObjects; + if (options.oneofs) + object._ifExistTargetObjects = "ifExistTargetObjects"; + } + return object; + }; + + /** + * Converts this SqlExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @instance + * @returns {Object.} JSON object + */ + SqlExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlExportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions"; + }; + + return SqlExportOptions; + })(); + + return ExportClusterRequest; + })(); + + v1beta.ExportClusterResponse = (function() { + + /** + * Properties of an ExportClusterResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IExportClusterResponse + * @property {google.cloud.alloydb.v1beta.IGcsDestination|null} [gcsDestination] ExportClusterResponse gcsDestination + */ + + /** + * Constructs a new ExportClusterResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ExportClusterResponse. + * @implements IExportClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IExportClusterResponse=} [properties] Properties to set + */ + function ExportClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportClusterResponse gcsDestination. + * @member {google.cloud.alloydb.v1beta.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @instance + */ + ExportClusterResponse.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportClusterResponse destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @instance + */ + Object.defineProperty(ExportClusterResponse.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IExportClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse instance + */ + ExportClusterResponse.create = function create(properties) { + return new ExportClusterResponse(properties); + }; + + /** + * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IExportClusterResponse} message ExportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.alloydb.v1beta.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IExportClusterResponse} message ExportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.alloydb.v1beta.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse + */ + ExportClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExportClusterResponse(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterResponse.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.ExportClusterResponse} message ExportClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this ExportClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @instance + * @returns {Object.} JSON object + */ + ExportClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterResponse"; + }; + + return ExportClusterResponse; + })(); + + v1beta.ImportClusterRequest = (function() { + + /** + * Properties of an ImportClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IImportClusterRequest + * @property {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null} [sqlImportOptions] ImportClusterRequest sqlImportOptions + * @property {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null} [csvImportOptions] ImportClusterRequest csvImportOptions + * @property {string|null} [name] ImportClusterRequest name + * @property {string|null} [gcsUri] ImportClusterRequest gcsUri + * @property {string|null} [database] ImportClusterRequest database + * @property {string|null} [user] ImportClusterRequest user + */ + + /** + * Constructs a new ImportClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ImportClusterRequest. + * @implements IImportClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IImportClusterRequest=} [properties] Properties to set + */ + function ImportClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportClusterRequest sqlImportOptions. + * @member {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null|undefined} sqlImportOptions + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.sqlImportOptions = null; + + /** + * ImportClusterRequest csvImportOptions. + * @member {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null|undefined} csvImportOptions + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.csvImportOptions = null; + + /** + * ImportClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.name = ""; + + /** + * ImportClusterRequest gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.gcsUri = ""; + + /** + * ImportClusterRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.database = ""; + + /** + * ImportClusterRequest user. + * @member {string} user + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + ImportClusterRequest.prototype.user = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportClusterRequest importOptions. + * @member {"sqlImportOptions"|"csvImportOptions"|undefined} importOptions + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + */ + Object.defineProperty(ImportClusterRequest.prototype, "importOptions", { + get: $util.oneOfGetter($oneOfFields = ["sqlImportOptions", "csvImportOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IImportClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest instance + */ + ImportClusterRequest.create = function create(properties) { + return new ImportClusterRequest(properties); + }; + + /** + * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} message ImportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) + $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.user); + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) + $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} message ImportClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.sqlImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.decode(reader, reader.uint32()); + break; + } + case 7: { + message.csvImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.database = reader.string(); + break; + } + case 5: { + message.user = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + properties.importOptions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify(message.sqlImportOptions); + if (error) + return "sqlImportOptions." + error; + } + } + if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + if (properties.importOptions === 1) + return "importOptions: multiple values"; + properties.importOptions = 1; + { + var error = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify(message.csvImportOptions); + if (error) + return "csvImportOptions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + return null; + }; + + /** + * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest + */ + ImportClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest(); + if (object.sqlImportOptions != null) { + if (typeof object.sqlImportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ImportClusterRequest.sqlImportOptions: object expected"); + message.sqlImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.fromObject(object.sqlImportOptions); + } + if (object.csvImportOptions != null) { + if (typeof object.csvImportOptions !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ImportClusterRequest.csvImportOptions: object expected"); + message.csvImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.fromObject(object.csvImportOptions); + } + if (object.name != null) + message.name = String(object.name); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.database != null) + message.database = String(object.database); + if (object.user != null) + message.user = String(object.user); + return message; + }; + + /** + * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest} message ImportClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.gcsUri = ""; + object.database = ""; + object.user = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + object.sqlImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.toObject(message.sqlImportOptions, options); + if (options.oneofs) + object.importOptions = "sqlImportOptions"; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + object.csvImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.toObject(message.csvImportOptions, options); + if (options.oneofs) + object.importOptions = "csvImportOptions"; + } + return object; + }; + + /** + * Converts this ImportClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @instance + * @returns {Object.} JSON object + */ + ImportClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterRequest"; + }; + + ImportClusterRequest.SqlImportOptions = (function() { + + /** + * Properties of a SqlImportOptions. + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @interface ISqlImportOptions + */ + + /** + * Constructs a new SqlImportOptions. + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @classdesc Represents a SqlImportOptions. + * @implements ISqlImportOptions + * @constructor + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set + */ + function SqlImportOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SqlImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions instance + */ + SqlImportOptions.create = function create(properties) { + return new SqlImportOptions(properties); + }; + + /** + * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlImportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions + */ + SqlImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions) + return object; + return new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions(); + }; + + /** + * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} message SqlImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlImportOptions.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SqlImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @instance + * @returns {Object.} JSON object + */ + SqlImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlImportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions"; + }; + + return SqlImportOptions; + })(); + + ImportClusterRequest.CsvImportOptions = (function() { + + /** + * Properties of a CsvImportOptions. + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @interface ICsvImportOptions + * @property {string|null} [table] CsvImportOptions table + * @property {Array.|null} [columns] CsvImportOptions columns + * @property {string|null} [fieldDelimiter] CsvImportOptions fieldDelimiter + * @property {string|null} [quoteCharacter] CsvImportOptions quoteCharacter + * @property {string|null} [escapeCharacter] CsvImportOptions escapeCharacter + */ + + /** + * Constructs a new CsvImportOptions. + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest + * @classdesc Represents a CsvImportOptions. + * @implements ICsvImportOptions + * @constructor + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set + */ + function CsvImportOptions(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvImportOptions table. + * @member {string} table + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.table = ""; + + /** + * CsvImportOptions columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.columns = $util.emptyArray; + + /** + * CsvImportOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.fieldDelimiter = ""; + + /** + * CsvImportOptions quoteCharacter. + * @member {string} quoteCharacter + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.quoteCharacter = ""; + + /** + * CsvImportOptions escapeCharacter. + * @member {string} escapeCharacter + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @instance + */ + CsvImportOptions.prototype.escapeCharacter = ""; + + /** + * Creates a new CsvImportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions instance + */ + CsvImportOptions.create = function create(properties) { + return new CsvImportOptions(properties); + }; + + /** + * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvImportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldDelimiter); + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.quoteCharacter); + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.escapeCharacter); + return writer; + }; + + /** + * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvImportOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + case 3: { + message.fieldDelimiter = reader.string(); + break; + } + case 4: { + message.quoteCharacter = reader.string(); + break; + } + case 5: { + message.escapeCharacter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvImportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvImportOptions message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvImportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (!$util.isString(message.quoteCharacter)) + return "quoteCharacter: string expected"; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (!$util.isString(message.escapeCharacter)) + return "escapeCharacter: string expected"; + return null; + }; + + /** + * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions + */ + CsvImportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions(); + if (object.table != null) + message.table = String(object.table); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.quoteCharacter != null) + message.quoteCharacter = String(object.quoteCharacter); + if (object.escapeCharacter != null) + message.escapeCharacter = String(object.escapeCharacter); + return message; + }; + + /** + * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} message CsvImportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvImportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.table = ""; + object.fieldDelimiter = ""; + object.quoteCharacter = ""; + object.escapeCharacter = ""; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + object.quoteCharacter = message.quoteCharacter; + if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + object.escapeCharacter = message.escapeCharacter; + return object; + }; + + /** + * Converts this CsvImportOptions to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @instance + * @returns {Object.} JSON object + */ + CsvImportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvImportOptions + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions"; + }; + + return CsvImportOptions; + })(); + + return ImportClusterRequest; + })(); + + v1beta.ImportClusterResponse = (function() { + + /** + * Properties of an ImportClusterResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IImportClusterResponse + * @property {number|Long|null} [bytesDownloaded] ImportClusterResponse bytesDownloaded + */ + + /** + * Constructs a new ImportClusterResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ImportClusterResponse. + * @implements IImportClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IImportClusterResponse=} [properties] Properties to set + */ + function ImportClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportClusterResponse bytesDownloaded. + * @member {number|Long} bytesDownloaded + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @instance + */ + ImportClusterResponse.prototype.bytesDownloaded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImportClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IImportClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse instance + */ + ImportClusterResponse.create = function create(properties) { + return new ImportClusterResponse(properties); + }; + + /** + * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IImportClusterResponse} message ImportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bytesDownloaded != null && Object.hasOwnProperty.call(message, "bytesDownloaded")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bytesDownloaded); + return writer; + }; + + /** + * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IImportClusterResponse} message ImportClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bytesDownloaded = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) + if (!$util.isInteger(message.bytesDownloaded) && !(message.bytesDownloaded && $util.isInteger(message.bytesDownloaded.low) && $util.isInteger(message.bytesDownloaded.high))) + return "bytesDownloaded: integer|Long expected"; + return null; + }; + + /** + * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse + */ + ImportClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ImportClusterResponse(); + if (object.bytesDownloaded != null) + if ($util.Long) + (message.bytesDownloaded = $util.Long.fromValue(object.bytesDownloaded)).unsigned = false; + else if (typeof object.bytesDownloaded === "string") + message.bytesDownloaded = parseInt(object.bytesDownloaded, 10); + else if (typeof object.bytesDownloaded === "number") + message.bytesDownloaded = object.bytesDownloaded; + else if (typeof object.bytesDownloaded === "object") + message.bytesDownloaded = new $util.LongBits(object.bytesDownloaded.low >>> 0, object.bytesDownloaded.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.ImportClusterResponse} message ImportClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDownloaded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDownloaded = options.longs === String ? "0" : 0; + if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) + if (typeof message.bytesDownloaded === "number") + object.bytesDownloaded = options.longs === String ? String(message.bytesDownloaded) : message.bytesDownloaded; + else + object.bytesDownloaded = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDownloaded) : options.longs === Number ? new $util.LongBits(message.bytesDownloaded.low >>> 0, message.bytesDownloaded.high >>> 0).toNumber() : message.bytesDownloaded; + return object; + }; + + /** + * Converts this ImportClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @instance + * @returns {Object.} JSON object + */ + ImportClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterResponse"; + }; + + return ImportClusterResponse; + })(); + + v1beta.UpgradeClusterRequest = (function() { + + /** + * Properties of an UpgradeClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpgradeClusterRequest + * @property {string|null} [name] UpgradeClusterRequest name + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [version] UpgradeClusterRequest version + * @property {string|null} [requestId] UpgradeClusterRequest requestId + * @property {boolean|null} [validateOnly] UpgradeClusterRequest validateOnly + * @property {string|null} [etag] UpgradeClusterRequest etag + */ + + /** + * Constructs a new UpgradeClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpgradeClusterRequest. + * @implements IUpgradeClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest=} [properties] Properties to set + */ + function UpgradeClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.name = ""; + + /** + * UpgradeClusterRequest version. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} version + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.version = 0; + + /** + * UpgradeClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.requestId = ""; + + /** + * UpgradeClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.validateOnly = false; + + /** + * UpgradeClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @instance + */ + UpgradeClusterRequest.prototype.etag = ""; + + /** + * Creates a new UpgradeClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest instance + */ + UpgradeClusterRequest.create = function create(properties) { + return new UpgradeClusterRequest(properties); + }; + + /** + * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.int32(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest + */ + UpgradeClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.version) { + default: + if (typeof object.version === "number") { + message.version = object.version; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.version = 0; + break; + case "POSTGRES_13": + case 1: + message.version = 1; + break; + case "POSTGRES_14": + case 2: + message.version = 2; + break; + case "POSTGRES_15": + case 3: + message.version = 3; + break; + case "POSTGRES_16": + case 4: + message.version = 4; + break; + case "POSTGRES_17": + case 5: + message.version = 5; + break; + case "POSTGRES_18": + case 6: + message.version = 6; + break; + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterRequest} message UpgradeClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.version] === undefined ? message.version : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.version] : message.version; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this UpgradeClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterRequest"; + }; + + return UpgradeClusterRequest; + })(); + + v1beta.UpgradeClusterResponse = (function() { + + /** + * Properties of an UpgradeClusterResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpgradeClusterResponse + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [status] UpgradeClusterResponse status + * @property {string|null} [message] UpgradeClusterResponse message + * @property {Array.|null} [clusterUpgradeDetails] UpgradeClusterResponse clusterUpgradeDetails + */ + + /** + * Constructs a new UpgradeClusterResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpgradeClusterResponse. + * @implements IUpgradeClusterResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse=} [properties] Properties to set + */ + function UpgradeClusterResponse(properties) { + this.clusterUpgradeDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterResponse status. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} status + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.status = 0; + + /** + * UpgradeClusterResponse message. + * @member {string} message + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.message = ""; + + /** + * UpgradeClusterResponse clusterUpgradeDetails. + * @member {Array.} clusterUpgradeDetails + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @instance + */ + UpgradeClusterResponse.prototype.clusterUpgradeDetails = $util.emptyArray; + + /** + * Creates a new UpgradeClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse instance + */ + UpgradeClusterResponse.create = function create(properties) { + return new UpgradeClusterResponse(properties); + }; + + /** + * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.clusterUpgradeDetails != null && message.clusterUpgradeDetails.length) + for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) + $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.encode(message.clusterUpgradeDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.clusterUpgradeDetails && message.clusterUpgradeDetails.length)) + message.clusterUpgradeDetails = []; + message.clusterUpgradeDetails.push($root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.clusterUpgradeDetails != null && message.hasOwnProperty("clusterUpgradeDetails")) { + if (!Array.isArray(message.clusterUpgradeDetails)) + return "clusterUpgradeDetails: array expected"; + for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify(message.clusterUpgradeDetails[i]); + if (error) + return "clusterUpgradeDetails." + error; + } + } + return null; + }; + + /** + * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse + */ + UpgradeClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse(); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 4: + message.status = 4; + break; + case "IN_PROGRESS": + case 5: + message.status = 5; + break; + case "SUCCESS": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.status = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.clusterUpgradeDetails) { + if (!Array.isArray(object.clusterUpgradeDetails)) + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.clusterUpgradeDetails: array expected"); + message.clusterUpgradeDetails = []; + for (var i = 0; i < object.clusterUpgradeDetails.length; ++i) { + if (typeof object.clusterUpgradeDetails[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.clusterUpgradeDetails: object expected"); + message.clusterUpgradeDetails[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.fromObject(object.clusterUpgradeDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse} message UpgradeClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clusterUpgradeDetails = []; + if (options.defaults) { + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] : message.status; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.clusterUpgradeDetails && message.clusterUpgradeDetails.length) { + object.clusterUpgradeDetails = []; + for (var j = 0; j < message.clusterUpgradeDetails.length; ++j) + object.clusterUpgradeDetails[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.toObject(message.clusterUpgradeDetails[j], options); + } + return object; + }; + + /** + * Converts this UpgradeClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse"; + }; + + UpgradeClusterResponse.StageInfo = (function() { + + /** + * Properties of a StageInfo. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @interface IStageInfo + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null} [stage] StageInfo stage + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [status] StageInfo status + * @property {string|null} [logsUrl] StageInfo logsUrl + */ + + /** + * Constructs a new StageInfo. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @classdesc Represents a StageInfo. + * @implements IStageInfo + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set + */ + function StageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageInfo stage. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage} stage + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.stage = 0; + + /** + * StageInfo status. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} status + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.status = 0; + + /** + * StageInfo logsUrl. + * @member {string} logsUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @instance + */ + StageInfo.prototype.logsUrl = ""; + + /** + * Creates a new StageInfo instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo instance + */ + StageInfo.create = function create(properties) { + return new StageInfo(properties); + }; + + /** + * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); + if (message.logsUrl != null && Object.hasOwnProperty.call(message, "logsUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.logsUrl); + return writer; + }; + + /** + * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stage = reader.int32(); + break; + } + case 2: { + message.status = reader.int32(); + break; + } + case 3: { + message.logsUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageInfo message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stage != null && message.hasOwnProperty("stage")) + switch (message.stage) { + default: + return "stage: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) + if (!$util.isString(message.logsUrl)) + return "logsUrl: string expected"; + return null; + }; + + /** + * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo + */ + StageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo(); + switch (object.stage) { + default: + if (typeof object.stage === "number") { + message.stage = object.stage; + break; + } + break; + case "STAGE_UNSPECIFIED": + case 0: + message.stage = 0; + break; + case "ALLOYDB_PRECHECK": + case 1: + message.stage = 1; + break; + case "PG_UPGRADE_CHECK": + case 2: + message.stage = 2; + break; + case "PREPARE_FOR_UPGRADE": + case 5: + message.stage = 5; + break; + case "PRIMARY_INSTANCE_UPGRADE": + case 3: + message.stage = 3; + break; + case "READ_POOL_INSTANCES_UPGRADE": + case 4: + message.stage = 4; + break; + case "ROLLBACK": + case 6: + message.stage = 6; + break; + case "CLEANUP": + case 7: + message.stage = 7; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 4: + message.status = 4; + break; + case "IN_PROGRESS": + case 5: + message.status = 5; + break; + case "SUCCESS": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.status = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + } + if (object.logsUrl != null) + message.logsUrl = String(object.logsUrl); + return message; + }; + + /** + * Creates a plain object from a StageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} message StageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.logsUrl = ""; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] : message.stage; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] : message.status; + if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) + object.logsUrl = message.logsUrl; + return object; + }; + + /** + * Converts this StageInfo to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @instance + * @returns {Object.} JSON object + */ + StageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageInfo + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo"; + }; + + return StageInfo; + })(); + + UpgradeClusterResponse.InstanceUpgradeDetails = (function() { + + /** + * Properties of an InstanceUpgradeDetails. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @interface IInstanceUpgradeDetails + * @property {string|null} [name] InstanceUpgradeDetails name + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [upgradeStatus] InstanceUpgradeDetails upgradeStatus + * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [instanceType] InstanceUpgradeDetails instanceType + */ + + /** + * Constructs a new InstanceUpgradeDetails. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @classdesc Represents an InstanceUpgradeDetails. + * @implements IInstanceUpgradeDetails + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set + */ + function InstanceUpgradeDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceUpgradeDetails name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.name = ""; + + /** + * InstanceUpgradeDetails upgradeStatus. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} upgradeStatus + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.upgradeStatus = 0; + + /** + * InstanceUpgradeDetails instanceType. + * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} instanceType + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + */ + InstanceUpgradeDetails.prototype.instanceType = 0; + + /** + * Creates a new InstanceUpgradeDetails instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails instance + */ + InstanceUpgradeDetails.create = function create(properties) { + return new InstanceUpgradeDetails(properties); + }; + + /** + * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceUpgradeDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.instanceType); + return writer; + }; + + /** + * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceUpgradeDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.upgradeStatus = reader.int32(); + break; + } + case 3: { + message.instanceType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceUpgradeDetails message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceUpgradeDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + switch (message.upgradeStatus) { + default: + return "upgradeStatus: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + switch (message.instanceType) { + default: + return "instanceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails + */ + InstanceUpgradeDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails(); + if (object.name != null) + message.name = String(object.name); + switch (object.upgradeStatus) { + default: + if (typeof object.upgradeStatus === "number") { + message.upgradeStatus = object.upgradeStatus; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.upgradeStatus = 0; + break; + case "NOT_STARTED": + case 4: + message.upgradeStatus = 4; + break; + case "IN_PROGRESS": + case 5: + message.upgradeStatus = 5; + break; + case "SUCCESS": + case 1: + message.upgradeStatus = 1; + break; + case "FAILED": + case 2: + message.upgradeStatus = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.upgradeStatus = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.upgradeStatus = 6; + break; + case "CANCELLED": + case 7: + message.upgradeStatus = 7; + break; + } + switch (object.instanceType) { + default: + if (typeof object.instanceType === "number") { + message.instanceType = object.instanceType; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.instanceType = 0; + break; + case "PRIMARY": + case 1: + message.instanceType = 1; + break; + case "READ_POOL": + case 2: + message.instanceType = 2; + break; + case "SECONDARY": + case 3: + message.instanceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} message InstanceUpgradeDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceUpgradeDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; + if (message.instanceType != null && message.hasOwnProperty("instanceType")) + object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] : message.instanceType; + return object; + }; + + /** + * Converts this InstanceUpgradeDetails to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @instance + * @returns {Object.} JSON object + */ + InstanceUpgradeDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceUpgradeDetails + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails"; + }; + + return InstanceUpgradeDetails; + })(); + + UpgradeClusterResponse.ClusterUpgradeDetails = (function() { + + /** + * Properties of a ClusterUpgradeDetails. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @interface IClusterUpgradeDetails + * @property {string|null} [name] ClusterUpgradeDetails name + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [upgradeStatus] ClusterUpgradeDetails upgradeStatus + * @property {google.cloud.alloydb.v1beta.Cluster.ClusterType|null} [clusterType] ClusterUpgradeDetails clusterType + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] ClusterUpgradeDetails databaseVersion + * @property {Array.|null} [stageInfo] ClusterUpgradeDetails stageInfo + * @property {Array.|null} [instanceUpgradeDetails] ClusterUpgradeDetails instanceUpgradeDetails + */ + + /** + * Constructs a new ClusterUpgradeDetails. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse + * @classdesc Represents a ClusterUpgradeDetails. + * @implements IClusterUpgradeDetails + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set + */ + function ClusterUpgradeDetails(properties) { + this.stageInfo = []; + this.instanceUpgradeDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterUpgradeDetails name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.name = ""; + + /** + * ClusterUpgradeDetails upgradeStatus. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} upgradeStatus + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.upgradeStatus = 0; + + /** + * ClusterUpgradeDetails clusterType. + * @member {google.cloud.alloydb.v1beta.Cluster.ClusterType} clusterType + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.clusterType = 0; + + /** + * ClusterUpgradeDetails databaseVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.databaseVersion = 0; + + /** + * ClusterUpgradeDetails stageInfo. + * @member {Array.} stageInfo + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.stageInfo = $util.emptyArray; + + /** + * ClusterUpgradeDetails instanceUpgradeDetails. + * @member {Array.} instanceUpgradeDetails + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + */ + ClusterUpgradeDetails.prototype.instanceUpgradeDetails = $util.emptyArray; + + /** + * Creates a new ClusterUpgradeDetails instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails instance + */ + ClusterUpgradeDetails.create = function create(properties) { + return new ClusterUpgradeDetails(properties); + }; + + /** + * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUpgradeDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.clusterType); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.databaseVersion); + if (message.stageInfo != null && message.stageInfo.length) + for (var i = 0; i < message.stageInfo.length; ++i) + $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.encode(message.stageInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.instanceUpgradeDetails != null && message.instanceUpgradeDetails.length) + for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) + $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.encode(message.instanceUpgradeDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUpgradeDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.upgradeStatus = reader.int32(); + break; + } + case 3: { + message.clusterType = reader.int32(); + break; + } + case 4: { + message.databaseVersion = reader.int32(); + break; + } + case 5: { + if (!(message.stageInfo && message.stageInfo.length)) + message.stageInfo = []; + message.stageInfo.push($root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.instanceUpgradeDetails && message.instanceUpgradeDetails.length)) + message.instanceUpgradeDetails = []; + message.instanceUpgradeDetails.push($root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterUpgradeDetails message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterUpgradeDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + switch (message.upgradeStatus) { + default: + return "upgradeStatus: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stageInfo != null && message.hasOwnProperty("stageInfo")) { + if (!Array.isArray(message.stageInfo)) + return "stageInfo: array expected"; + for (var i = 0; i < message.stageInfo.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify(message.stageInfo[i]); + if (error) + return "stageInfo." + error; + } + } + if (message.instanceUpgradeDetails != null && message.hasOwnProperty("instanceUpgradeDetails")) { + if (!Array.isArray(message.instanceUpgradeDetails)) + return "instanceUpgradeDetails: array expected"; + for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify(message.instanceUpgradeDetails[i]); + if (error) + return "instanceUpgradeDetails." + error; + } + } + return null; + }; + + /** + * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails + */ + ClusterUpgradeDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails(); + if (object.name != null) + message.name = String(object.name); + switch (object.upgradeStatus) { + default: + if (typeof object.upgradeStatus === "number") { + message.upgradeStatus = object.upgradeStatus; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.upgradeStatus = 0; + break; + case "NOT_STARTED": + case 4: + message.upgradeStatus = 4; + break; + case "IN_PROGRESS": + case 5: + message.upgradeStatus = 5; + break; + case "SUCCESS": + case 1: + message.upgradeStatus = 1; + break; + case "FAILED": + case 2: + message.upgradeStatus = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.upgradeStatus = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.upgradeStatus = 6; + break; + case "CANCELLED": + case 7: + message.upgradeStatus = 7; + break; + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "PRIMARY": + case 1: + message.clusterType = 1; + break; + case "SECONDARY": + case 2: + message.clusterType = 2; + break; + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.databaseVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.databaseVersion = 6; + break; + } + if (object.stageInfo) { + if (!Array.isArray(object.stageInfo)) + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: array expected"); + message.stageInfo = []; + for (var i = 0; i < object.stageInfo.length; ++i) { + if (typeof object.stageInfo[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: object expected"); + message.stageInfo[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.fromObject(object.stageInfo[i]); + } + } + if (object.instanceUpgradeDetails) { + if (!Array.isArray(object.instanceUpgradeDetails)) + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: array expected"); + message.instanceUpgradeDetails = []; + for (var i = 0; i < object.instanceUpgradeDetails.length; ++i) { + if (typeof object.instanceUpgradeDetails[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: object expected"); + message.instanceUpgradeDetails[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.fromObject(object.instanceUpgradeDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} message ClusterUpgradeDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterUpgradeDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.stageInfo = []; + object.instanceUpgradeDetails = []; + } + if (options.defaults) { + object.name = ""; + object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] : message.clusterType; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; + if (message.stageInfo && message.stageInfo.length) { + object.stageInfo = []; + for (var j = 0; j < message.stageInfo.length; ++j) + object.stageInfo[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.toObject(message.stageInfo[j], options); + } + if (message.instanceUpgradeDetails && message.instanceUpgradeDetails.length) { + object.instanceUpgradeDetails = []; + for (var j = 0; j < message.instanceUpgradeDetails.length; ++j) + object.instanceUpgradeDetails[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.toObject(message.instanceUpgradeDetails[j], options); + } + return object; + }; + + /** + * Converts this ClusterUpgradeDetails to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @instance + * @returns {Object.} JSON object + */ + ClusterUpgradeDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterUpgradeDetails + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails"; + }; + + return ClusterUpgradeDetails; + })(); + + /** + * Status enum. + * @name google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} NOT_STARTED=4 NOT_STARTED value + * @property {number} IN_PROGRESS=5 IN_PROGRESS value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} FAILED=2 FAILED value + * @property {number} PARTIAL_SUCCESS=3 PARTIAL_SUCCESS value + * @property {number} CANCEL_IN_PROGRESS=6 CANCEL_IN_PROGRESS value + * @property {number} CANCELLED=7 CANCELLED value + */ + UpgradeClusterResponse.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[4] = "NOT_STARTED"] = 4; + values[valuesById[5] = "IN_PROGRESS"] = 5; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "PARTIAL_SUCCESS"] = 3; + values[valuesById[6] = "CANCEL_IN_PROGRESS"] = 6; + values[valuesById[7] = "CANCELLED"] = 7; + return values; + })(); + + /** + * Stage enum. + * @name google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage + * @enum {number} + * @property {number} STAGE_UNSPECIFIED=0 STAGE_UNSPECIFIED value + * @property {number} ALLOYDB_PRECHECK=1 ALLOYDB_PRECHECK value + * @property {number} PG_UPGRADE_CHECK=2 PG_UPGRADE_CHECK value + * @property {number} PREPARE_FOR_UPGRADE=5 PREPARE_FOR_UPGRADE value + * @property {number} PRIMARY_INSTANCE_UPGRADE=3 PRIMARY_INSTANCE_UPGRADE value + * @property {number} READ_POOL_INSTANCES_UPGRADE=4 READ_POOL_INSTANCES_UPGRADE value + * @property {number} ROLLBACK=6 ROLLBACK value + * @property {number} CLEANUP=7 CLEANUP value + */ + UpgradeClusterResponse.Stage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOYDB_PRECHECK"] = 1; + values[valuesById[2] = "PG_UPGRADE_CHECK"] = 2; + values[valuesById[5] = "PREPARE_FOR_UPGRADE"] = 5; + values[valuesById[3] = "PRIMARY_INSTANCE_UPGRADE"] = 3; + values[valuesById[4] = "READ_POOL_INSTANCES_UPGRADE"] = 4; + values[valuesById[6] = "ROLLBACK"] = 6; + values[valuesById[7] = "CLEANUP"] = 7; + return values; + })(); + + return UpgradeClusterResponse; + })(); + + v1beta.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + * @property {string|null} [etag] DeleteClusterRequest etag + * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly + * @property {boolean|null} [force] DeleteClusterRequest force + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * DeleteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.etag = ""; + + /** + * DeleteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.validateOnly = false; + + /** + * DeleteClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.force = false; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1beta.SwitchoverClusterRequest = (function() { + + /** + * Properties of a SwitchoverClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ISwitchoverClusterRequest + * @property {string|null} [name] SwitchoverClusterRequest name + * @property {string|null} [requestId] SwitchoverClusterRequest requestId + * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly + */ + + /** + * Constructs a new SwitchoverClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SwitchoverClusterRequest. + * @implements ISwitchoverClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest=} [properties] Properties to set + */ + function SwitchoverClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SwitchoverClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.name = ""; + + /** + * SwitchoverClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.requestId = ""; + + /** + * SwitchoverClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @instance + */ + SwitchoverClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new SwitchoverClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest instance + */ + SwitchoverClusterRequest.create = function create(properties) { + return new SwitchoverClusterRequest(properties); + }; + + /** + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchoverClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchoverClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SwitchoverClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SwitchoverClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest + */ + SwitchoverClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} message SwitchoverClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwitchoverClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this SwitchoverClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @instance + * @returns {Object.} JSON object + */ + SwitchoverClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SwitchoverClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SwitchoverClusterRequest"; + }; + + return SwitchoverClusterRequest; + })(); + + v1beta.PromoteClusterRequest = (function() { + + /** + * Properties of a PromoteClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IPromoteClusterRequest + * @property {string|null} [name] PromoteClusterRequest name + * @property {string|null} [requestId] PromoteClusterRequest requestId + * @property {string|null} [etag] PromoteClusterRequest etag + * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly + */ + + /** + * Constructs a new PromoteClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set + */ + function PromoteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromoteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.name = ""; + + /** + * PromoteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.requestId = ""; + + /** + * PromoteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.etag = ""; + + /** + * PromoteClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @instance + */ + PromoteClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new PromoteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest instance + */ + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); + }; + + /** + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromoteClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromoteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest + */ + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.PromoteClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.PromoteClusterRequest} message PromoteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromoteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this PromoteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PromoteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromoteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.PromoteClusterRequest"; + }; + + return PromoteClusterRequest; + })(); + + v1beta.RestoreClusterRequest = (function() { + + /** + * Properties of a RestoreClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IRestoreClusterRequest + * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource + * @property {google.cloud.alloydb.v1beta.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource + * @property {string|null} [parent] RestoreClusterRequest parent + * @property {string|null} [clusterId] RestoreClusterRequest clusterId + * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] RestoreClusterRequest cluster + * @property {string|null} [requestId] RestoreClusterRequest requestId + * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly + */ + + /** + * Constructs a new RestoreClusterRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set + */ + function RestoreClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.backupSource = null; + + /** + * RestoreClusterRequest continuousBackupSource. + * @member {google.cloud.alloydb.v1beta.IContinuousBackupSource|null|undefined} continuousBackupSource + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.continuousBackupSource = null; + + /** + * RestoreClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.parent = ""; + + /** + * RestoreClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.clusterId = ""; + + /** + * RestoreClusterRequest cluster. + * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.cluster = null; + + /** + * RestoreClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.requestId = ""; + + /** + * RestoreClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + */ + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest instance + */ + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); + }; + + /** + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) + $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) + $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreClusterRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); + if (error) + return "backupSource." + error; + } + } + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.verify(message.continuousBackupSource); + if (error) + return "continuousBackupSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest + */ + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.RestoreClusterRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); + if (object.backupSource != null) { + if (typeof object.backupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.backupSource: object expected"); + message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); + } + if (object.continuousBackupSource != null) { + if (typeof object.continuousBackupSource !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.continuousBackupSource: object expected"); + message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.fromObject(object.continuousBackupSource); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {google.cloud.alloydb.v1beta.RestoreClusterRequest} message RestoreClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); + if (message.backupSource != null && message.hasOwnProperty("backupSource")) { + object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); + if (options.oneofs) + object.source = "backupSource"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { + object.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.toObject(message.continuousBackupSource, options); + if (options.oneofs) + object.source = "continuousBackupSource"; + } + return object; + }; + + /** + * Converts this RestoreClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreClusterRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestoreClusterRequest"; + }; + + return RestoreClusterRequest; + })(); + + v1beta.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1beta.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1beta.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1beta.InstanceView|null} [view] GetInstanceRequest view + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1beta.InstanceView} view + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.view = 0; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INSTANCE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "INSTANCE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "INSTANCE_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.InstanceView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1beta.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.requestId = ""; + + /** + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1beta.CreateSecondaryInstanceRequest = (function() { + + /** + * Properties of a CreateSecondaryInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateSecondaryInstanceRequest + * @property {string|null} [parent] CreateSecondaryInstanceRequest parent + * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId + * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateSecondaryInstanceRequest instance + * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId + * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateSecondaryInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set + */ + function CreateSecondaryInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecondaryInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.parent = ""; + + /** + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.instanceId = ""; + + /** + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.instance = null; + + /** + * CreateSecondaryInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.requestId = ""; + + /** + * CreateSecondaryInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @instance + */ + CreateSecondaryInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance + */ + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecondaryInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecondaryInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + */ + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateSecondaryInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSecondaryInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest"; + }; + + return CreateSecondaryInstanceRequest; + })(); + + v1beta.CreateInstanceRequests = (function() { + + /** + * Properties of a CreateInstanceRequests. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + */ + + /** + * Constructs a new CreateInstanceRequests. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set + */ + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @instance + */ + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + + /** + * Creates a new CreateInstanceRequests instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests instance + */ + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); + }; + + /** + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequests.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createInstanceRequests != null && message.createInstanceRequests.length) + for (var i = 0; i < message.createInstanceRequests.length; ++i) + $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequests.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1beta.CreateInstanceRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequests message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequests.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { + if (!Array.isArray(message.createInstanceRequests)) + return "createInstanceRequests: array expected"; + for (var i = 0; i < message.createInstanceRequests.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.verify(message.createInstanceRequests[i]); + if (error) + return "createInstanceRequests." + error; + } + } + return null; + }; + + /** + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests + */ + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequests) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); + if (object.createInstanceRequests) { + if (!Array.isArray(object.createInstanceRequests)) + throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: array expected"); + message.createInstanceRequests = []; + for (var i = 0; i < object.createInstanceRequests.length; ++i) { + if (typeof object.createInstanceRequests[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: object expected"); + message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {google.cloud.alloydb.v1beta.CreateInstanceRequests} message CreateInstanceRequests + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequests.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.createInstanceRequests = []; + if (message.createInstanceRequests && message.createInstanceRequests.length) { + object.createInstanceRequests = []; + for (var j = 0; j < message.createInstanceRequests.length; ++j) + object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); + } + return object; + }; + + /** + * Converts this CreateInstanceRequests to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequests.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequests + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequests"; + }; + + return CreateInstanceRequests; + })(); + + v1beta.BatchCreateInstancesRequest = (function() { + + /** + * Properties of a BatchCreateInstancesRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IBatchCreateInstancesRequest + * @property {string|null} [parent] BatchCreateInstancesRequest parent + * @property {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests + * @property {string|null} [requestId] BatchCreateInstancesRequest requestId + */ + + /** + * Constructs a new BatchCreateInstancesRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set + */ + function BatchCreateInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.parent = ""; + + /** + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requests = null; + + /** + * BatchCreateInstancesRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @instance + */ + BatchCreateInstancesRequest.prototype.requestId = ""; + + /** + * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + */ + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) + $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.verify(message.requests); + if (error) + return "requests." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest + */ + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests != null) { + if (typeof object.requests !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.requests: object expected"); + message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.fromObject(object.requests); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requests = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests != null && message.hasOwnProperty("requests")) + object.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.toObject(message.requests, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this BatchCreateInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesRequest"; + }; + + return BatchCreateInstancesRequest; + })(); + + v1beta.BatchCreateInstancesResponse = (function() { + + /** + * Properties of a BatchCreateInstancesResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + */ + + /** + * Constructs a new BatchCreateInstancesResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set + */ + function BatchCreateInstancesResponse(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @instance + */ + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + */ + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse + */ + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesResponse"; + }; + + return BatchCreateInstancesResponse; + })(); + + v1beta.BatchCreateInstancesMetadata = (function() { + + /** + * Properties of a BatchCreateInstancesMetadata. + * @memberof google.cloud.alloydb.v1beta + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + */ + + /** + * Constructs a new BatchCreateInstancesMetadata. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata + * @constructor + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set + */ + function BatchCreateInstancesMetadata(properties) { + this.instanceTargets = []; + this.instanceStatuses = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @instance + */ + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + + /** + * BatchCreateInstancesMetadata instanceStatuses. + * @member {Object.} instanceStatuses + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @instance + */ + BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + + /** + * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + */ + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); + }; + + /** + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTargets != null && message.instanceTargets.length) + for (var i = 0; i < message.instanceTargets.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); + if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) + for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instanceTargets && message.instanceTargets.length)) + message.instanceTargets = []; + message.instanceTargets.push(reader.string()); + break; + } + case 2: { + if (message.instanceStatuses === $util.emptyObject) + message.instanceStatuses = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.instanceStatuses[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstancesMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstancesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { + if (!Array.isArray(message.instanceTargets)) + return "instanceTargets: array expected"; + for (var i = 0; i < message.instanceTargets.length; ++i) + if (!$util.isString(message.instanceTargets[i])) + return "instanceTargets: string[] expected"; + } + if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { + if (!$util.isObject(message.instanceStatuses)) + return "instanceStatuses: object expected"; + var key = Object.keys(message.instanceStatuses); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); + if (error) + return "instanceStatuses." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + */ + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(); + if (object.instanceTargets) { + if (!Array.isArray(object.instanceTargets)) + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceTargets: array expected"); + message.instanceTargets = []; + for (var i = 0; i < object.instanceTargets.length; ++i) + message.instanceTargets[i] = String(object.instanceTargets[i]); + } + if (object.instanceStatuses) { + if (typeof object.instanceStatuses !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses = {}; + for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { + if (typeof object.instanceStatuses[keys[i]] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); + message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceTargets = []; + if (options.objects || options.defaults) + object.instanceStatuses = {}; + if (message.instanceTargets && message.instanceTargets.length) { + object.instanceTargets = []; + for (var j = 0; j < message.instanceTargets.length; ++j) + object.instanceTargets[j] = message.instanceTargets[j]; + } + var keys2; + if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { + object.instanceStatuses = {}; + for (var j = 0; j < keys2.length; ++j) + object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); + } + return object; + }; + + /** + * Converts this BatchCreateInstancesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstancesMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata"; + }; + + return BatchCreateInstancesMetadata; + })(); + + v1beta.BatchCreateInstanceStatus = (function() { + + /** + * Properties of a BatchCreateInstanceStatus. + * @memberof google.cloud.alloydb.v1beta + * @interface IBatchCreateInstanceStatus + * @property {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state + * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg + * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error + * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type + */ + + /** + * Constructs a new BatchCreateInstanceStatus. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus + * @constructor + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set + */ + function BatchCreateInstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.state = 0; + + /** + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.errorMsg = ""; + + /** + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.error = null; + + /** + * BatchCreateInstanceStatus type. + * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} type + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + */ + BatchCreateInstanceStatus.prototype.type = 0; + + /** + * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + */ + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); + }; + + /** + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstanceStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.errorMsg = reader.string(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateInstanceStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateInstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + if (!$util.isString(message.errorMsg)) + return "errorMsg: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus + */ + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) + return object; + var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING_CREATE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ROLLED_BACK": + case 6: + message.state = 6; + break; + } + if (object.errorMsg != null) + message.errorMsg = String(object.errorMsg); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PRIMARY": + case 1: + message.type = 1; + break; + case "READ_POOL": + case 2: + message.type = 2; + break; + case "SECONDARY": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateInstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] : message.state; + if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) + object.errorMsg = message.errorMsg; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] : message.type; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this BatchCreateInstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @instance + * @returns {Object.} JSON object + */ + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateInstanceStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstanceStatus"; + }; + + /** + * State enum. + * @name google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING_CREATE=1 PENDING_CREATE value + * @property {number} READY=2 READY value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED=5 FAILED value + * @property {number} ROLLED_BACK=6 ROLLED_BACK value + */ + BatchCreateInstanceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_CREATE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ROLLED_BACK"] = 6; + return values; + })(); + + return BatchCreateInstanceStatus; + })(); + + v1beta.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.requestId = ""; + + /** + * UpdateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.validateOnly = false; + + /** + * UpdateInstanceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1beta.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [etag] DeleteInstanceRequest etag + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.requestId = ""; + + /** + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1beta.FailoverInstanceRequest = (function() { + + /** + * Properties of a FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly + */ + + /** + * Constructs a new FailoverInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set + */ + function FailoverInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.name = ""; + + /** + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.requestId = ""; + + /** + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @instance + */ + FailoverInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new FailoverInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest instance + */ + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); + }; + + /** + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailoverInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailoverInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FailoverInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FailoverInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest + */ + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FailoverInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this FailoverInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + FailoverInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FailoverInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.FailoverInstanceRequest"; + }; + + return FailoverInstanceRequest; + })(); + + v1beta.InjectFaultRequest = (function() { + + /** + * Properties of an InjectFaultRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IInjectFaultRequest + * @property {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType + * @property {string|null} [name] InjectFaultRequest name + * @property {string|null} [requestId] InjectFaultRequest requestId + * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly + */ + + /** + * Constructs a new InjectFaultRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest=} [properties] Properties to set + */ + function InjectFaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.faultType = 0; + + /** + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.name = ""; + + /** + * InjectFaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.requestId = ""; + + /** + * InjectFaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @instance + */ + InjectFaultRequest.prototype.validateOnly = false; + + /** + * Creates a new InjectFaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest instance + */ + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); + }; + + /** + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectFaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectFaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.InjectFaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.faultType = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InjectFaultRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InjectFaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faultType != null && message.hasOwnProperty("faultType")) + switch (message.faultType) { + default: + return "faultType: enum value expected"; + case 0: + case 1: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest + */ + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.InjectFaultRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.InjectFaultRequest(); + switch (object.faultType) { + default: + if (typeof object.faultType === "number") { + message.faultType = object.faultType; + break; + } + break; + case "FAULT_TYPE_UNSPECIFIED": + case 0: + message.faultType = 0; + break; + case "STOP_VM": + case 1: + message.faultType = 1; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {google.cloud.alloydb.v1beta.InjectFaultRequest} message InjectFaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InjectFaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.faultType != null && message.hasOwnProperty("faultType")) + object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType[message.faultType] : message.faultType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this InjectFaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @instance + * @returns {Object.} JSON object + */ + InjectFaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InjectFaultRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.InjectFaultRequest"; + }; + + /** + * FaultType enum. + * @name google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType + * @enum {number} + * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value + * @property {number} STOP_VM=1 STOP_VM value + */ + InjectFaultRequest.FaultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP_VM"] = 1; + return values; + })(); + + return InjectFaultRequest; + })(); + + v1beta.RestartInstanceRequest = (function() { + + /** + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + * @property {string|null} [requestId] RestartInstanceRequest requestId + * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly + * @property {Array.|null} [nodeIds] RestartInstanceRequest nodeIds + */ + + /** + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set + */ + function RestartInstanceRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.name = ""; + + /** + * RestartInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.requestId = ""; + + /** + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.validateOnly = false; + + /** + * RestartInstanceRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest instance + */ + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); + }; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeIds[i]); + return writer; + }; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartInstanceRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest + */ + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.RestartInstanceRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.alloydb.v1beta.RestartInstanceRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {google.cloud.alloydb.v1beta.RestartInstanceRequest} message RestartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + return object; + }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestartInstanceRequest"; + }; + + return RestartInstanceRequest; + })(); + + v1beta.ExecuteSqlRequest = (function() { + + /** + * Properties of an ExecuteSqlRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IExecuteSqlRequest + * @property {string|null} [password] ExecuteSqlRequest password + * @property {string|null} [instance] ExecuteSqlRequest instance + * @property {string|null} [database] ExecuteSqlRequest database + * @property {string|null} [user] ExecuteSqlRequest user + * @property {string|null} [sqlStatement] ExecuteSqlRequest sqlStatement + * @property {boolean|null} [validateOnly] ExecuteSqlRequest validateOnly + */ + + /** + * Constructs a new ExecuteSqlRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest=} [properties] Properties to set + */ + function ExecuteSqlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlRequest password. + * @member {string|null|undefined} password + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.password = null; + + /** + * ExecuteSqlRequest instance. + * @member {string} instance + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.instance = ""; + + /** + * ExecuteSqlRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.database = ""; + + /** + * ExecuteSqlRequest user. + * @member {string} user + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.user = ""; + + /** + * ExecuteSqlRequest sqlStatement. + * @member {string} sqlStatement + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.sqlStatement = ""; + + /** + * ExecuteSqlRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + ExecuteSqlRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecuteSqlRequest userCredential. + * @member {"password"|undefined} userCredential + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + */ + Object.defineProperty(ExecuteSqlRequest.prototype, "userCredential", { + get: $util.oneOfGetter($oneOfFields = ["password"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecuteSqlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest instance + */ + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); + }; + + /** + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlStatement); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.password); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.password = reader.string(); + break; + } + case 1: { + message.instance = reader.string(); + break; + } + case 2: { + message.database = reader.string(); + break; + } + case 3: { + message.user = reader.string(); + break; + } + case 4: { + message.sqlStatement = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.password != null && message.hasOwnProperty("password")) { + properties.userCredential = 1; + if (!$util.isString(message.password)) + return "password: string expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (!$util.isString(message.sqlStatement)) + return "sqlStatement: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest + */ + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest(); + if (object.password != null) + message.password = String(object.password); + if (object.instance != null) + message.instance = String(object.instance); + if (object.database != null) + message.database = String(object.database); + if (object.user != null) + message.user = String(object.user); + if (object.sqlStatement != null) + message.sqlStatement = String(object.sqlStatement); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {google.cloud.alloydb.v1beta.ExecuteSqlRequest} message ExecuteSqlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = ""; + object.database = ""; + object.user = ""; + object.sqlStatement = ""; + object.validateOnly = false; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + object.sqlStatement = message.sqlStatement; + if (message.password != null && message.hasOwnProperty("password")) { + object.password = message.password; + if (options.oneofs) + object.userCredential = "password"; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this ExecuteSqlRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExecuteSqlRequest"; + }; + + return ExecuteSqlRequest; + })(); + + v1beta.ExecuteSqlResponse = (function() { + + /** + * Properties of an ExecuteSqlResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IExecuteSqlResponse + * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults + * @property {google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata + */ + + /** + * Constructs a new ExecuteSqlResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ExecuteSqlResponse. + * @implements IExecuteSqlResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse=} [properties] Properties to set + */ + function ExecuteSqlResponse(properties) { + this.sqlResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlResponse sqlResults. + * @member {Array.} sqlResults + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @instance + */ + ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; + + /** + * ExecuteSqlResponse metadata. + * @member {google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null|undefined} metadata + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @instance + */ + ExecuteSqlResponse.prototype.metadata = null; + + /** + * Creates a new ExecuteSqlResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse instance + */ + ExecuteSqlResponse.create = function create(properties) { + return new ExecuteSqlResponse(properties); + }; + + /** + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sqlResults != null && message.sqlResults.length) + for (var i = 0; i < message.sqlResults.length; ++i) + $root.google.cloud.alloydb.v1beta.SqlResult.encode(message.sqlResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sqlResults && message.sqlResults.length)) + message.sqlResults = []; + message.sqlResults.push($root.google.cloud.alloydb.v1beta.SqlResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.metadata = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sqlResults != null && message.hasOwnProperty("sqlResults")) { + if (!Array.isArray(message.sqlResults)) + return "sqlResults: array expected"; + for (var i = 0; i < message.sqlResults.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.SqlResult.verify(message.sqlResults[i]); + if (error) + return "sqlResults." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse + */ + ExecuteSqlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse(); + if (object.sqlResults) { + if (!Array.isArray(object.sqlResults)) + throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlResponse.sqlResults: array expected"); + message.sqlResults = []; + for (var i = 0; i < object.sqlResults.length; ++i) { + if (typeof object.sqlResults[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlResponse.sqlResults: object expected"); + message.sqlResults[i] = $root.google.cloud.alloydb.v1beta.SqlResult.fromObject(object.sqlResults[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlResponse.metadata: object expected"); + message.metadata = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {google.cloud.alloydb.v1beta.ExecuteSqlResponse} message ExecuteSqlResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sqlResults = []; + if (options.defaults) + object.metadata = null; + if (message.sqlResults && message.sqlResults.length) { + object.sqlResults = []; + for (var j = 0; j < message.sqlResults.length; ++j) + object.sqlResults[j] = $root.google.cloud.alloydb.v1beta.SqlResult.toObject(message.sqlResults[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this ExecuteSqlResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExecuteSqlResponse"; + }; + + return ExecuteSqlResponse; + })(); + + v1beta.ExecuteSqlMetadata = (function() { + + /** + * Properties of an ExecuteSqlMetadata. + * @memberof google.cloud.alloydb.v1beta + * @interface IExecuteSqlMetadata + * @property {string|null} [message] ExecuteSqlMetadata message + * @property {boolean|null} [partialResult] ExecuteSqlMetadata partialResult + * @property {google.protobuf.IDuration|null} [sqlStatementExecutionDuration] ExecuteSqlMetadata sqlStatementExecutionDuration + * @property {google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|null} [status] ExecuteSqlMetadata status + */ + + /** + * Constructs a new ExecuteSqlMetadata. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an ExecuteSqlMetadata. + * @implements IExecuteSqlMetadata + * @constructor + * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata=} [properties] Properties to set + */ + function ExecuteSqlMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteSqlMetadata message. + * @member {string} message + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.message = ""; + + /** + * ExecuteSqlMetadata partialResult. + * @member {boolean} partialResult + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.partialResult = false; + + /** + * ExecuteSqlMetadata sqlStatementExecutionDuration. + * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; + + /** + * ExecuteSqlMetadata status. + * @member {google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status} status + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @instance + */ + ExecuteSqlMetadata.prototype.status = 0; + + /** + * Creates a new ExecuteSqlMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata instance + */ + ExecuteSqlMetadata.create = function create(properties) { + return new ExecuteSqlMetadata(properties); + }; + + /** + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialResult); + if (message.sqlStatementExecutionDuration != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionDuration")) + $root.google.protobuf.Duration.encode(message.sqlStatementExecutionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + return writer; + }; + + /** + * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.partialResult = reader.bool(); + break; + } + case 3: { + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteSqlMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteSqlMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.partialResult != null && message.hasOwnProperty("partialResult")) + if (typeof message.partialResult !== "boolean") + return "partialResult: boolean expected"; + if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) { + var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionDuration); + if (error) + return "sqlStatementExecutionDuration." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata + */ + ExecuteSqlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata(); + if (object.message != null) + message.message = String(object.message); + if (object.partialResult != null) + message.partialResult = Boolean(object.partialResult); + if (object.sqlStatementExecutionDuration != null) { + if (typeof object.sqlStatementExecutionDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlMetadata.sqlStatementExecutionDuration: object expected"); + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionDuration); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "OK": + case 1: + message.status = 1; + break; + case "PARTIAL": + case 2: + message.status = 2; + break; + case "ERROR": + case 3: + message.status = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} message ExecuteSqlMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteSqlMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.partialResult = false; + object.sqlStatementExecutionDuration = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.partialResult != null && message.hasOwnProperty("partialResult")) + object.partialResult = message.partialResult; + if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) + object.sqlStatementExecutionDuration = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionDuration, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status[message.status] : message.status; + return object; + }; + + /** + * Converts this ExecuteSqlMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @instance + * @returns {Object.} JSON object + */ + ExecuteSqlMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteSqlMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExecuteSqlMetadata"; + }; + + /** + * Status enum. + * @name google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} PARTIAL=2 PARTIAL value + * @property {number} ERROR=3 ERROR value + */ + ExecuteSqlMetadata.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "PARTIAL"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return ExecuteSqlMetadata; + })(); + + v1beta.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {google.cloud.alloydb.v1beta.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1beta.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.alloydb.v1beta.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1beta.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1beta.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {string|null} [backupId] CreateBackupRequest backupId + * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [requestId] CreateBackupRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.requestId = ""; + + /** + * CreateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupId = reader.string(); + break; + } + case 3: { + message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupId != null) + message.backupId = String(object.backupId); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupId = ""; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1beta.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; + + /** + * UpdateBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.validateOnly = false; + + /** + * UpdateBackupRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1beta.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly + * @property {string|null} [etag] DeleteBackupRequest etag + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; + + /** + * DeleteBackupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.validateOnly = false; + + /** + * DeleteBackupRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {google.cloud.alloydb.v1beta.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1beta.ListSupportedDatabaseFlagsRequest = (function() { + + /** + * Properties of a ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListSupportedDatabaseFlagsRequest + * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent + * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize + * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken + * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null} [scope] ListSupportedDatabaseFlagsRequest scope + */ + + /** + * Constructs a new ListSupportedDatabaseFlagsRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListSupportedDatabaseFlagsRequest. + * @implements IListSupportedDatabaseFlagsRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + */ + function ListSupportedDatabaseFlagsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSupportedDatabaseFlagsRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.parent = ""; + + /** + * ListSupportedDatabaseFlagsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; + + /** + * ListSupportedDatabaseFlagsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; + + /** + * ListSupportedDatabaseFlagsRequest scope. + * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} scope + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @instance + */ + ListSupportedDatabaseFlagsRequest.prototype.scope = 0; + + /** + * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance + */ + ListSupportedDatabaseFlagsRequest.create = function create(properties) { + return new ListSupportedDatabaseFlagsRequest(properties); + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); + return writer; + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSupportedDatabaseFlagsRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSupportedDatabaseFlagsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest + */ + ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "DATABASE": + case 1: + message.scope = 1; + break; + case "CONNECTION_POOL": + case 2: + message.scope = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] : message.scope; + return object; + }; + + /** + * Converts this ListSupportedDatabaseFlagsRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest"; + }; + + return ListSupportedDatabaseFlagsRequest; + })(); + + v1beta.ListSupportedDatabaseFlagsResponse = (function() { + + /** + * Properties of a ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListSupportedDatabaseFlagsResponse + * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags + * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken + */ + + /** + * Constructs a new ListSupportedDatabaseFlagsResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListSupportedDatabaseFlagsResponse. + * @implements IListSupportedDatabaseFlagsResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + */ + function ListSupportedDatabaseFlagsResponse(properties) { + this.supportedDatabaseFlags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. + * @member {Array.} supportedDatabaseFlags + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @instance + */ + ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; + + /** + * ListSupportedDatabaseFlagsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @instance + */ + ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance + */ + ListSupportedDatabaseFlagsResponse.create = function create(properties) { + return new ListSupportedDatabaseFlagsResponse(properties); + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) + $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) + message.supportedDatabaseFlags = []; + message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSupportedDatabaseFlagsResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSupportedDatabaseFlagsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { + if (!Array.isArray(message.supportedDatabaseFlags)) + return "supportedDatabaseFlags: array expected"; + for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); + if (error) + return "supportedDatabaseFlags." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse + */ + ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); + if (object.supportedDatabaseFlags) { + if (!Array.isArray(object.supportedDatabaseFlags)) + throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); + message.supportedDatabaseFlags = []; + for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { + if (typeof object.supportedDatabaseFlags[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); + message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedDatabaseFlags = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { + object.supportedDatabaseFlags = []; + for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) + object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSupportedDatabaseFlagsResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSupportedDatabaseFlagsResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse"; + }; + + return ListSupportedDatabaseFlagsResponse; + })(); + + v1beta.GenerateClientCertificateRequest = (function() { + + /** + * Properties of a GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IGenerateClientCertificateRequest + * @property {string|null} [parent] GenerateClientCertificateRequest parent + * @property {string|null} [requestId] GenerateClientCertificateRequest requestId + * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr + * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration + * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey + * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange + */ + + /** + * Constructs a new GenerateClientCertificateRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GenerateClientCertificateRequest. + * @implements IGenerateClientCertificateRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set + */ + function GenerateClientCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateClientCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.parent = ""; + + /** + * GenerateClientCertificateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.requestId = ""; + + /** + * GenerateClientCertificateRequest pemCsr. + * @member {string} pemCsr + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.pemCsr = ""; + + /** + * GenerateClientCertificateRequest certDuration. + * @member {google.protobuf.IDuration|null|undefined} certDuration + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.certDuration = null; + + /** + * GenerateClientCertificateRequest publicKey. + * @member {string} publicKey + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.publicKey = ""; + + /** + * GenerateClientCertificateRequest useMetadataExchange. + * @member {boolean} useMetadataExchange + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.useMetadataExchange = false; + + /** + * Creates a new GenerateClientCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance + */ + GenerateClientCertificateRequest.create = function create(properties) { + return new GenerateClientCertificateRequest(properties); + }; + + /** + * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); + if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) + $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); + if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); + return writer; + }; + + /** + * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.pemCsr = reader.string(); + break; + } + case 4: { + message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.publicKey = reader.string(); + break; + } + case 6: { + message.useMetadataExchange = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateClientCertificateRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateClientCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + if (!$util.isString(message.pemCsr)) + return "pemCsr: string expected"; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) { + var error = $root.google.protobuf.Duration.verify(message.certDuration); + if (error) + return "certDuration." + error; + } + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: string expected"; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + if (typeof message.useMetadataExchange !== "boolean") + return "useMetadataExchange: boolean expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest + */ + GenerateClientCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.pemCsr != null) + message.pemCsr = String(object.pemCsr); + if (object.certDuration != null) { + if (typeof object.certDuration !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.certDuration: object expected"); + message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); + } + if (object.publicKey != null) + message.publicKey = String(object.publicKey); + if (object.useMetadataExchange != null) + message.useMetadataExchange = Boolean(object.useMetadataExchange); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} message GenerateClientCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + object.pemCsr = ""; + object.certDuration = null; + object.publicKey = ""; + object.useMetadataExchange = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) + object.pemCsr = message.pemCsr; + if (message.certDuration != null && message.hasOwnProperty("certDuration")) + object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + object.useMetadataExchange = message.useMetadataExchange; + return object; + }; + + /** + * Converts this GenerateClientCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateRequest"; + }; + + return GenerateClientCertificateRequest; + })(); + + v1beta.GenerateClientCertificateResponse = (function() { + + /** + * Properties of a GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IGenerateClientCertificateResponse + * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate + * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain + * @property {string|null} [caCert] GenerateClientCertificateResponse caCert + */ + + /** + * Constructs a new GenerateClientCertificateResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GenerateClientCertificateResponse. + * @implements IGenerateClientCertificateResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set + */ + function GenerateClientCertificateResponse(properties) { + this.pemCertificateChain = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateClientCertificateResponse pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.pemCertificate = ""; + + /** + * GenerateClientCertificateResponse pemCertificateChain. + * @member {Array.} pemCertificateChain + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; + + /** + * GenerateClientCertificateResponse caCert. + * @member {string} caCert + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @instance + */ + GenerateClientCertificateResponse.prototype.caCert = ""; + + /** + * Creates a new GenerateClientCertificateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance + */ + GenerateClientCertificateResponse.create = function create(properties) { + return new GenerateClientCertificateResponse(properties); + }; + + /** + * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); + if (message.pemCertificateChain != null && message.pemCertificateChain.length) + for (var i = 0; i < message.pemCertificateChain.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); + if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); + return writer; + }; + + /** + * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pemCertificate = reader.string(); + break; + } + case 2: { + if (!(message.pemCertificateChain && message.pemCertificateChain.length)) + message.pemCertificateChain = []; + message.pemCertificateChain.push(reader.string()); + break; + } + case 3: { + message.caCert = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateClientCertificateResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateClientCertificateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { + if (!Array.isArray(message.pemCertificateChain)) + return "pemCertificateChain: array expected"; + for (var i = 0; i < message.pemCertificateChain.length; ++i) + if (!$util.isString(message.pemCertificateChain[i])) + return "pemCertificateChain: string[] expected"; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + if (!$util.isString(message.caCert)) + return "caCert: string expected"; + return null; + }; + + /** + * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse + */ + GenerateClientCertificateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.pemCertificateChain) { + if (!Array.isArray(object.pemCertificateChain)) + throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.pemCertificateChain: array expected"); + message.pemCertificateChain = []; + for (var i = 0; i < object.pemCertificateChain.length; ++i) + message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); + } + if (object.caCert != null) + message.caCert = String(object.caCert); + return message; + }; + + /** + * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} message GenerateClientCertificateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateClientCertificateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pemCertificateChain = []; + if (options.defaults) { + object.pemCertificate = ""; + object.caCert = ""; + } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.pemCertificateChain && message.pemCertificateChain.length) { + object.pemCertificateChain = []; + for (var j = 0; j < message.pemCertificateChain.length; ++j) + object.pemCertificateChain[j] = message.pemCertificateChain[j]; + } + if (message.caCert != null && message.hasOwnProperty("caCert")) + object.caCert = message.caCert; + return object; + }; + + /** + * Converts this GenerateClientCertificateResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateClientCertificateResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateResponse"; + }; + + return GenerateClientCertificateResponse; + })(); + + v1beta.GetConnectionInfoRequest = (function() { + + /** + * Properties of a GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IGetConnectionInfoRequest + * @property {string|null} [parent] GetConnectionInfoRequest parent + * @property {string|null} [requestId] GetConnectionInfoRequest requestId + */ + + /** + * Constructs a new GetConnectionInfoRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetConnectionInfoRequest. + * @implements IGetConnectionInfoRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set + */ + function GetConnectionInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionInfoRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.parent = ""; + + /** + * GetConnectionInfoRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @instance + */ + GetConnectionInfoRequest.prototype.requestId = ""; + + /** + * Creates a new GetConnectionInfoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest instance + */ + GetConnectionInfoRequest.create = function create(properties) { + return new GetConnectionInfoRequest(properties); + }; + + /** + * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionInfoRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest + */ + GetConnectionInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} message GetConnectionInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this GetConnectionInfoRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionInfoRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetConnectionInfoRequest"; + }; + + return GetConnectionInfoRequest; + })(); + + v1beta.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.alloydb.v1beta + * @interface IOperationMetadata + * @property {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata + * @property {google.cloud.alloydb.v1beta.IPromoteClusterStatus|null} [promoteClusterStatus] OperationMetadata promoteClusterStatus + * @property {google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null} [upgradeClusterStatus] OperationMetadata upgradeClusterStatus + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata batchCreateInstancesMetadata. + * @member {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchCreateInstancesMetadata = null; + + /** + * OperationMetadata promoteClusterStatus. + * @member {google.cloud.alloydb.v1beta.IPromoteClusterStatus|null|undefined} promoteClusterStatus + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.promoteClusterStatus = null; + + /** + * OperationMetadata upgradeClusterStatus. + * @member {google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null|undefined} upgradeClusterStatus + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.upgradeClusterStatus = null; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata requestSpecific. + * @member {"batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata", "promoteClusterStatus", "upgradeClusterStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) + $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.promoteClusterStatus != null && Object.hasOwnProperty.call(message, "promoteClusterStatus")) + $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.encode(message.promoteClusterStatus, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.upgradeClusterStatus != null && Object.hasOwnProperty.call(message, "upgradeClusterStatus")) + $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.encode(message.upgradeClusterStatus, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); + break; + } + case 9: { + message.promoteClusterStatus = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.decode(reader, reader.uint32()); + break; + } + case 10: { + message.upgradeClusterStatus = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.decode(reader, reader.uint32()); + break; + } + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); + if (error) + return "batchCreateInstancesMetadata." + error; + } + } + if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { + if (properties.requestSpecific === 1) + return "requestSpecific: multiple values"; + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.verify(message.promoteClusterStatus); + if (error) + return "promoteClusterStatus." + error; + } + } + if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { + if (properties.requestSpecific === 1) + return "requestSpecific: multiple values"; + properties.requestSpecific = 1; + { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify(message.upgradeClusterStatus); + if (error) + return "upgradeClusterStatus." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.OperationMetadata) + return object; + var message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); + if (object.batchCreateInstancesMetadata != null) { + if (typeof object.batchCreateInstancesMetadata !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.batchCreateInstancesMetadata: object expected"); + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); + } + if (object.promoteClusterStatus != null) { + if (typeof object.promoteClusterStatus !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.promoteClusterStatus: object expected"); + message.promoteClusterStatus = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.fromObject(object.promoteClusterStatus); + } + if (object.upgradeClusterStatus != null) { + if (typeof object.upgradeClusterStatus !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.upgradeClusterStatus: object expected"); + message.upgradeClusterStatus = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.fromObject(object.upgradeClusterStatus); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {google.cloud.alloydb.v1beta.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { + object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); + if (options.oneofs) + object.requestSpecific = "batchCreateInstancesMetadata"; + } + if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { + object.promoteClusterStatus = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.toObject(message.promoteClusterStatus, options); + if (options.oneofs) + object.requestSpecific = "promoteClusterStatus"; + } + if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { + object.upgradeClusterStatus = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.toObject(message.upgradeClusterStatus, options); + if (options.oneofs) + object.requestSpecific = "upgradeClusterStatus"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta.PromoteClusterStatus = (function() { + + /** + * Properties of a PromoteClusterStatus. + * @memberof google.cloud.alloydb.v1beta + * @interface IPromoteClusterStatus + * @property {google.cloud.alloydb.v1beta.PromoteClusterStatus.State|null} [state] PromoteClusterStatus state + */ + + /** + * Constructs a new PromoteClusterStatus. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a PromoteClusterStatus. + * @implements IPromoteClusterStatus + * @constructor + * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus=} [properties] Properties to set + */ + function PromoteClusterStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromoteClusterStatus state. + * @member {google.cloud.alloydb.v1beta.PromoteClusterStatus.State} state + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @instance + */ + PromoteClusterStatus.prototype.state = 0; + + /** + * Creates a new PromoteClusterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus instance + */ + PromoteClusterStatus.create = function create(properties) { + return new PromoteClusterStatus(properties); + }; + + /** + * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + return writer; + }; + + /** + * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.PromoteClusterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteClusterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromoteClusterStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromoteClusterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus + */ + PromoteClusterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.PromoteClusterStatus) + return object; + var message = new $root.google.cloud.alloydb.v1beta.PromoteClusterStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": + case 1: + message.state = 1; + break; + case "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": + case 2: + message.state = 2; + break; + case "PROMOTE_CLUSTER_COMPLETED": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.PromoteClusterStatus} message PromoteClusterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromoteClusterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.State[message.state] : message.state; + return object; + }; + + /** + * Converts this PromoteClusterStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @instance + * @returns {Object.} JSON object + */ + PromoteClusterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromoteClusterStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromoteClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.PromoteClusterStatus"; + }; + + /** + * State enum. + * @name google.cloud.alloydb.v1beta.PromoteClusterStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_READ=1 PROMOTE_CLUSTER_AVAILABLE_FOR_READ value + * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE=2 PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE value + * @property {number} PROMOTE_CLUSTER_COMPLETED=3 PROMOTE_CLUSTER_COMPLETED value + */ + PromoteClusterStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROMOTE_CLUSTER_AVAILABLE_FOR_READ"] = 1; + values[valuesById[2] = "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE"] = 2; + values[valuesById[3] = "PROMOTE_CLUSTER_COMPLETED"] = 3; + return values; + })(); + + return PromoteClusterStatus; + })(); + + v1beta.UpgradeClusterStatus = (function() { + + /** + * Properties of an UpgradeClusterStatus. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpgradeClusterStatus + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [state] UpgradeClusterStatus state + * @property {boolean|null} [cancellable] UpgradeClusterStatus cancellable + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [sourceVersion] UpgradeClusterStatus sourceVersion + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [targetVersion] UpgradeClusterStatus targetVersion + * @property {Array.|null} [stages] UpgradeClusterStatus stages + */ + + /** + * Constructs a new UpgradeClusterStatus. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpgradeClusterStatus. + * @implements IUpgradeClusterStatus + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus=} [properties] Properties to set + */ + function UpgradeClusterStatus(properties) { + this.stages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeClusterStatus state. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} state + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.state = 0; + + /** + * UpgradeClusterStatus cancellable. + * @member {boolean} cancellable + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.cancellable = false; + + /** + * UpgradeClusterStatus sourceVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} sourceVersion + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.sourceVersion = 0; + + /** + * UpgradeClusterStatus targetVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} targetVersion + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.targetVersion = 0; + + /** + * UpgradeClusterStatus stages. + * @member {Array.} stages + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @instance + */ + UpgradeClusterStatus.prototype.stages = $util.emptyArray; + + /** + * Creates a new UpgradeClusterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus instance + */ + UpgradeClusterStatus.create = function create(properties) { + return new UpgradeClusterStatus(properties); + }; + + /** + * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.cancellable != null && Object.hasOwnProperty.call(message, "cancellable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cancellable); + if (message.sourceVersion != null && Object.hasOwnProperty.call(message, "sourceVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceVersion); + if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.targetVersion); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.cancellable = reader.bool(); + break; + } + case 3: { + message.sourceVersion = reader.int32(); + break; + } + case 4: { + message.targetVersion = reader.int32(); + break; + } + case 5: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeClusterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeClusterStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeClusterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.cancellable != null && message.hasOwnProperty("cancellable")) + if (typeof message.cancellable !== "boolean") + return "cancellable: boolean expected"; + if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) + switch (message.sourceVersion) { + default: + return "sourceVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + switch (message.targetVersion) { + default: + return "targetVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + return null; + }; + + /** + * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus + */ + UpgradeClusterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "IN_PROGRESS": + case 5: + message.state = 5; + break; + case "SUCCESS": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.state = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.cancellable != null) + message.cancellable = Boolean(object.cancellable); + switch (object.sourceVersion) { + default: + if (typeof object.sourceVersion === "number") { + message.sourceVersion = object.sourceVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.sourceVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.sourceVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.sourceVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.sourceVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.sourceVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.sourceVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.sourceVersion = 6; + break; + } + switch (object.targetVersion) { + default: + if (typeof object.targetVersion === "number") { + message.targetVersion = object.targetVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.targetVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.targetVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.targetVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.targetVersion = 3; + break; + case "POSTGRES_16": + case 4: + message.targetVersion = 4; + break; + case "POSTGRES_17": + case 5: + message.targetVersion = 5; + break; + case "POSTGRES_18": + case 6: + message.targetVersion = 6; + break; + } + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.stages: object expected"); + message.stages[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.fromObject(object.stages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus} message UpgradeClusterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeClusterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stages = []; + if (options.defaults) { + object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.cancellable = false; + object.sourceVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.targetVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] : message.state; + if (message.cancellable != null && message.hasOwnProperty("cancellable")) + object.cancellable = message.cancellable; + if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) + object.sourceVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.sourceVersion] === undefined ? message.sourceVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.sourceVersion] : message.sourceVersion; + if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) + object.targetVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.targetVersion] === undefined ? message.targetVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.targetVersion] : message.targetVersion; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.toObject(message.stages[j], options); + } + return object; + }; + + /** + * Converts this UpgradeClusterStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @instance + * @returns {Object.} JSON object + */ + UpgradeClusterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeClusterStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus"; + }; + + UpgradeClusterStatus.StageStatus = (function() { + + /** + * Properties of a StageStatus. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @interface IStageStatus + * @property {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null} [readPoolInstancesUpgrade] StageStatus readPoolInstancesUpgrade + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null} [stage] StageStatus stage + * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [state] StageStatus state + * @property {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null} [schedule] StageStatus schedule + */ + + /** + * Constructs a new StageStatus. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @classdesc Represents a StageStatus. + * @implements IStageStatus + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set + */ + function StageStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageStatus readPoolInstancesUpgrade. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null|undefined} readPoolInstancesUpgrade + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.readPoolInstancesUpgrade = null; + + /** + * StageStatus stage. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage} stage + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.stage = 0; + + /** + * StageStatus state. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} state + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.state = 0; + + /** + * StageStatus schedule. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null|undefined} schedule + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @instance + */ + StageStatus.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StageStatus stageSpecificStatus. + * @member {"readPoolInstancesUpgrade"|undefined} stageSpecificStatus + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @instance + */ + Object.defineProperty(StageStatus.prototype, "stageSpecificStatus", { + get: $util.oneOfGetter($oneOfFields = ["readPoolInstancesUpgrade"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StageStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus instance + */ + StageStatus.create = function create(properties) { + return new StageStatus(properties); + }; + + /** + * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.encode(message.schedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readPoolInstancesUpgrade != null && Object.hasOwnProperty.call(message, "readPoolInstancesUpgrade")) + $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.encode(message.readPoolInstancesUpgrade, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 11: { + message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.decode(reader, reader.uint32()); + break; + } + case 1: { + message.stage = reader.int32(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.schedule = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { + properties.stageSpecificStatus = 1; + { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify(message.readPoolInstancesUpgrade); + if (error) + return "readPoolInstancesUpgrade." + error; + } + } + if (message.stage != null && message.hasOwnProperty("stage")) + switch (message.stage) { + default: + return "stage: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 4: + case 5: + case 1: + case 2: + case 3: + case 6: + case 7: + break; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + return null; + }; + + /** + * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus + */ + StageStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus(); + if (object.readPoolInstancesUpgrade != null) { + if (typeof object.readPoolInstancesUpgrade !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.readPoolInstancesUpgrade: object expected"); + message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.fromObject(object.readPoolInstancesUpgrade); + } + switch (object.stage) { + default: + if (typeof object.stage === "number") { + message.stage = object.stage; + break; + } + break; + case "STAGE_UNSPECIFIED": + case 0: + message.stage = 0; + break; + case "ALLOYDB_PRECHECK": + case 1: + message.stage = 1; + break; + case "PG_UPGRADE_CHECK": + case 2: + message.stage = 2; + break; + case "PREPARE_FOR_UPGRADE": + case 5: + message.stage = 5; + break; + case "PRIMARY_INSTANCE_UPGRADE": + case 3: + message.stage = 3; + break; + case "READ_POOL_INSTANCES_UPGRADE": + case 4: + message.stage = 4; + break; + case "ROLLBACK": + case 6: + message.stage = 6; + break; + case "CLEANUP": + case 7: + message.stage = 7; + break; + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "IN_PROGRESS": + case 5: + message.state = 5; + break; + case "SUCCESS": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "PARTIAL_SUCCESS": + case 3: + message.state = 3; + break; + case "CANCEL_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.schedule: object expected"); + message.schedule = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.fromObject(object.schedule); + } + return message; + }; + + /** + * Creates a plain object from a StageStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} message StageStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.schedule = null; + } + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] : message.stage; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] : message.state; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.toObject(message.schedule, options); + if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { + object.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.toObject(message.readPoolInstancesUpgrade, options); + if (options.oneofs) + object.stageSpecificStatus = "readPoolInstancesUpgrade"; + } + return object; + }; + + /** + * Converts this StageStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @instance + * @returns {Object.} JSON object + */ + StageStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus"; + }; + + StageStatus.StageSchedule = (function() { + + /** + * Properties of a StageSchedule. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @interface IStageSchedule + * @property {google.protobuf.ITimestamp|null} [estimatedStartTime] StageSchedule estimatedStartTime + * @property {google.protobuf.ITimestamp|null} [actualStartTime] StageSchedule actualStartTime + * @property {google.protobuf.ITimestamp|null} [estimatedEndTime] StageSchedule estimatedEndTime + * @property {google.protobuf.ITimestamp|null} [actualEndTime] StageSchedule actualEndTime + */ + + /** + * Constructs a new StageSchedule. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus + * @classdesc Represents a StageSchedule. + * @implements IStageSchedule + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set + */ + function StageSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageSchedule estimatedStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedStartTime + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.estimatedStartTime = null; + + /** + * StageSchedule actualStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} actualStartTime + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.actualStartTime = null; + + /** + * StageSchedule estimatedEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} estimatedEndTime + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.estimatedEndTime = null; + + /** + * StageSchedule actualEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} actualEndTime + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + */ + StageSchedule.prototype.actualEndTime = null; + + /** + * Creates a new StageSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule instance + */ + StageSchedule.create = function create(properties) { + return new StageSchedule(properties); + }; + + /** + * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedStartTime != null && Object.hasOwnProperty.call(message, "estimatedStartTime")) + $root.google.protobuf.Timestamp.encode(message.estimatedStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actualStartTime != null && Object.hasOwnProperty.call(message, "actualStartTime")) + $root.google.protobuf.Timestamp.encode(message.actualStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.estimatedEndTime != null && Object.hasOwnProperty.call(message, "estimatedEndTime")) + $root.google.protobuf.Timestamp.encode(message.estimatedEndTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.actualEndTime != null && Object.hasOwnProperty.call(message, "actualEndTime")) + $root.google.protobuf.Timestamp.encode(message.actualEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.estimatedStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.actualStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.estimatedEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.actualEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageSchedule message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedStartTime); + if (error) + return "estimatedStartTime." + error; + } + if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.actualStartTime); + if (error) + return "actualStartTime." + error; + } + if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.estimatedEndTime); + if (error) + return "estimatedEndTime." + error; + } + if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.actualEndTime); + if (error) + return "actualEndTime." + error; + } + return null; + }; + + /** + * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule + */ + StageSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule(); + if (object.estimatedStartTime != null) { + if (typeof object.estimatedStartTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedStartTime: object expected"); + message.estimatedStartTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedStartTime); + } + if (object.actualStartTime != null) { + if (typeof object.actualStartTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.actualStartTime: object expected"); + message.actualStartTime = $root.google.protobuf.Timestamp.fromObject(object.actualStartTime); + } + if (object.estimatedEndTime != null) { + if (typeof object.estimatedEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedEndTime: object expected"); + message.estimatedEndTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedEndTime); + } + if (object.actualEndTime != null) { + if (typeof object.actualEndTime !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.actualEndTime: object expected"); + message.actualEndTime = $root.google.protobuf.Timestamp.fromObject(object.actualEndTime); + } + return message; + }; + + /** + * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} message StageSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.estimatedStartTime = null; + object.actualStartTime = null; + object.estimatedEndTime = null; + object.actualEndTime = null; + } + if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) + object.estimatedStartTime = $root.google.protobuf.Timestamp.toObject(message.estimatedStartTime, options); + if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) + object.actualStartTime = $root.google.protobuf.Timestamp.toObject(message.actualStartTime, options); + if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) + object.estimatedEndTime = $root.google.protobuf.Timestamp.toObject(message.estimatedEndTime, options); + if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) + object.actualEndTime = $root.google.protobuf.Timestamp.toObject(message.actualEndTime, options); + return object; + }; + + /** + * Converts this StageSchedule to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @instance + * @returns {Object.} JSON object + */ + StageSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageSchedule + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule"; + }; + + return StageSchedule; + })(); + + return StageStatus; + })(); + + UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus = (function() { + + /** + * Properties of a ReadPoolInstancesUpgradeStageStatus. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @interface IReadPoolInstancesUpgradeStageStatus + * @property {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null} [upgradeStats] ReadPoolInstancesUpgradeStageStatus upgradeStats + */ + + /** + * Constructs a new ReadPoolInstancesUpgradeStageStatus. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus + * @classdesc Represents a ReadPoolInstancesUpgradeStageStatus. + * @implements IReadPoolInstancesUpgradeStageStatus + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set + */ + function ReadPoolInstancesUpgradeStageStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadPoolInstancesUpgradeStageStatus upgradeStats. + * @member {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null|undefined} upgradeStats + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @instance + */ + ReadPoolInstancesUpgradeStageStatus.prototype.upgradeStats = null; + + /** + * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus instance + */ + ReadPoolInstancesUpgradeStageStatus.create = function create(properties) { + return new ReadPoolInstancesUpgradeStageStatus(properties); + }; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolInstancesUpgradeStageStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upgradeStats != null && Object.hasOwnProperty.call(message, "upgradeStats")) + $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.encode(message.upgradeStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadPoolInstancesUpgradeStageStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolInstancesUpgradeStageStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.upgradeStats = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadPoolInstancesUpgradeStageStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadPoolInstancesUpgradeStageStatus message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadPoolInstancesUpgradeStageStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) { + var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify(message.upgradeStats); + if (error) + return "upgradeStats." + error; + } + return null; + }; + + /** + * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus + */ + ReadPoolInstancesUpgradeStageStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); + if (object.upgradeStats != null) { + if (typeof object.upgradeStats !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.upgradeStats: object expected"); + message.upgradeStats = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.fromObject(object.upgradeStats); + } + return message; + }; + + /** + * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadPoolInstancesUpgradeStageStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.upgradeStats = null; + if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) + object.upgradeStats = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.toObject(message.upgradeStats, options); + return object; + }; + + /** + * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @instance + * @returns {Object.} JSON object + */ + ReadPoolInstancesUpgradeStageStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadPoolInstancesUpgradeStageStatus + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadPoolInstancesUpgradeStageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus"; + }; + + ReadPoolInstancesUpgradeStageStatus.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @interface IStats + * @property {number|null} [notStarted] Stats notStarted + * @property {number|null} [ongoing] Stats ongoing + * @property {number|null} [success] Stats success + * @property {number|null} [failed] Stats failed + */ + + /** + * Constructs a new Stats. + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set + */ + function Stats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stats notStarted. + * @member {number} notStarted + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.notStarted = 0; + + /** + * Stats ongoing. + * @member {number} ongoing + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.ongoing = 0; + + /** + * Stats success. + * @member {number} success + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.success = 0; + + /** + * Stats failed. + * @member {number} failed + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + */ + Stats.prototype.failed = 0; + + /** + * Creates a new Stats instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats instance + */ + Stats.create = function create(properties) { + return new Stats(properties); + }; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notStarted != null && Object.hasOwnProperty.call(message, "notStarted")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.notStarted); + if (message.ongoing != null && Object.hasOwnProperty.call(message, "ongoing")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ongoing); + if (message.success != null && Object.hasOwnProperty.call(message, "success")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.success); + if (message.failed != null && Object.hasOwnProperty.call(message, "failed")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failed); + return writer; + }; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notStarted = reader.int32(); + break; + } + case 2: { + message.ongoing = reader.int32(); + break; + } + case 3: { + message.success = reader.int32(); + break; + } + case 4: { + message.failed = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stats message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notStarted != null && message.hasOwnProperty("notStarted")) + if (!$util.isInteger(message.notStarted)) + return "notStarted: integer expected"; + if (message.ongoing != null && message.hasOwnProperty("ongoing")) + if (!$util.isInteger(message.ongoing)) + return "ongoing: integer expected"; + if (message.success != null && message.hasOwnProperty("success")) + if (!$util.isInteger(message.success)) + return "success: integer expected"; + if (message.failed != null && message.hasOwnProperty("failed")) + if (!$util.isInteger(message.failed)) + return "failed: integer expected"; + return null; + }; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats + */ + Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); + if (object.notStarted != null) + message.notStarted = object.notStarted | 0; + if (object.ongoing != null) + message.ongoing = object.ongoing | 0; + if (object.success != null) + message.success = object.success | 0; + if (object.failed != null) + message.failed = object.failed | 0; + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notStarted = 0; + object.ongoing = 0; + object.success = 0; + object.failed = 0; + } + if (message.notStarted != null && message.hasOwnProperty("notStarted")) + object.notStarted = message.notStarted; + if (message.ongoing != null && message.hasOwnProperty("ongoing")) + object.ongoing = message.ongoing; + if (message.success != null && message.hasOwnProperty("success")) + object.success = message.success; + if (message.failed != null && message.hasOwnProperty("failed")) + object.failed = message.failed; + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stats + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats"; + }; + + return Stats; + })(); + + return ReadPoolInstancesUpgradeStageStatus; + })(); + + return UpgradeClusterStatus; + })(); + + v1beta.ListUsersRequest = (function() { + + /** + * Properties of a ListUsersRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + * @property {string|null} [filter] ListUsersRequest filter + * @property {string|null} [orderBy] ListUsersRequest orderBy + */ + + /** + * Constructs a new ListUsersRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListUsersRequest=} [properties] Properties to set + */ + function ListUsersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.parent = ""; + + /** + * ListUsersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageSize = 0; + + /** + * ListUsersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageToken = ""; + + /** + * ListUsersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.filter = ""; + + /** + * ListUsersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListUsersRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest instance + */ + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); + }; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListUsersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest + */ + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListUsersRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListUsersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {google.cloud.alloydb.v1beta.ListUsersRequest} message ListUsersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListUsersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListUsersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListUsersRequest"; + }; + + return ListUsersRequest; + })(); + + v1beta.ListUsersResponse = (function() { + + /** + * Properties of a ListUsersResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsersResponse unreachable + */ + + /** + * Constructs a new ListUsersResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListUsersResponse=} [properties] Properties to set + */ + function ListUsersResponse(properties) { + this.users = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.users = $util.emptyArray; + + /** + * ListUsersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.nextPageToken = ""; + + /** + * ListUsersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListUsersResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse instance + */ + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); + }; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.cloud.alloydb.v1beta.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListUsersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.User.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse + */ + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListUsersResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.cloud.alloydb.v1beta.User.fromObject(object.users[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListUsersResponse} message ListUsersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.users = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.cloud.alloydb.v1beta.User.toObject(message.users[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUsersResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListUsersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListUsersResponse"; + }; + + return ListUsersResponse; + })(); + + v1beta.GetUserRequest = (function() { + + /** + * Properties of a GetUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name + */ + + /** + * Constructs a new GetUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IGetUserRequest=} [properties] Properties to set + */ + function GetUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @instance + */ + GetUserRequest.prototype.name = ""; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest instance + */ + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); + }; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest + */ + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.GetUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.GetUserRequest} message GetUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.GetUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetUserRequest"; + }; + + return GetUserRequest; + })(); + + v1beta.CreateUserRequest = (function() { + + /** + * Properties of a CreateUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.cloud.alloydb.v1beta.IUser|null} [user] CreateUserRequest user + * @property {string|null} [requestId] CreateUserRequest requestId + * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly + */ + + /** + * Constructs a new CreateUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest=} [properties] Properties to set + */ + function CreateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.parent = ""; + + /** + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.userId = ""; + + /** + * CreateUserRequest user. + * @member {google.cloud.alloydb.v1beta.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.user = null; + + /** + * CreateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.requestId = ""; + + /** + * CreateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest instance + */ + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); + }; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1beta.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.user = $root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1beta.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest + */ + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1beta.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateUserRequest} message CreateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userId = ""; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1beta.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateUserRequest"; + }; + + return CreateUserRequest; + })(); + + v1beta.UpdateUserRequest = (function() { + + /** + * Properties of an UpdateUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IUpdateUserRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + * @property {google.cloud.alloydb.v1beta.IUser|null} [user] UpdateUserRequest user + * @property {string|null} [requestId] UpdateUserRequest requestId + * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing + */ + + /** + * Constructs a new UpdateUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest=} [properties] Properties to set + */ + function UpdateUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.updateMask = null; + + /** + * UpdateUserRequest user. + * @member {google.cloud.alloydb.v1beta.IUser|null|undefined} user + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; + + /** + * UpdateUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.requestId = ""; + + /** + * UpdateUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.validateOnly = false; + + /** + * UpdateUserRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest instance + */ + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); + }; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.alloydb.v1beta.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.user = $root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.alloydb.v1beta.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest + */ + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.UpdateUserRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.UpdateUserRequest.user: object expected"); + message.user = $root.google.cloud.alloydb.v1beta.User.fromObject(object.user); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.UpdateUserRequest} message UpdateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.user = null; + object.requestId = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.alloydb.v1beta.User.toObject(message.user, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateUserRequest"; + }; + + return UpdateUserRequest; + })(); + + v1beta.DeleteUserRequest = (function() { + + /** + * Properties of a DeleteUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + * @property {string|null} [requestId] DeleteUserRequest requestId + * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly + */ + + /** + * Constructs a new DeleteUserRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest=} [properties] Properties to set + */ + function DeleteUserRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUserRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.name = ""; + + /** + * DeleteUserRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.requestId = ""; + + /** + * DeleteUserRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest instance + */ + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); + }; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUserRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest + */ + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteUserRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {google.cloud.alloydb.v1beta.DeleteUserRequest} message DeleteUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteUserRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUserRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteUserRequest"; + }; + + return DeleteUserRequest; + })(); + + v1beta.ListDatabasesRequest = (function() { + + /** + * Properties of a ListDatabasesRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface IListDatabasesRequest + * @property {string|null} [parent] ListDatabasesRequest parent + * @property {number|null} [pageSize] ListDatabasesRequest pageSize + * @property {string|null} [pageToken] ListDatabasesRequest pageToken + * @property {string|null} [filter] ListDatabasesRequest filter + */ + + /** + * Constructs a new ListDatabasesRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListDatabasesRequest. + * @implements IListDatabasesRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest=} [properties] Properties to set + */ + function ListDatabasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.parent = ""; + + /** + * ListDatabasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageSize = 0; + + /** + * ListDatabasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.pageToken = ""; + + /** + * ListDatabasesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.filter = ""; + + /** + * Creates a new ListDatabasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest instance + */ + ListDatabasesRequest.create = function create(properties) { + return new ListDatabasesRequest(properties); + }; + + /** + * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListDatabasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest + */ + ListDatabasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListDatabasesRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListDatabasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {google.cloud.alloydb.v1beta.ListDatabasesRequest} message ListDatabasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListDatabasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListDatabasesRequest"; + }; + + return ListDatabasesRequest; + })(); + + v1beta.ListDatabasesResponse = (function() { + + /** + * Properties of a ListDatabasesResponse. + * @memberof google.cloud.alloydb.v1beta + * @interface IListDatabasesResponse + * @property {Array.|null} [databases] ListDatabasesResponse databases + * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken + */ + + /** + * Constructs a new ListDatabasesResponse. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a ListDatabasesResponse. + * @implements IListDatabasesResponse + * @constructor + * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse=} [properties] Properties to set + */ + function ListDatabasesResponse(properties) { + this.databases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesResponse databases. + * @member {Array.} databases + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.databases = $util.emptyArray; + + /** + * ListDatabasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @instance + */ + ListDatabasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatabasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse instance + */ + ListDatabasesResponse.create = function create(properties) { + return new ListDatabasesResponse(properties); + }; + + /** + * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databases != null && message.databases.length) + for (var i = 0; i < message.databases.length; ++i) + $root.google.cloud.alloydb.v1beta.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListDatabasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.databases && message.databases.length)) + message.databases = []; + message.databases.push($root.google.cloud.alloydb.v1beta.Database.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatabasesResponse message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatabasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databases != null && message.hasOwnProperty("databases")) { + if (!Array.isArray(message.databases)) + return "databases: array expected"; + for (var i = 0; i < message.databases.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.Database.verify(message.databases[i]); + if (error) + return "databases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse + */ + ListDatabasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.ListDatabasesResponse) + return object; + var message = new $root.google.cloud.alloydb.v1beta.ListDatabasesResponse(); + if (object.databases) { + if (!Array.isArray(object.databases)) + throw TypeError(".google.cloud.alloydb.v1beta.ListDatabasesResponse.databases: array expected"); + message.databases = []; + for (var i = 0; i < object.databases.length; ++i) { + if (typeof object.databases[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.ListDatabasesResponse.databases: object expected"); + message.databases[i] = $root.google.cloud.alloydb.v1beta.Database.fromObject(object.databases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {google.cloud.alloydb.v1beta.ListDatabasesResponse} message ListDatabasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatabasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databases && message.databases.length) { + object.databases = []; + for (var j = 0; j < message.databases.length; ++j) + object.databases[j] = $root.google.cloud.alloydb.v1beta.Database.toObject(message.databases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatabasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatabasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatabasesResponse + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListDatabasesResponse"; + }; + + return ListDatabasesResponse; + })(); + + v1beta.CreateDatabaseRequest = (function() { + + /** + * Properties of a CreateDatabaseRequest. + * @memberof google.cloud.alloydb.v1beta + * @interface ICreateDatabaseRequest + * @property {string|null} [parent] CreateDatabaseRequest parent + * @property {string|null} [databaseId] CreateDatabaseRequest databaseId + * @property {google.cloud.alloydb.v1beta.IDatabase|null} [database] CreateDatabaseRequest database + */ + + /** + * Constructs a new CreateDatabaseRequest. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a CreateDatabaseRequest. + * @implements ICreateDatabaseRequest + * @constructor + * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest=} [properties] Properties to set + */ + function CreateDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatabaseRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.parent = ""; + + /** + * CreateDatabaseRequest databaseId. + * @member {string} databaseId + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.databaseId = ""; + + /** + * CreateDatabaseRequest database. + * @member {google.cloud.alloydb.v1beta.IDatabase|null|undefined} database + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @instance + */ + CreateDatabaseRequest.prototype.database = null; + + /** + * Creates a new CreateDatabaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest instance + */ + CreateDatabaseRequest.create = function create(properties) { + return new CreateDatabaseRequest(properties); + }; + + /** + * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + $root.google.cloud.alloydb.v1beta.Database.encode(message.database, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.databaseId = reader.string(); + break; + } + case 3: { + message.database = $root.google.cloud.alloydb.v1beta.Database.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatabaseRequest message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatabaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.database != null && message.hasOwnProperty("database")) { + var error = $root.google.cloud.alloydb.v1beta.Database.verify(message.database); + if (error) + return "database." + error; + } + return null; + }; + + /** + * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest + */ + CreateDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest) + return object; + var message = new $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.database != null) { + if (typeof object.database !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.CreateDatabaseRequest.database: object expected"); + message.database = $root.google.cloud.alloydb.v1beta.Database.fromObject(object.database); + } + return message; + }; + + /** + * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {google.cloud.alloydb.v1beta.CreateDatabaseRequest} message CreateDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.databaseId = ""; + object.database = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.database != null && message.hasOwnProperty("database")) + object.database = $root.google.cloud.alloydb.v1beta.Database.toObject(message.database, options); + return object; + }; + + /** + * Converts this CreateDatabaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatabaseRequest + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateDatabaseRequest"; + }; + + return CreateDatabaseRequest; + })(); + + v1beta.SqlResult = (function() { + + /** + * Properties of a SqlResult. + * @memberof google.cloud.alloydb.v1beta + * @interface ISqlResult + * @property {Array.|null} [columns] SqlResult columns + * @property {Array.|null} [rows] SqlResult rows + */ + + /** + * Constructs a new SqlResult. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SqlResult. + * @implements ISqlResult + * @constructor + * @param {google.cloud.alloydb.v1beta.ISqlResult=} [properties] Properties to set + */ + function SqlResult(properties) { + this.columns = []; + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResult columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @instance + */ + SqlResult.prototype.columns = $util.emptyArray; + + /** + * SqlResult rows. + * @member {Array.} rows + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @instance + */ + SqlResult.prototype.rows = $util.emptyArray; + + /** + * Creates a new SqlResult instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResult=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult instance + */ + SqlResult.create = function create(properties) { + return new SqlResult(properties); + }; + + /** + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResult} message SqlResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.alloydb.v1beta.SqlResultColumn.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.alloydb.v1beta.SqlResultRow.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResult} message SqlResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.alloydb.v1beta.SqlResultColumn.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.alloydb.v1beta.SqlResultRow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResult message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.SqlResultColumn.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.SqlResultRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult + */ + SqlResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResult) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SqlResult(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.columns: object expected"); + message.columns[i] = $root.google.cloud.alloydb.v1beta.SqlResultColumn.fromObject(object.columns[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.rows: object expected"); + message.rows[i] = $root.google.cloud.alloydb.v1beta.SqlResultRow.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {google.cloud.alloydb.v1beta.SqlResult} message SqlResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columns = []; + object.rows = []; + } + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.alloydb.v1beta.SqlResultColumn.toObject(message.columns[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.alloydb.v1beta.SqlResultRow.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this SqlResult to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @instance + * @returns {Object.} JSON object + */ + SqlResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResult + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SqlResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResult"; + }; + + return SqlResult; + })(); + + v1beta.SqlResultColumn = (function() { + + /** + * Properties of a SqlResultColumn. + * @memberof google.cloud.alloydb.v1beta + * @interface ISqlResultColumn + * @property {string|null} [name] SqlResultColumn name + * @property {string|null} [type] SqlResultColumn type + */ + + /** + * Constructs a new SqlResultColumn. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SqlResultColumn. + * @implements ISqlResultColumn + * @constructor + * @param {google.cloud.alloydb.v1beta.ISqlResultColumn=} [properties] Properties to set + */ + function SqlResultColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultColumn name. + * @member {string} name + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @instance + */ + SqlResultColumn.prototype.name = ""; + + /** + * SqlResultColumn type. + * @member {string} type + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @instance + */ + SqlResultColumn.prototype.type = ""; + + /** + * Creates a new SqlResultColumn instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultColumn=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn instance + */ + SqlResultColumn.create = function create(properties) { + return new SqlResultColumn(properties); + }; + + /** + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultColumn} message SqlResultColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + return writer; + }; + + /** + * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultColumn} message SqlResultColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultColumn.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResultColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultColumn message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn + */ + SqlResultColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResultColumn) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SqlResultColumn(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {google.cloud.alloydb.v1beta.SqlResultColumn} message SqlResultColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this SqlResultColumn to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @instance + * @returns {Object.} JSON object + */ + SqlResultColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultColumn + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SqlResultColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResultColumn"; + }; + + return SqlResultColumn; + })(); + + v1beta.SqlResultRow = (function() { + + /** + * Properties of a SqlResultRow. + * @memberof google.cloud.alloydb.v1beta + * @interface ISqlResultRow + * @property {Array.|null} [values] SqlResultRow values + */ + + /** + * Constructs a new SqlResultRow. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SqlResultRow. + * @implements ISqlResultRow + * @constructor + * @param {google.cloud.alloydb.v1beta.ISqlResultRow=} [properties] Properties to set + */ + function SqlResultRow(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultRow values. + * @member {Array.} values + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @instance + */ + SqlResultRow.prototype.values = $util.emptyArray; + + /** + * Creates a new SqlResultRow instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultRow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow instance + */ + SqlResultRow.create = function create(properties) { + return new SqlResultRow(properties); + }; + + /** + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultRow} message SqlResultRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.alloydb.v1beta.SqlResultValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultRow} message SqlResultRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultRow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResultRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.alloydb.v1beta.SqlResultValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultRow message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.alloydb.v1beta.SqlResultValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow + */ + SqlResultRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResultRow) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SqlResultRow(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.alloydb.v1beta.SqlResultRow.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.SqlResultRow.values: object expected"); + message.values[i] = $root.google.cloud.alloydb.v1beta.SqlResultValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {google.cloud.alloydb.v1beta.SqlResultRow} message SqlResultRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.alloydb.v1beta.SqlResultValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this SqlResultRow to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @instance + * @returns {Object.} JSON object + */ + SqlResultRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultRow + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SqlResultRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResultRow"; + }; + + return SqlResultRow; + })(); + + v1beta.SqlResultValue = (function() { + + /** + * Properties of a SqlResultValue. + * @memberof google.cloud.alloydb.v1beta + * @interface ISqlResultValue + * @property {string|null} [value] SqlResultValue value + * @property {boolean|null} [nullValue] SqlResultValue nullValue + */ + + /** + * Constructs a new SqlResultValue. + * @memberof google.cloud.alloydb.v1beta + * @classdesc Represents a SqlResultValue. + * @implements ISqlResultValue + * @constructor + * @param {google.cloud.alloydb.v1beta.ISqlResultValue=} [properties] Properties to set + */ + function SqlResultValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlResultValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @instance + */ + SqlResultValue.prototype.value = null; + + /** + * SqlResultValue nullValue. + * @member {boolean|null|undefined} nullValue + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @instance + */ + SqlResultValue.prototype.nullValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlResultValue.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SqlResultValue.prototype, "_nullValue", { + get: $util.oneOfGetter($oneOfFields = ["nullValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlResultValue instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultValue=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue instance + */ + SqlResultValue.create = function create(properties) { + return new SqlResultValue(properties); + }; + + /** + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultValue} message SqlResultValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.nullValue); + return writer; + }; + + /** + * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1beta.ISqlResultValue} message SqlResultValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResultValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.nullValue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlResultValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlResultValue message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlResultValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties._nullValue = 1; + if (typeof message.nullValue !== "boolean") + return "nullValue: boolean expected"; + } + return null; + }; + + /** + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue + */ + SqlResultValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResultValue) + return object; + var message = new $root.google.cloud.alloydb.v1beta.SqlResultValue(); + if (object.value != null) + message.value = String(object.value); + if (object.nullValue != null) + message.nullValue = Boolean(object.nullValue); + return message; + }; + + /** + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {google.cloud.alloydb.v1beta.SqlResultValue} message SqlResultValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlResultValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = message.nullValue; + if (options.oneofs) + object._nullValue = "nullValue"; + } + return object; + }; + + /** + * Converts this SqlResultValue to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @instance + * @returns {Object.} JSON object + */ + SqlResultValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlResultValue + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.SqlResultValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResultValue"; + }; + + return SqlResultValue; + })(); + + return v1beta; + })(); + + return alloydb; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hours = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int32(); + break; + } + case 3: { + message.seconds = reader.int32(); + break; + } + case 4: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeOfDay + * @function getTypeUrl + * @memberof google.type.TimeOfDay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeOfDay"; + }; + + return TimeOfDay; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-alloydb/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/protos/protos.json new file mode 100644 index 00000000000..7cbde53da89 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/protos/protos.json @@ -0,0 +1,17399 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "alloydb": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.AlloyDb.V1", + "go_package": "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb", + "java_multiple_files": true, + "java_outer_classname": "DataModelProto", + "java_package": "com.google.cloud.alloydb.v1", + "php_namespace": "Google\\Cloud\\AlloyDb\\V1", + "ruby_package": "Google::Cloud::AlloyDB::V1", + "(google.api.resource_definition).type": "compute.googleapis.com/ServiceAttachment", + "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" + }, + "nested": { + "CloudSQLBackupRunSource": { + "fields": { + "project": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupRunId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AlloyDBCSQLAdmin": { + "options": { + "(google.api.default_host)": "alloydb.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RestoreFromCloudSQL": { + "requestType": "RestoreFromCloudSQLRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "RestoreFromCloudSQLRequest": { + "oneofs": { + "source": { + "oneof": [ + "cloudsqlBackupRunSource" + ] + } + }, + "fields": { + "cloudsqlBackupRunSource": { + "type": "CloudSQLBackupRunSource", + "id": 101 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InstanceView": { + "values": { + "INSTANCE_VIEW_UNSPECIFIED": 0, + "INSTANCE_VIEW_BASIC": 1, + "INSTANCE_VIEW_FULL": 2 + } + }, + "ClusterView": { + "values": { + "CLUSTER_VIEW_UNSPECIFIED": 0, + "CLUSTER_VIEW_BASIC": 1, + "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 + } + }, + "DatabaseVersion": { + "valuesOptions": { + "POSTGRES_13": { + "deprecated": true + } + }, + "values": { + "DATABASE_VERSION_UNSPECIFIED": 0, + "POSTGRES_13": 1, + "POSTGRES_14": 2, + "POSTGRES_15": 3, + "POSTGRES_16": 4, + "POSTGRES_17": 5 + } + }, + "SubscriptionType": { + "values": { + "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "TRIAL": 2 + } + }, + "UserPassword": { + "fields": { + "user": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + } + } + }, + "MigrationSource": { + "fields": { + "hostPort": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referenceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceType": { + "type": "MigrationSourceType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MigrationSourceType": { + "values": { + "MIGRATION_SOURCE_TYPE_UNSPECIFIED": 0, + "DMS": 1 + } + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "SslConfig": { + "fields": { + "sslMode": { + "type": "SslMode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "caSource": { + "type": "CaSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SslMode": { + "valuesOptions": { + "SSL_MODE_ALLOW": { + "deprecated": true + }, + "SSL_MODE_REQUIRE": { + "deprecated": true + }, + "SSL_MODE_VERIFY_CA": { + "deprecated": true + } + }, + "values": { + "SSL_MODE_UNSPECIFIED": 0, + "SSL_MODE_ALLOW": 1, + "SSL_MODE_REQUIRE": 2, + "SSL_MODE_VERIFY_CA": 3, + "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, + "ENCRYPTED_ONLY": 5 + } + }, + "CaSource": { + "values": { + "CA_SOURCE_UNSPECIFIED": 0, + "CA_SOURCE_MANAGED": 1 + } + } + } + }, + "AutomatedBackupPolicy": { + "oneofs": { + "schedule": { + "oneof": [ + "weeklySchedule" + ] + }, + "retention": { + "oneof": [ + "timeBasedRetention", + "quantityBasedRetention" + ] + }, + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "weeklySchedule": { + "type": "WeeklySchedule", + "id": 2 + }, + "timeBasedRetention": { + "type": "TimeBasedRetention", + "id": 4 + }, + "quantityBasedRetention": { + "type": "QuantityBasedRetention", + "id": 5 + }, + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "backupWindow": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "location": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + } + }, + "nested": { + "WeeklySchedule": { + "fields": { + "startTimes": { + "rule": "repeated", + "type": "google.type.TimeOfDay", + "id": 1 + }, + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 2 + } + } + }, + "TimeBasedRetention": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "QuantityBasedRetention": { + "fields": { + "count": { + "type": "int32", + "id": 1 + } + } + } + } + }, + "ContinuousBackupConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "recoveryWindowDays": { + "type": "int32", + "id": 4 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 3 + } + } + }, + "ContinuousBackupInfo": { + "fields": { + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enabledTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schedule": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "earliestRestorableTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupSource": { + "fields": { + "backupUid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + } + } + }, + "ContinuousBackupSource": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pointInTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MaintenanceUpdatePolicy": { + "fields": { + "maintenanceWindows": { + "rule": "repeated", + "type": "MaintenanceWindow", + "id": 1 + }, + "denyMaintenancePeriods": { + "rule": "repeated", + "type": "DenyMaintenancePeriod", + "id": 2 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + }, + "DenyMaintenancePeriod": { + "fields": { + "startDate": { + "type": "google.type.Date", + "id": 1 + }, + "endDate": { + "type": "google.type.Date", + "id": 2 + }, + "time": { + "type": "google.type.TimeOfDay", + "id": 3 + } + } + } + } + }, + "MaintenanceSchedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", + "(google.api.resource).plural": "clusters", + "(google.api.resource).singular": "cluster", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "migrationSource", + "cloudsqlBackupRunSource" + ] + } + }, + "fields": { + "backupSource": { + "type": "BackupSource", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "migrationSource": { + "type": "MigrationSource", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudsqlBackupRunSource": { + "type": "CloudSQLBackupRunSource", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterType": { + "type": "ClusterType", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 10, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "etag": { + "type": "string", + "id": 11 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 12 + }, + "reconciling": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initialUser": { + "type": "UserPassword", + "id": 14, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "automatedBackupPolicy": { + "type": "AutomatedBackupPolicy", + "id": 17 + }, + "sslConfig": { + "type": "SslConfig", + "id": 18, + "options": { + "deprecated": true + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "continuousBackupConfig": { + "type": "ContinuousBackupConfig", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "continuousBackupInfo": { + "type": "ContinuousBackupInfo", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "secondaryConfig": { + "type": "SecondaryConfig", + "id": 22 + }, + "primaryConfig": { + "type": "PrimaryConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscConfig": { + "type": "PscConfig", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceUpdatePolicy": { + "type": "MaintenanceUpdatePolicy", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "subscriptionType": { + "type": "SubscriptionType", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trialMetadata": { + "type": "TrialMetadata", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataplexConfig": { + "type": "DataplexConfig", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SecondaryConfig": { + "fields": { + "primaryClusterName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + } + } + }, + "PrimaryConfig": { + "fields": { + "secondaryClusterNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + } + } + }, + "PscConfig": { + "fields": { + "pscEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceOwnedProjectNumber": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TrialMetadata": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "upgradeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "graceEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DataplexConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "STOPPED": 2, + "EMPTY": 3, + "CREATING": 4, + "DELETING": 5, + "FAILED": 6, + "BOOTSTRAPPING": 7, + "MAINTENANCE": 8, + "PROMOTING": 9 + } + }, + "ClusterType": { + "values": { + "CLUSTER_TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "SECONDARY": 2 + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceType": { + "type": "InstanceType", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "machineConfig": { + "type": "MachineConfig", + "id": 10 + }, + "availabilityType": { + "type": "AvailabilityType", + "id": 11 + }, + "gceZone": { + "type": "string", + "id": 12 + }, + "databaseFlags": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "writableNode": { + "type": "Node", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "queryInsightsConfig": { + "type": "QueryInsightsInstanceConfig", + "id": 21 + }, + "observabilityConfig": { + "type": "ObservabilityInstanceConfig", + "id": 26 + }, + "readPoolConfig": { + "type": "ReadPoolConfig", + "id": 14 + }, + "ipAddress": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIpAddress": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 17 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 18 + }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscInstanceConfig": { + "type": "PscInstanceConfig", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "InstanceNetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outboundPublicIpAddresses": { + "rule": "repeated", + "type": "string", + "id": 34, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "activationPolicy": { + "type": "ActivationPolicy", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionPoolConfig": { + "type": "ConnectionPoolConfig", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + }, + "machineType": { + "type": "string", + "id": 4 + } + } + }, + "Node": { + "fields": { + "zoneId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ip": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "QueryInsightsInstanceConfig": { + "oneofs": { + "_recordApplicationTags": { + "oneof": [ + "recordApplicationTags" + ] + }, + "_recordClientAddress": { + "oneof": [ + "recordClientAddress" + ] + }, + "_queryPlansPerMinute": { + "oneof": [ + "queryPlansPerMinute" + ] + } + }, + "fields": { + "recordApplicationTags": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "recordClientAddress": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "queryStringLength": { + "type": "uint32", + "id": 4 + }, + "queryPlansPerMinute": { + "type": "uint32", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "ObservabilityInstanceConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + }, + "_preserveComments": { + "oneof": [ + "preserveComments" + ] + }, + "_trackWaitEvents": { + "oneof": [ + "trackWaitEvents" + ] + }, + "_trackWaitEventTypes": { + "oneof": [ + "trackWaitEventTypes" + ] + }, + "_maxQueryStringLength": { + "oneof": [ + "maxQueryStringLength" + ] + }, + "_recordApplicationTags": { + "oneof": [ + "recordApplicationTags" + ] + }, + "_queryPlansPerMinute": { + "oneof": [ + "queryPlansPerMinute" + ] + }, + "_trackActiveQueries": { + "oneof": [ + "trackActiveQueries" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "preserveComments": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "trackWaitEvents": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "trackWaitEventTypes": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "maxQueryStringLength": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "recordApplicationTags": { + "type": "bool", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "queryPlansPerMinute": { + "type": "int32", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "trackActiveQueries": { + "type": "bool", + "id": 8, + "options": { + "proto3_optional": true + } + } + } + }, + "ReadPoolConfig": { + "fields": { + "nodeCount": { + "type": "int32", + "id": 1 + } + } + }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PscInterfaceConfig": { + "fields": { + "networkAttachmentResource": { + "type": "string", + "id": 1 + } + } + }, + "PscAutoConnectionConfig": { + "fields": { + "consumerProject": { + "type": "string", + "id": 1 + }, + "consumerNetwork": { + "type": "string", + "id": 2 + }, + "ipAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "consumerNetworkStatus": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/ServiceAttachment" + } + }, + "allowedConsumerProjects": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscDnsName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscInterfaceConfigs": { + "rule": "repeated", + "type": "PscInterfaceConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscAutoConnections": { + "rule": "repeated", + "type": "PscAutoConnectionConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceNetworkConfig": { + "fields": { + "authorizedExternalNetworks": { + "rule": "repeated", + "type": "AuthorizedNetwork", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enablePublicIp": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableOutboundPublicIp": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRangeOverride": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, + "ConnectionPoolConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flags": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "poolerCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "STOPPED": 2, + "CREATING": 3, + "DELETING": 4, + "MAINTENANCE": 5, + "FAILED": 6, + "BOOTSTRAPPING": 8, + "PROMOTING": 9 + } + }, + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "READ_POOL": 2, + "SECONDARY": 3 + } + }, + "AvailabilityType": { + "values": { + "AVAILABILITY_TYPE_UNSPECIFIED": 0, + "ZONAL": 1, + "REGIONAL": 2 + } + }, + "ActivationPolicy": { + "values": { + "ACTIVATION_POLICY_UNSPECIFIED": 0, + "ALWAYS": 1, + "NEVER": 2 + } + } + } + }, + "ConnectionInfo": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", + "(google.api.resource).plural": "connectionInfos", + "(google.api.resource).singular": "connectionInfo" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ipAddress": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIpAddress": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceUid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}", + "(google.api.resource).plural": "backups", + "(google.api.resource).singular": "backup", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createCompletionTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 8 + }, + "description": { + "type": "string", + "id": 9 + }, + "clusterUid": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "reconciling": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "sizeBytes": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expiryTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expiryQuantity": { + "type": "QuantityBasedExpiry", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "QuantityBasedExpiry": { + "fields": { + "retentionCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRetentionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "CREATING": 2, + "FAILED": 3, + "DELETING": 4 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ON_DEMAND": 1, + "AUTOMATED": 2, + "CONTINUOUS": 3 + } + } + } + }, + "SupportedDatabaseFlag": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", + "(google.api.resource).plural": "supportedDatabaseFlags", + "(google.api.resource).singular": "supportedDatabaseFlag" + }, + "oneofs": { + "restrictions": { + "oneof": [ + "stringRestrictions", + "integerRestrictions" + ] + }, + "recommendedValue": { + "oneof": [ + "recommendedStringValue", + "recommendedIntegerValue" + ] + } + }, + "fields": { + "stringRestrictions": { + "type": "StringRestrictions", + "id": 7 + }, + "integerRestrictions": { + "type": "IntegerRestrictions", + "id": 8 + }, + "recommendedStringValue": { + "type": "string", + "id": 10 + }, + "recommendedIntegerValue": { + "type": "google.protobuf.Int64Value", + "id": 11 + }, + "name": { + "type": "string", + "id": 1 + }, + "flagName": { + "type": "string", + "id": 2 + }, + "valueType": { + "type": "ValueType", + "id": 3 + }, + "acceptsMultipleValues": { + "type": "bool", + "id": 4 + }, + "supportedDbVersions": { + "rule": "repeated", + "type": "DatabaseVersion", + "id": 5 + }, + "requiresDbRestart": { + "type": "bool", + "id": 6 + }, + "scope": { + "type": "Scope", + "id": 9 + } + }, + "nested": { + "StringRestrictions": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IntegerRestrictions": { + "fields": { + "minValue": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "maxValue": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "FLOAT": 3, + "NONE": 4 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "DATABASE": 1, + "CONNECTION_POOL": 2 + } + } + } + }, + "User": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/User", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", + "(google.api.resource).plural": "users", + "(google.api.resource).singular": "user", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "databaseRoles": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userType": { + "type": "UserType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keepExtraRoles": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "UserType": { + "values": { + "USER_TYPE_UNSPECIFIED": 0, + "ALLOYDB_BUILT_IN": 1, + "ALLOYDB_IAM_USER": 2 + } + } + } + }, + "Database": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Database", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}", + "(google.api.resource).plural": "databases", + "(google.api.resource).singular": "database", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "_isTemplateDatabase": { + "oneof": [ + "isTemplateDatabase" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "characterType": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "databaseTemplate": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "isTemplateDatabase": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "AlloyDBAdmin": { + "options": { + "(google.api.default_host)": "alloydb.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{cluster.name=projects/*/locations/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{cluster.name=projects/*/locations/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportCluster": { + "requestType": "ExportClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options", + "(google.longrunning.operation_info).response_type": "ExportClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportCluster": { + "requestType": "ImportClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:import", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,gcs_uri,database,user", + "(google.longrunning.operation_info).response_type": "ImportClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*}:import", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,gcs_uri,database,user" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpgradeCluster": { + "requestType": "UpgradeClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/clusters/*}:upgrade", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,version", + "(google.longrunning.operation_info).response_type": "UpgradeClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/clusters/*}:upgrade", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpgradeClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PromoteCluster": { + "requestType": "PromoteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:promote", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*}:promote", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "SwitchoverCluster": { + "requestType": "SwitchoverClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:switchover", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*}:switchover", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestoreCluster": { + "requestType": "RestoreClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clusters:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateSecondaryCluster": { + "requestType": "CreateSecondaryClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/clusters/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateSecondaryInstance": { + "requestType": "CreateSecondaryInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "BatchCreateInstances": { + "requestType": "BatchCreateInstancesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + "(google.api.http).body": "requests", + "(google.longrunning.operation_info).response_type": "BatchCreateInstancesResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + "body": "requests" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchCreateInstancesResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FailoverInstance": { + "requestType": "FailoverInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "InjectFault": { + "requestType": "InjectFaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "(google.api.http).body": "*", + "(google.api.method_signature)": "fault_type,name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "body": "*" + } + }, + { + "(google.api.method_signature)": "fault_type,name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestartInstance": { + "requestType": "RestartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExecuteSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "ExecuteSqlResponse", + "options": { + "(google.api.http).post": "/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,database,user,sql_statement,password" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,database,user,sql_statement,password" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/locations/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSupportedDatabaseFlags": { + "requestType": "ListSupportedDatabaseFlagsRequest", + "responseType": "ListSupportedDatabaseFlagsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GenerateClientCertificate": { + "requestType": "GenerateClientCertificateRequest", + "responseType": "GenerateClientCertificateResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectionInfo": { + "requestType": "GetConnectionInfoRequest", + "responseType": "ConnectionInfo", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/clusters/*}/users" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user,user_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}/users", + "body": "user" + } + }, + { + "(google.api.method_signature)": "parent,user,user_id" + } + ] + }, + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).patch": "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", + "body": "user" + } + }, + { + "(google.api.method_signature)": "user,update_mask" + } + ] + }, + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatabases": { + "requestType": "ListDatabasesRequest", + "responseType": "ListDatabasesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/databases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/clusters/*}/databases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "view": { + "type": "ClusterView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateClusterRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cluster": { + "type": "Cluster", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportClusterRequest": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + }, + "exportOptions": { + "oneof": [ + "csvExportOptions", + "sqlExportOptions" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "csvExportOptions": { + "type": "CsvExportOptions", + "id": 4 + }, + "sqlExportOptions": { + "type": "SqlExportOptions", + "id": 5 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "database": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CsvExportOptions": { + "fields": { + "selectQuery": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quoteCharacter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "escapeCharacter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SqlExportOptions": { + "oneofs": { + "_schemaOnly": { + "oneof": [ + "schemaOnly" + ] + }, + "_cleanTargetObjects": { + "oneof": [ + "cleanTargetObjects" + ] + }, + "_ifExistTargetObjects": { + "oneof": [ + "ifExistTargetObjects" + ] + } + }, + "fields": { + "tables": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "cleanTargetObjects": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifExistTargetObjects": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + }, + "ExportClusterResponse": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportClusterRequest": { + "oneofs": { + "importOptions": { + "oneof": [ + "sqlImportOptions", + "csvImportOptions" + ] + } + }, + "fields": { + "sqlImportOptions": { + "type": "SqlImportOptions", + "id": 4 + }, + "csvImportOptions": { + "type": "CsvImportOptions", + "id": 7 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "database": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SqlImportOptions": { + "fields": {} + }, + "CsvImportOptions": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quoteCharacter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "escapeCharacter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ImportClusterResponse": { + "fields": { + "bytesDownloaded": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpgradeClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "version": { + "type": "DatabaseVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpgradeClusterResponse": { + "fields": { + "status": { + "type": "Status", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "clusterUpgradeDetails": { + "rule": "repeated", + "type": "ClusterUpgradeDetails", + "id": 3 + } + }, + "nested": { + "StageInfo": { + "fields": { + "stage": { + "type": "Stage", + "id": 1 + }, + "status": { + "type": "Status", + "id": 2 + }, + "logsUrl": { + "type": "string", + "id": 3 + } + } + }, + "InstanceUpgradeDetails": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "upgradeStatus": { + "type": "Status", + "id": 2 + }, + "instanceType": { + "type": "Instance.InstanceType", + "id": 3 + } + } + }, + "ClusterUpgradeDetails": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "upgradeStatus": { + "type": "Status", + "id": 2 + }, + "clusterType": { + "type": "Cluster.ClusterType", + "id": 3 + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 4 + }, + "stageInfo": { + "rule": "repeated", + "type": "StageInfo", + "id": 5 + }, + "instanceUpgradeDetails": { + "rule": "repeated", + "type": "InstanceUpgradeDetails", + "id": 6 + } + } + }, + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "NOT_STARTED": 4, + "IN_PROGRESS": 5, + "SUCCESS": 1, + "FAILED": 2, + "PARTIAL_SUCCESS": 3, + "CANCEL_IN_PROGRESS": 6, + "CANCELLED": 7 + } + }, + "Stage": { + "values": { + "STAGE_UNSPECIFIED": 0, + "ALLOYDB_PRECHECK": 1, + "PG_UPGRADE_CHECK": 2, + "PREPARE_FOR_UPGRADE": 5, + "PRIMARY_INSTANCE_UPGRADE": 3, + "READ_POOL_INSTANCES_UPGRADE": 4, + "ROLLBACK": 6, + "CLEANUP": 7 + } + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SwitchoverClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PromoteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreClusterRequest": { + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "continuousBackupSource" + ] + } + }, + "fields": { + "backupSource": { + "type": "BackupSource", + "id": 4 + }, + "continuousBackupSource": { + "type": "ContinuousBackupSource", + "id": 8 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "view": { + "type": "InstanceView", + "id": 2 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateInstanceRequests": { + "fields": { + "createInstanceRequests": { + "rule": "repeated", + "type": "CreateInstanceRequest", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "requests": { + "type": "CreateInstanceRequests", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchCreateInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + } + } + }, + "BatchCreateInstancesMetadata": { + "fields": { + "instanceTargets": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "instanceStatuses": { + "keyType": "string", + "type": "BatchCreateInstanceStatus", + "id": 2 + } + } + }, + "BatchCreateInstanceStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "errorMsg": { + "type": "string", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "type": { + "type": "Instance.InstanceType", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING_CREATE": 1, + "READY": 2, + "CREATING": 3, + "DELETING": 4, + "FAILED": 5, + "ROLLED_BACK": 6 + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FailoverInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InjectFaultRequest": { + "fields": { + "faultType": { + "type": "FaultType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FaultType": { + "values": { + "FAULT_TYPE_UNSPECIFIED": 0, + "STOP_VM": 1 + } + } + } + }, + "RestartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteSqlRequest": { + "oneofs": { + "userCredential": { + "oneof": [ + "password" + ] + } + }, + "fields": { + "password": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sqlStatement": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteSqlResponse": { + "fields": { + "sqlResults": { + "rule": "repeated", + "type": "SqlResult", + "id": 1 + }, + "metadata": { + "type": "ExecuteSqlMetadata", + "id": 3 + } + } + }, + "ExecuteSqlMetadata": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "partialResult": { + "type": "bool", + "id": 2 + }, + "sqlStatementExecutionDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "status": { + "type": "Status", + "id": 4 + } + }, + "nested": { + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "OK": 1, + "PARTIAL": 2, + "ERROR": 3 + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSupportedDatabaseFlagsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/SupportedDatabaseFlag" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "scope": { + "type": "SupportedDatabaseFlag.Scope", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSupportedDatabaseFlagsResponse": { + "fields": { + "supportedDatabaseFlags": { + "rule": "repeated", + "type": "SupportedDatabaseFlag", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GenerateClientCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "certDuration": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publicKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useMetadataExchange": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateClientCertificateResponse": { + "fields": { + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "caCert": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetConnectionInfoRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "oneofs": { + "requestSpecific": { + "oneof": [ + "batchCreateInstancesMetadata", + "upgradeClusterStatus" + ] + } + }, + "fields": { + "batchCreateInstancesMetadata": { + "type": "BatchCreateInstancesMetadata", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "upgradeClusterStatus": { + "type": "UpgradeClusterStatus", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UpgradeClusterStatus": { + "fields": { + "state": { + "type": "UpgradeClusterResponse.Status", + "id": 1 + }, + "cancellable": { + "type": "bool", + "id": 2 + }, + "sourceVersion": { + "type": "DatabaseVersion", + "id": 3 + }, + "targetVersion": { + "type": "DatabaseVersion", + "id": 4 + }, + "stages": { + "rule": "repeated", + "type": "StageStatus", + "id": 5 + } + }, + "nested": { + "StageStatus": { + "oneofs": { + "stageSpecificStatus": { + "oneof": [ + "readPoolInstancesUpgrade" + ] + } + }, + "fields": { + "readPoolInstancesUpgrade": { + "type": "ReadPoolInstancesUpgradeStageStatus", + "id": 11 + }, + "stage": { + "type": "UpgradeClusterResponse.Stage", + "id": 1 + }, + "state": { + "type": "UpgradeClusterResponse.Status", + "id": 2 + }, + "schedule": { + "type": "StageSchedule", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StageSchedule": { + "fields": { + "estimatedStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "actualStartTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "estimatedEndTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "actualEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + } + } + }, + "ReadPoolInstancesUpgradeStageStatus": { + "fields": { + "upgradeStats": { + "type": "Stats", + "id": 1 + } + }, + "nested": { + "Stats": { + "fields": { + "notStarted": { + "type": "int32", + "id": 1 + }, + "ongoing": { + "type": "int32", + "id": 2 + }, + "success": { + "type": "int32", + "id": 3 + }, + "failed": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatabasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatabasesResponse": { + "fields": { + "databases": { + "rule": "repeated", + "type": "Database", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SqlResult": { + "fields": { + "columns": { + "rule": "repeated", + "type": "SqlResultColumn", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "SqlResultRow", + "id": 2 + } + } + }, + "SqlResultColumn": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + } + } + }, + "SqlResultRow": { + "fields": { + "values": { + "rule": "repeated", + "type": "SqlResultValue", + "id": 1 + } + } + }, + "SqlResultValue": { + "oneofs": { + "_value": { + "oneof": [ + "value" + ] + }, + "_nullValue": { + "oneof": [ + "nullValue" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "nullValue": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "v1alpha": { + "options": { + "csharp_namespace": "Google.Cloud.AlloyDb.V1Alpha", + "go_package": "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb", + "java_multiple_files": true, + "java_outer_classname": "DataModelProto", + "java_package": "com.google.cloud.alloydb.v1alpha", + "php_namespace": "Google\\Cloud\\AlloyDb\\V1alpha", + "ruby_package": "Google::Cloud::AlloyDB::V1alpha", + "(google.api.resource_definition).type": "compute.googleapis.com/ServiceAttachment", + "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" + }, + "nested": { + "CloudSQLBackupRunSource": { + "fields": { + "project": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupRunId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AlloyDBCSQLAdmin": { + "options": { + "(google.api.default_host)": "alloydb.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RestoreFromCloudSQL": { + "requestType": "RestoreFromCloudSQLRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "RestoreFromCloudSQLRequest": { + "oneofs": { + "source": { + "oneof": [ + "cloudsqlBackupRunSource" + ] + } + }, + "fields": { + "cloudsqlBackupRunSource": { + "type": "CloudSQLBackupRunSource", + "id": 101 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InstanceView": { + "values": { + "INSTANCE_VIEW_UNSPECIFIED": 0, + "INSTANCE_VIEW_BASIC": 1, + "INSTANCE_VIEW_FULL": 2 + } + }, + "ClusterView": { + "values": { + "CLUSTER_VIEW_UNSPECIFIED": 0, + "CLUSTER_VIEW_BASIC": 1, + "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 + } + }, + "DatabaseVersion": { + "valuesOptions": { + "POSTGRES_13": { + "deprecated": true + } + }, + "values": { + "DATABASE_VERSION_UNSPECIFIED": 0, + "POSTGRES_13": 1, + "POSTGRES_14": 2, + "POSTGRES_15": 3, + "POSTGRES_16": 4, + "POSTGRES_17": 5, + "POSTGRES_18": 6 + } + }, + "SubscriptionType": { + "values": { + "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "TRIAL": 2 + } + }, + "UserPassword": { + "fields": { + "user": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + } + } + }, + "MigrationSource": { + "fields": { + "hostPort": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referenceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceType": { + "type": "MigrationSourceType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MigrationSourceType": { + "values": { + "MIGRATION_SOURCE_TYPE_UNSPECIFIED": 0, + "DMS": 1 + } + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "SslConfig": { + "fields": { + "sslMode": { + "type": "SslMode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "caSource": { + "type": "CaSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SslMode": { + "valuesOptions": { + "SSL_MODE_ALLOW": { + "deprecated": true + }, + "SSL_MODE_REQUIRE": { + "deprecated": true + }, + "SSL_MODE_VERIFY_CA": { + "deprecated": true + } + }, + "values": { + "SSL_MODE_UNSPECIFIED": 0, + "SSL_MODE_ALLOW": 1, + "SSL_MODE_REQUIRE": 2, + "SSL_MODE_VERIFY_CA": 3, + "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, + "ENCRYPTED_ONLY": 5 + } + }, + "CaSource": { + "values": { + "CA_SOURCE_UNSPECIFIED": 0, + "CA_SOURCE_MANAGED": 1 + } + } + } + }, + "AutomatedBackupPolicy": { + "oneofs": { + "schedule": { + "oneof": [ + "weeklySchedule" + ] + }, + "retention": { + "oneof": [ + "timeBasedRetention", + "quantityBasedRetention" + ] + }, + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "weeklySchedule": { + "type": "WeeklySchedule", + "id": 2 + }, + "timeBasedRetention": { + "type": "TimeBasedRetention", + "id": 4 + }, + "quantityBasedRetention": { + "type": "QuantityBasedRetention", + "id": 5 + }, + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "backupWindow": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "location": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + } + }, + "nested": { + "WeeklySchedule": { + "fields": { + "startTimes": { + "rule": "repeated", + "type": "google.type.TimeOfDay", + "id": 1 + }, + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 2 + } + } + }, + "TimeBasedRetention": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "QuantityBasedRetention": { + "fields": { + "count": { + "type": "int32", + "id": 1 + } + } + } + } + }, + "ContinuousBackupConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "recoveryWindowDays": { + "type": "int32", + "id": 4 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 3 + } + } + }, + "ContinuousBackupInfo": { + "fields": { + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enabledTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schedule": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "earliestRestorableTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupSource": { + "fields": { + "backupUid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + } + } + }, + "ContinuousBackupSource": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pointInTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MaintenanceUpdatePolicy": { + "fields": { + "maintenanceWindows": { + "rule": "repeated", + "type": "MaintenanceWindow", + "id": 1 + }, + "denyMaintenancePeriods": { + "rule": "repeated", + "type": "DenyMaintenancePeriod", + "id": 2 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + }, + "DenyMaintenancePeriod": { + "fields": { + "startDate": { + "type": "google.type.Date", + "id": 1 + }, + "endDate": { + "type": "google.type.Date", + "id": 2 + }, + "time": { + "type": "google.type.TimeOfDay", + "id": 3 + } + } + } + } + }, + "MaintenanceSchedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", + "(google.api.resource).plural": "clusters", + "(google.api.resource).singular": "cluster", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "migrationSource", + "cloudsqlBackupRunSource" + ] + } + }, + "fields": { + "backupSource": { + "type": "BackupSource", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "migrationSource": { + "type": "MigrationSource", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudsqlBackupRunSource": { + "type": "CloudSQLBackupRunSource", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterType": { + "type": "ClusterType", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 10, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "etag": { + "type": "string", + "id": 11 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 12 + }, + "reconciling": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initialUser": { + "type": "UserPassword", + "id": 14, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "automatedBackupPolicy": { + "type": "AutomatedBackupPolicy", + "id": 17 + }, + "sslConfig": { + "type": "SslConfig", + "id": 18, + "options": { + "deprecated": true + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "continuousBackupConfig": { + "type": "ContinuousBackupConfig", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "continuousBackupInfo": { + "type": "ContinuousBackupInfo", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "secondaryConfig": { + "type": "SecondaryConfig", + "id": 22 + }, + "primaryConfig": { + "type": "PrimaryConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscConfig": { + "type": "PscConfig", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceUpdatePolicy": { + "type": "MaintenanceUpdatePolicy", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "geminiConfig": { + "type": "GeminiClusterConfig", + "id": 36, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriptionType": { + "type": "SubscriptionType", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trialMetadata": { + "type": "TrialMetadata", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataplexConfig": { + "type": "DataplexConfig", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SecondaryConfig": { + "fields": { + "primaryClusterName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + } + } + }, + "PrimaryConfig": { + "fields": { + "secondaryClusterNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + } + } + }, + "PscConfig": { + "fields": { + "pscEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceOwnedProjectNumber": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TrialMetadata": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "upgradeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "graceEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DataplexConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "STOPPED": 2, + "EMPTY": 3, + "CREATING": 4, + "DELETING": 5, + "FAILED": 6, + "BOOTSTRAPPING": 7, + "MAINTENANCE": 8, + "PROMOTING": 9 + } + }, + "ClusterType": { + "values": { + "CLUSTER_TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "SECONDARY": 2 + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceType": { + "type": "InstanceType", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "machineConfig": { + "type": "MachineConfig", + "id": 10 + }, + "availabilityType": { + "type": "AvailabilityType", + "id": 11 + }, + "gceZone": { + "type": "string", + "id": 12 + }, + "databaseFlags": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "writableNode": { + "type": "Node", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "queryInsightsConfig": { + "type": "QueryInsightsInstanceConfig", + "id": 21 + }, + "observabilityConfig": { + "type": "ObservabilityInstanceConfig", + "id": 26 + }, + "readPoolConfig": { + "type": "ReadPoolConfig", + "id": 14 + }, + "ipAddress": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIpAddress": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 17 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 18 + }, + "updatePolicy": { + "type": "UpdatePolicy", + "id": 22 + }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscInstanceConfig": { + "type": "PscInstanceConfig", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "InstanceNetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "geminiConfig": { + "type": "GeminiInstanceConfig", + "id": 33, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outboundPublicIpAddresses": { + "rule": "repeated", + "type": "string", + "id": 34, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "activationPolicy": { + "type": "ActivationPolicy", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionPoolConfig": { + "type": "ConnectionPoolConfig", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcaConfig": { + "type": "GCAInstanceConfig", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + }, + "machineType": { + "type": "string", + "id": 4 + } + } + }, + "Node": { + "fields": { + "zoneId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ip": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "QueryInsightsInstanceConfig": { + "oneofs": { + "_recordApplicationTags": { + "oneof": [ + "recordApplicationTags" + ] + }, + "_recordClientAddress": { + "oneof": [ + "recordClientAddress" + ] + }, + "_queryPlansPerMinute": { + "oneof": [ + "queryPlansPerMinute" + ] + } + }, + "fields": { + "recordApplicationTags": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "recordClientAddress": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "queryStringLength": { + "type": "uint32", + "id": 4 + }, + "queryPlansPerMinute": { + "type": "uint32", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "ObservabilityInstanceConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + }, + "_preserveComments": { + "oneof": [ + "preserveComments" + ] + }, + "_trackWaitEvents": { + "oneof": [ + "trackWaitEvents" + ] + }, + "_trackWaitEventTypes": { + "oneof": [ + "trackWaitEventTypes" + ] + }, + "_maxQueryStringLength": { + "oneof": [ + "maxQueryStringLength" + ] + }, + "_recordApplicationTags": { + "oneof": [ + "recordApplicationTags" + ] + }, + "_queryPlansPerMinute": { + "oneof": [ + "queryPlansPerMinute" + ] + }, + "_trackActiveQueries": { + "oneof": [ + "trackActiveQueries" + ] + }, + "_trackClientAddress": { + "oneof": [ + "trackClientAddress" + ] + }, + "_assistiveExperiencesEnabled": { + "oneof": [ + "assistiveExperiencesEnabled" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "preserveComments": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "trackWaitEvents": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "trackWaitEventTypes": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "maxQueryStringLength": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "recordApplicationTags": { + "type": "bool", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "queryPlansPerMinute": { + "type": "int32", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "trackActiveQueries": { + "type": "bool", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "trackClientAddress": { + "type": "bool", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "assistiveExperiencesEnabled": { + "type": "bool", + "id": 10, + "options": { + "proto3_optional": true + } + } + } + }, + "ReadPoolConfig": { + "fields": { + "nodeCount": { + "type": "int32", + "id": 1 + } + } + }, + "UpdatePolicy": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DEFAULT": 1, + "FORCE_APPLY": 2 + } + } + } + }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PscInterfaceConfig": { + "fields": { + "networkAttachmentResource": { + "type": "string", + "id": 1 + } + } + }, + "PscAutoConnectionConfig": { + "fields": { + "consumerProject": { + "type": "string", + "id": 1 + }, + "consumerNetwork": { + "type": "string", + "id": 2 + }, + "ipAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "consumerNetworkStatus": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/ServiceAttachment" + } + }, + "allowedConsumerProjects": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscDnsName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscInterfaceConfigs": { + "rule": "repeated", + "type": "PscInterfaceConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscAutoConnections": { + "rule": "repeated", + "type": "PscAutoConnectionConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceNetworkConfig": { + "fields": { + "authorizedExternalNetworks": { + "rule": "repeated", + "type": "AuthorizedNetwork", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enablePublicIp": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableOutboundPublicIp": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRangeOverride": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, + "ConnectionPoolConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flags": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "poolerCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "STOPPED": 2, + "CREATING": 3, + "DELETING": 4, + "MAINTENANCE": 5, + "FAILED": 6, + "BOOTSTRAPPING": 8, + "PROMOTING": 9 + } + }, + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "READ_POOL": 2, + "SECONDARY": 3 + } + }, + "AvailabilityType": { + "values": { + "AVAILABILITY_TYPE_UNSPECIFIED": 0, + "ZONAL": 1, + "REGIONAL": 2 + } + }, + "ActivationPolicy": { + "values": { + "ACTIVATION_POLICY_UNSPECIFIED": 0, + "ALWAYS": 1, + "NEVER": 2 + } + } + } + }, + "ConnectionInfo": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", + "(google.api.resource).plural": "connectionInfos", + "(google.api.resource).singular": "connectionInfo" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ipAddress": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIpAddress": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceUid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscDnsName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}", + "(google.api.resource).plural": "backups", + "(google.api.resource).singular": "backup", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createCompletionTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 8 + }, + "description": { + "type": "string", + "id": 9 + }, + "clusterUid": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "reconciling": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "sizeBytes": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expiryTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expiryQuantity": { + "type": "QuantityBasedExpiry", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "QuantityBasedExpiry": { + "fields": { + "retentionCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRetentionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "CREATING": 2, + "FAILED": 3, + "DELETING": 4 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ON_DEMAND": 1, + "AUTOMATED": 2, + "CONTINUOUS": 3 + } + } + } + }, + "SupportedDatabaseFlag": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", + "(google.api.resource).plural": "supportedDatabaseFlags", + "(google.api.resource).singular": "supportedDatabaseFlag" + }, + "oneofs": { + "restrictions": { + "oneof": [ + "stringRestrictions", + "integerRestrictions" + ] + }, + "recommendedValue": { + "oneof": [ + "recommendedStringValue", + "recommendedIntegerValue" + ] + } + }, + "fields": { + "stringRestrictions": { + "type": "StringRestrictions", + "id": 7 + }, + "integerRestrictions": { + "type": "IntegerRestrictions", + "id": 8 + }, + "recommendedStringValue": { + "type": "string", + "id": 10 + }, + "recommendedIntegerValue": { + "type": "google.protobuf.Int64Value", + "id": 11 + }, + "name": { + "type": "string", + "id": 1 + }, + "flagName": { + "type": "string", + "id": 2 + }, + "valueType": { + "type": "ValueType", + "id": 3 + }, + "acceptsMultipleValues": { + "type": "bool", + "id": 4 + }, + "supportedDbVersions": { + "rule": "repeated", + "type": "DatabaseVersion", + "id": 5 + }, + "requiresDbRestart": { + "type": "bool", + "id": 6 + }, + "scope": { + "type": "Scope", + "id": 9 + } + }, + "nested": { + "StringRestrictions": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IntegerRestrictions": { + "fields": { + "minValue": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "maxValue": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "FLOAT": 3, + "NONE": 4 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "DATABASE": 1, + "CONNECTION_POOL": 2 + } + } + } + }, + "User": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/User", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", + "(google.api.resource).plural": "users", + "(google.api.resource).singular": "user", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "databaseRoles": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userType": { + "type": "UserType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keepExtraRoles": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "UserType": { + "values": { + "USER_TYPE_UNSPECIFIED": 0, + "ALLOYDB_BUILT_IN": 1, + "ALLOYDB_IAM_USER": 2 + } + } + } + }, + "Database": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Database", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}", + "(google.api.resource).plural": "databases", + "(google.api.resource).singular": "database", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "_isTemplateDatabase": { + "oneof": [ + "isTemplateDatabase" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "characterType": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "isTemplate": { + "type": "bool", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "databaseTemplate": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "isTemplateDatabase": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GCAEntitlementType": { + "values": { + "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": 0, + "GCA_STANDARD": 1 + } + }, + "GeminiClusterConfig": { + "fields": { + "entitled": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GeminiInstanceConfig": { + "fields": { + "entitled": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GCAInstanceConfig": { + "fields": { + "gcaEntitlement": { + "type": "GCAEntitlementType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AlloyDBAdmin": { + "options": { + "(google.api.default_host)": "alloydb.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportCluster": { + "requestType": "ExportClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options", + "(google.longrunning.operation_info).response_type": "ExportClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportCluster": { + "requestType": "ImportClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:import", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,gcs_uri,database,user", + "(google.longrunning.operation_info).response_type": "ImportClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:import", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,gcs_uri,database,user" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpgradeCluster": { + "requestType": "UpgradeClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha/{name=projects/*/locations/*/clusters/*}:upgrade", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,version", + "(google.longrunning.operation_info).response_type": "UpgradeClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{name=projects/*/locations/*/clusters/*}:upgrade", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpgradeClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PromoteCluster": { + "requestType": "PromoteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "SwitchoverCluster": { + "requestType": "SwitchoverClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:switchover", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:switchover", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestoreCluster": { + "requestType": "RestoreClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateSecondaryCluster": { + "requestType": "CreateSecondaryClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateSecondaryInstance": { + "requestType": "CreateSecondaryInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "BatchCreateInstances": { + "requestType": "BatchCreateInstancesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + "(google.api.http).body": "requests", + "(google.longrunning.operation_info).response_type": "BatchCreateInstancesResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + "body": "requests" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchCreateInstancesResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FailoverInstance": { + "requestType": "FailoverInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "InjectFault": { + "requestType": "InjectFaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "(google.api.http).body": "*", + "(google.api.method_signature)": "fault_type,name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "body": "*" + } + }, + { + "(google.api.method_signature)": "fault_type,name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestartInstance": { + "requestType": "RestartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExecuteSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "ExecuteSqlResponse", + "options": { + "(google.api.http).post": "/v1alpha/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,database,user,sql_statement,password" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,database,user,sql_statement,password" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSupportedDatabaseFlags": { + "requestType": "ListSupportedDatabaseFlagsRequest", + "responseType": "ListSupportedDatabaseFlagsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GenerateClientCertificate": { + "requestType": "GenerateClientCertificateRequest", + "responseType": "GenerateClientCertificateResponse", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectionInfo": { + "requestType": "GetConnectionInfoRequest", + "responseType": "ConnectionInfo", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user,user_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", + "body": "user" + } + }, + { + "(google.api.method_signature)": "parent,user,user_id" + } + ] + }, + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).patch": "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", + "body": "user" + } + }, + { + "(google.api.method_signature)": "user,update_mask" + } + ] + }, + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatabases": { + "requestType": "ListDatabasesRequest", + "responseType": "ListDatabasesResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDatabase": { + "requestType": "CreateDatabaseRequest", + "responseType": "Database", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases", + "(google.api.http).body": "database", + "(google.api.method_signature)": "parent,database,database_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases", + "body": "database" + } + }, + { + "(google.api.method_signature)": "parent,database,database_id" + } + ] + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "view": { + "type": "ClusterView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateClusterRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cluster": { + "type": "Cluster", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportClusterRequest": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + }, + "exportOptions": { + "oneof": [ + "csvExportOptions", + "sqlExportOptions" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "csvExportOptions": { + "type": "CsvExportOptions", + "id": 4 + }, + "sqlExportOptions": { + "type": "SqlExportOptions", + "id": 5 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "database": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CsvExportOptions": { + "fields": { + "selectQuery": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quoteCharacter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "escapeCharacter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SqlExportOptions": { + "oneofs": { + "_schemaOnly": { + "oneof": [ + "schemaOnly" + ] + }, + "_cleanTargetObjects": { + "oneof": [ + "cleanTargetObjects" + ] + }, + "_ifExistTargetObjects": { + "oneof": [ + "ifExistTargetObjects" + ] + } + }, + "fields": { + "tables": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "cleanTargetObjects": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifExistTargetObjects": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + }, + "ExportClusterResponse": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportClusterRequest": { + "oneofs": { + "importOptions": { + "oneof": [ + "sqlImportOptions", + "csvImportOptions" + ] + } + }, + "fields": { + "sqlImportOptions": { + "type": "SqlImportOptions", + "id": 4 + }, + "csvImportOptions": { + "type": "CsvImportOptions", + "id": 7 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "database": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SqlImportOptions": { + "fields": {} + }, + "CsvImportOptions": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quoteCharacter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "escapeCharacter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ImportClusterResponse": { + "fields": { + "bytesDownloaded": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpgradeClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "version": { + "type": "DatabaseVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpgradeClusterResponse": { + "fields": { + "status": { + "type": "Status", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "clusterUpgradeDetails": { + "rule": "repeated", + "type": "ClusterUpgradeDetails", + "id": 3 + } + }, + "nested": { + "StageInfo": { + "fields": { + "stage": { + "type": "Stage", + "id": 1 + }, + "status": { + "type": "Status", + "id": 2 + }, + "logsUrl": { + "type": "string", + "id": 3 + } + } + }, + "InstanceUpgradeDetails": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "upgradeStatus": { + "type": "Status", + "id": 2 + }, + "instanceType": { + "type": "Instance.InstanceType", + "id": 3 + } + } + }, + "ClusterUpgradeDetails": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "upgradeStatus": { + "type": "Status", + "id": 2 + }, + "clusterType": { + "type": "Cluster.ClusterType", + "id": 3 + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 4 + }, + "stageInfo": { + "rule": "repeated", + "type": "StageInfo", + "id": 5 + }, + "instanceUpgradeDetails": { + "rule": "repeated", + "type": "InstanceUpgradeDetails", + "id": 6 + } + } + }, + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "NOT_STARTED": 4, + "IN_PROGRESS": 5, + "SUCCESS": 1, + "FAILED": 2, + "PARTIAL_SUCCESS": 3, + "CANCEL_IN_PROGRESS": 6, + "CANCELLED": 7 + } + }, + "Stage": { + "values": { + "STAGE_UNSPECIFIED": 0, + "ALLOYDB_PRECHECK": 1, + "PG_UPGRADE_CHECK": 2, + "PREPARE_FOR_UPGRADE": 5, + "PRIMARY_INSTANCE_UPGRADE": 3, + "READ_POOL_INSTANCES_UPGRADE": 4, + "ROLLBACK": 6, + "CLEANUP": 7 + } + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SwitchoverClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PromoteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreClusterRequest": { + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "continuousBackupSource" + ] + } + }, + "fields": { + "backupSource": { + "type": "BackupSource", + "id": 4 + }, + "continuousBackupSource": { + "type": "ContinuousBackupSource", + "id": 8 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "view": { + "type": "InstanceView", + "id": 2 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateInstanceRequests": { + "fields": { + "createInstanceRequests": { + "rule": "repeated", + "type": "CreateInstanceRequest", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "requests": { + "type": "CreateInstanceRequests", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchCreateInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + } + } + }, + "BatchCreateInstancesMetadata": { + "fields": { + "instanceTargets": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "instanceStatuses": { + "keyType": "string", + "type": "BatchCreateInstanceStatus", + "id": 2 + } + } + }, + "BatchCreateInstanceStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "errorMsg": { + "type": "string", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "type": { + "type": "Instance.InstanceType", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING_CREATE": 1, + "READY": 2, + "CREATING": 3, + "DELETING": 4, + "FAILED": 5, + "ROLLED_BACK": 6 + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FailoverInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InjectFaultRequest": { + "fields": { + "faultType": { + "type": "FaultType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FaultType": { + "values": { + "FAULT_TYPE_UNSPECIFIED": 0, + "STOP_VM": 1 + } + } + } + }, + "RestartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteSqlRequest": { + "oneofs": { + "userCredential": { + "oneof": [ + "password" + ] + } + }, + "fields": { + "password": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sqlStatement": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteSqlResponse": { + "fields": { + "sqlResults": { + "rule": "repeated", + "type": "SqlResult", + "id": 1 + }, + "metadata": { + "type": "ExecuteSqlMetadata", + "id": 3 + } + } + }, + "ExecuteSqlMetadata": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "partialResult": { + "type": "bool", + "id": 2 + }, + "sqlStatementExecutionDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "status": { + "type": "Status", + "id": 4 + } + }, + "nested": { + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "OK": 1, + "PARTIAL": 2, + "ERROR": 3 + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSupportedDatabaseFlagsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/SupportedDatabaseFlag" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "scope": { + "type": "SupportedDatabaseFlag.Scope", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSupportedDatabaseFlagsResponse": { + "fields": { + "supportedDatabaseFlags": { + "rule": "repeated", + "type": "SupportedDatabaseFlag", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GenerateClientCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pemCsr": { + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "certDuration": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publicKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useMetadataExchange": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateClientCertificateResponse": { + "fields": { + "pemCertificate": { + "type": "string", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "caCert": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetConnectionInfoRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "oneofs": { + "requestSpecific": { + "oneof": [ + "batchCreateInstancesMetadata", + "promoteClusterStatus", + "upgradeClusterStatus" + ] + } + }, + "fields": { + "batchCreateInstancesMetadata": { + "type": "BatchCreateInstancesMetadata", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "promoteClusterStatus": { + "type": "PromoteClusterStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "upgradeClusterStatus": { + "type": "UpgradeClusterStatus", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PromoteClusterStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": 1, + "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": 2, + "PROMOTE_CLUSTER_COMPLETED": 3 + } + } + } + }, + "UpgradeClusterStatus": { + "fields": { + "state": { + "type": "UpgradeClusterResponse.Status", + "id": 1 + }, + "cancellable": { + "type": "bool", + "id": 2 + }, + "sourceVersion": { + "type": "DatabaseVersion", + "id": 3 + }, + "targetVersion": { + "type": "DatabaseVersion", + "id": 4 + }, + "stages": { + "rule": "repeated", + "type": "StageStatus", + "id": 5 + } + }, + "nested": { + "StageStatus": { + "oneofs": { + "stageSpecificStatus": { + "oneof": [ + "readPoolInstancesUpgrade" + ] + } + }, + "fields": { + "readPoolInstancesUpgrade": { + "type": "ReadPoolInstancesUpgradeStageStatus", + "id": 11 + }, + "stage": { + "type": "UpgradeClusterResponse.Stage", + "id": 1 + }, + "state": { + "type": "UpgradeClusterResponse.Status", + "id": 2 + }, + "schedule": { + "type": "StageSchedule", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StageSchedule": { + "fields": { + "estimatedStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "actualStartTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "estimatedEndTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "actualEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + } + } + }, + "ReadPoolInstancesUpgradeStageStatus": { + "fields": { + "upgradeStats": { + "type": "Stats", + "id": 1 + } + }, + "nested": { + "Stats": { + "fields": { + "notStarted": { + "type": "int32", + "id": 1 + }, + "ongoing": { + "type": "int32", + "id": 2 + }, + "success": { + "type": "int32", + "id": 3 + }, + "failed": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatabasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatabasesResponse": { + "fields": { + "databases": { + "rule": "repeated", + "type": "Database", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDatabaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" + } + }, + "databaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "database": { + "type": "Database", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SqlResult": { + "fields": { + "columns": { + "rule": "repeated", + "type": "SqlResultColumn", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "SqlResultRow", + "id": 2 + } + } + }, + "SqlResultColumn": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + } + } + }, + "SqlResultRow": { + "fields": { + "values": { + "rule": "repeated", + "type": "SqlResultValue", + "id": 1 + } + } + }, + "SqlResultValue": { + "oneofs": { + "_value": { + "oneof": [ + "value" + ] + }, + "_nullValue": { + "oneof": [ + "nullValue" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "nullValue": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "v1beta": { + "options": { + "csharp_namespace": "Google.Cloud.AlloyDb.V1Beta", + "go_package": "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb", + "java_multiple_files": true, + "java_outer_classname": "DataModelProto", + "java_package": "com.google.cloud.alloydb.v1beta", + "php_namespace": "Google\\Cloud\\AlloyDb\\V1beta", + "ruby_package": "Google::Cloud::AlloyDB::V1beta", + "(google.api.resource_definition).type": "compute.googleapis.com/ServiceAttachment", + "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" + }, + "nested": { + "CloudSQLBackupRunSource": { + "fields": { + "project": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupRunId": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AlloyDBCSQLAdmin": { + "options": { + "(google.api.default_host)": "alloydb.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RestoreFromCloudSQL": { + "requestType": "RestoreFromCloudSQLRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "RestoreFromCloudSQLRequest": { + "oneofs": { + "source": { + "oneof": [ + "cloudsqlBackupRunSource" + ] + } + }, + "fields": { + "cloudsqlBackupRunSource": { + "type": "CloudSQLBackupRunSource", + "id": 101 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InstanceView": { + "values": { + "INSTANCE_VIEW_UNSPECIFIED": 0, + "INSTANCE_VIEW_BASIC": 1, + "INSTANCE_VIEW_FULL": 2 + } + }, + "ClusterView": { + "values": { + "CLUSTER_VIEW_UNSPECIFIED": 0, + "CLUSTER_VIEW_BASIC": 1, + "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 + } + }, + "DatabaseVersion": { + "valuesOptions": { + "POSTGRES_13": { + "deprecated": true + } + }, + "values": { + "DATABASE_VERSION_UNSPECIFIED": 0, + "POSTGRES_13": 1, + "POSTGRES_14": 2, + "POSTGRES_15": 3, + "POSTGRES_16": 4, + "POSTGRES_17": 5, + "POSTGRES_18": 6 + } + }, + "SubscriptionType": { + "values": { + "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "TRIAL": 2 + } + }, + "UserPassword": { + "fields": { + "user": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + } + } + }, + "MigrationSource": { + "fields": { + "hostPort": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referenceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceType": { + "type": "MigrationSourceType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MigrationSourceType": { + "values": { + "MIGRATION_SOURCE_TYPE_UNSPECIFIED": 0, + "DMS": 1 + } + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "EncryptionInfo": { + "fields": { + "encryptionType": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GOOGLE_DEFAULT_ENCRYPTION": 1, + "CUSTOMER_MANAGED_ENCRYPTION": 2 + } + } + } + }, + "SslConfig": { + "fields": { + "sslMode": { + "type": "SslMode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "caSource": { + "type": "CaSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SslMode": { + "valuesOptions": { + "SSL_MODE_ALLOW": { + "deprecated": true + }, + "SSL_MODE_REQUIRE": { + "deprecated": true + }, + "SSL_MODE_VERIFY_CA": { + "deprecated": true + } + }, + "values": { + "SSL_MODE_UNSPECIFIED": 0, + "SSL_MODE_ALLOW": 1, + "SSL_MODE_REQUIRE": 2, + "SSL_MODE_VERIFY_CA": 3, + "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, + "ENCRYPTED_ONLY": 5 + } + }, + "CaSource": { + "values": { + "CA_SOURCE_UNSPECIFIED": 0, + "CA_SOURCE_MANAGED": 1 + } + } + } + }, + "AutomatedBackupPolicy": { + "oneofs": { + "schedule": { + "oneof": [ + "weeklySchedule" + ] + }, + "retention": { + "oneof": [ + "timeBasedRetention", + "quantityBasedRetention" + ] + }, + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "weeklySchedule": { + "type": "WeeklySchedule", + "id": 2 + }, + "timeBasedRetention": { + "type": "TimeBasedRetention", + "id": 4 + }, + "quantityBasedRetention": { + "type": "QuantityBasedRetention", + "id": 5 + }, + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "backupWindow": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "location": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + } + }, + "nested": { + "WeeklySchedule": { + "fields": { + "startTimes": { + "rule": "repeated", + "type": "google.type.TimeOfDay", + "id": 1 + }, + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 2 + } + } + }, + "TimeBasedRetention": { + "fields": { + "retentionPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "QuantityBasedRetention": { + "fields": { + "count": { + "type": "int32", + "id": 1 + } + } + } + } + }, + "ContinuousBackupConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "recoveryWindowDays": { + "type": "int32", + "id": 4 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 3 + } + } + }, + "ContinuousBackupInfo": { + "fields": { + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enabledTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schedule": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "earliestRestorableTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupSource": { + "fields": { + "backupUid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + } + } + }, + "ContinuousBackupSource": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pointInTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MaintenanceUpdatePolicy": { + "fields": { + "maintenanceWindows": { + "rule": "repeated", + "type": "MaintenanceWindow", + "id": 1 + }, + "denyMaintenancePeriods": { + "rule": "repeated", + "type": "DenyMaintenancePeriod", + "id": 2 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + }, + "DenyMaintenancePeriod": { + "fields": { + "startDate": { + "type": "google.type.Date", + "id": 1 + }, + "endDate": { + "type": "google.type.Date", + "id": 2 + }, + "time": { + "type": "google.type.TimeOfDay", + "id": 3 + } + } + } + } + }, + "MaintenanceSchedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", + "(google.api.resource).plural": "clusters", + "(google.api.resource).singular": "cluster", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "migrationSource", + "cloudsqlBackupRunSource" + ] + } + }, + "fields": { + "backupSource": { + "type": "BackupSource", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "migrationSource": { + "type": "MigrationSource", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudsqlBackupRunSource": { + "type": "CloudSQLBackupRunSource", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterType": { + "type": "ClusterType", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 10, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "etag": { + "type": "string", + "id": 11 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 12 + }, + "reconciling": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "initialUser": { + "type": "UserPassword", + "id": 14, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "automatedBackupPolicy": { + "type": "AutomatedBackupPolicy", + "id": 17 + }, + "sslConfig": { + "type": "SslConfig", + "id": 18, + "options": { + "deprecated": true + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "continuousBackupConfig": { + "type": "ContinuousBackupConfig", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "continuousBackupInfo": { + "type": "ContinuousBackupInfo", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "secondaryConfig": { + "type": "SecondaryConfig", + "id": 22 + }, + "primaryConfig": { + "type": "PrimaryConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscConfig": { + "type": "PscConfig", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceUpdatePolicy": { + "type": "MaintenanceUpdatePolicy", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "geminiConfig": { + "type": "GeminiClusterConfig", + "id": 36, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subscriptionType": { + "type": "SubscriptionType", + "id": 38, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trialMetadata": { + "type": "TrialMetadata", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataplexConfig": { + "type": "DataplexConfig", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SecondaryConfig": { + "fields": { + "primaryClusterName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + } + } + }, + "PrimaryConfig": { + "fields": { + "secondaryClusterNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + } + } + }, + "PscConfig": { + "fields": { + "pscEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceOwnedProjectNumber": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TrialMetadata": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "upgradeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "graceEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DataplexConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "STOPPED": 2, + "EMPTY": 3, + "CREATING": 4, + "DELETING": 5, + "FAILED": 6, + "BOOTSTRAPPING": 7, + "MAINTENANCE": 8, + "PROMOTING": 9 + } + }, + "ClusterType": { + "values": { + "CLUSTER_TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "SECONDARY": 2 + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceType": { + "type": "InstanceType", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "machineConfig": { + "type": "MachineConfig", + "id": 10 + }, + "availabilityType": { + "type": "AvailabilityType", + "id": 11 + }, + "gceZone": { + "type": "string", + "id": 12 + }, + "databaseFlags": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "writableNode": { + "type": "Node", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodes": { + "rule": "repeated", + "type": "Node", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "queryInsightsConfig": { + "type": "QueryInsightsInstanceConfig", + "id": 21 + }, + "observabilityConfig": { + "type": "ObservabilityInstanceConfig", + "id": 26 + }, + "readPoolConfig": { + "type": "ReadPoolConfig", + "id": 14 + }, + "ipAddress": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIpAddress": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 17 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 18 + }, + "updatePolicy": { + "type": "UpdatePolicy", + "id": 22 + }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscInstanceConfig": { + "type": "PscInstanceConfig", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "InstanceNetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "geminiConfig": { + "type": "GeminiInstanceConfig", + "id": 33, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outboundPublicIpAddresses": { + "rule": "repeated", + "type": "string", + "id": 34, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "activationPolicy": { + "type": "ActivationPolicy", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionPoolConfig": { + "type": "ConnectionPoolConfig", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcaConfig": { + "type": "GCAInstanceConfig", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + }, + "machineType": { + "type": "string", + "id": 4 + } + } + }, + "Node": { + "fields": { + "zoneId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ip": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "QueryInsightsInstanceConfig": { + "oneofs": { + "_recordApplicationTags": { + "oneof": [ + "recordApplicationTags" + ] + }, + "_recordClientAddress": { + "oneof": [ + "recordClientAddress" + ] + }, + "_queryPlansPerMinute": { + "oneof": [ + "queryPlansPerMinute" + ] + } + }, + "fields": { + "recordApplicationTags": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "recordClientAddress": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "queryStringLength": { + "type": "uint32", + "id": 4 + }, + "queryPlansPerMinute": { + "type": "uint32", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "ObservabilityInstanceConfig": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + }, + "_preserveComments": { + "oneof": [ + "preserveComments" + ] + }, + "_trackWaitEvents": { + "oneof": [ + "trackWaitEvents" + ] + }, + "_trackWaitEventTypes": { + "oneof": [ + "trackWaitEventTypes" + ] + }, + "_maxQueryStringLength": { + "oneof": [ + "maxQueryStringLength" + ] + }, + "_recordApplicationTags": { + "oneof": [ + "recordApplicationTags" + ] + }, + "_queryPlansPerMinute": { + "oneof": [ + "queryPlansPerMinute" + ] + }, + "_trackActiveQueries": { + "oneof": [ + "trackActiveQueries" + ] + }, + "_trackClientAddress": { + "oneof": [ + "trackClientAddress" + ] + }, + "_assistiveExperiencesEnabled": { + "oneof": [ + "assistiveExperiencesEnabled" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "preserveComments": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "trackWaitEvents": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "trackWaitEventTypes": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "maxQueryStringLength": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "recordApplicationTags": { + "type": "bool", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "queryPlansPerMinute": { + "type": "int32", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "trackActiveQueries": { + "type": "bool", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "trackClientAddress": { + "type": "bool", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "assistiveExperiencesEnabled": { + "type": "bool", + "id": 10, + "options": { + "proto3_optional": true + } + } + } + }, + "ReadPoolConfig": { + "fields": { + "nodeCount": { + "type": "int32", + "id": 1 + } + } + }, + "UpdatePolicy": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "DEFAULT": 1, + "FORCE_APPLY": 2 + } + } + } + }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PscInterfaceConfig": { + "fields": { + "networkAttachmentResource": { + "type": "string", + "id": 1 + } + } + }, + "PscAutoConnectionConfig": { + "fields": { + "consumerProject": { + "type": "string", + "id": 1 + }, + "consumerNetwork": { + "type": "string", + "id": 2 + }, + "ipAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "consumerNetworkStatus": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/ServiceAttachment" + } + }, + "allowedConsumerProjects": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscDnsName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscInterfaceConfigs": { + "rule": "repeated", + "type": "PscInterfaceConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscAutoConnections": { + "rule": "repeated", + "type": "PscAutoConnectionConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceNetworkConfig": { + "fields": { + "authorizedExternalNetworks": { + "rule": "repeated", + "type": "AuthorizedNetwork", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enablePublicIp": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableOutboundPublicIp": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRangeOverride": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, + "ConnectionPoolConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flags": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "poolerCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "STOPPED": 2, + "CREATING": 3, + "DELETING": 4, + "MAINTENANCE": 5, + "FAILED": 6, + "BOOTSTRAPPING": 8, + "PROMOTING": 9 + } + }, + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "READ_POOL": 2, + "SECONDARY": 3 + } + }, + "AvailabilityType": { + "values": { + "AVAILABILITY_TYPE_UNSPECIFIED": 0, + "ZONAL": 1, + "REGIONAL": 2 + } + }, + "ActivationPolicy": { + "values": { + "ACTIVATION_POLICY_UNSPECIFIED": 0, + "ALWAYS": 1, + "NEVER": 2 + } + } + } + }, + "ConnectionInfo": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", + "(google.api.resource).plural": "connectionInfos", + "(google.api.resource).singular": "connectionInfo" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ipAddress": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIpAddress": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceUid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pscDnsName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}", + "(google.api.resource).plural": "backups", + "(google.api.resource).singular": "backup", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createCompletionTime": { + "type": "google.protobuf.Timestamp", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 8 + }, + "description": { + "type": "string", + "id": 9 + }, + "clusterUid": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "reconciling": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionInfo": { + "type": "EncryptionInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "sizeBytes": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expiryTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expiryQuantity": { + "type": "QuantityBasedExpiry", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tags": { + "keyType": "string", + "type": "string", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "QuantityBasedExpiry": { + "fields": { + "retentionCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRetentionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "CREATING": 2, + "FAILED": 3, + "DELETING": 4 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ON_DEMAND": 1, + "AUTOMATED": 2, + "CONTINUOUS": 3 + } + } + } + }, + "SupportedDatabaseFlag": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", + "(google.api.resource).plural": "supportedDatabaseFlags", + "(google.api.resource).singular": "supportedDatabaseFlag" + }, + "oneofs": { + "restrictions": { + "oneof": [ + "stringRestrictions", + "integerRestrictions" + ] + }, + "recommendedValue": { + "oneof": [ + "recommendedStringValue", + "recommendedIntegerValue" + ] + } + }, + "fields": { + "stringRestrictions": { + "type": "StringRestrictions", + "id": 7 + }, + "integerRestrictions": { + "type": "IntegerRestrictions", + "id": 8 + }, + "recommendedStringValue": { + "type": "string", + "id": 10 + }, + "recommendedIntegerValue": { + "type": "google.protobuf.Int64Value", + "id": 11 + }, + "name": { + "type": "string", + "id": 1 + }, + "flagName": { + "type": "string", + "id": 2 + }, + "valueType": { + "type": "ValueType", + "id": 3 + }, + "acceptsMultipleValues": { + "type": "bool", + "id": 4 + }, + "supportedDbVersions": { + "rule": "repeated", + "type": "DatabaseVersion", + "id": 5 + }, + "requiresDbRestart": { + "type": "bool", + "id": 6 + }, + "scope": { + "type": "Scope", + "id": 9 + } + }, + "nested": { + "StringRestrictions": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IntegerRestrictions": { + "fields": { + "minValue": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "maxValue": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "FLOAT": 3, + "NONE": 4 + } + }, + "Scope": { + "values": { + "SCOPE_UNSPECIFIED": 0, + "DATABASE": 1, + "CONNECTION_POOL": 2 + } + } + } + }, + "User": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/User", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", + "(google.api.resource).plural": "users", + "(google.api.resource).singular": "user", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "databaseRoles": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userType": { + "type": "UserType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keepExtraRoles": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "UserType": { + "values": { + "USER_TYPE_UNSPECIFIED": 0, + "ALLOYDB_BUILT_IN": 1, + "ALLOYDB_IAM_USER": 2 + } + } + } + }, + "Database": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Database", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}", + "(google.api.resource).plural": "databases", + "(google.api.resource).singular": "database", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "_isTemplateDatabase": { + "oneof": [ + "isTemplateDatabase" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "characterType": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "isTemplate": { + "type": "bool", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "databaseTemplate": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "isTemplateDatabase": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GCAEntitlementType": { + "values": { + "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": 0, + "GCA_STANDARD": 1 + } + }, + "GeminiClusterConfig": { + "fields": { + "entitled": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GeminiInstanceConfig": { + "fields": { + "entitled": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GCAInstanceConfig": { + "fields": { + "gcaEntitlement": { + "type": "GCAEntitlementType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AlloyDBAdmin": { + "options": { + "(google.api.default_host)": "alloydb.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportCluster": { + "requestType": "ExportClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options", + "(google.longrunning.operation_info).response_type": "ExportClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportCluster": { + "requestType": "ImportClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:import", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,gcs_uri,database,user", + "(google.longrunning.operation_info).response_type": "ImportClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:import", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,gcs_uri,database,user" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpgradeCluster": { + "requestType": "UpgradeClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,version", + "(google.longrunning.operation_info).response_type": "UpgradeClusterResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpgradeClusterResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PromoteCluster": { + "requestType": "PromoteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:promote", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:promote", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "SwitchoverCluster": { + "requestType": "SwitchoverClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:switchover", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:switchover", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestoreCluster": { + "requestType": "RestoreClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/clusters:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateSecondaryCluster": { + "requestType": "CreateSecondaryClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateSecondaryInstance": { + "requestType": "CreateSecondaryInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "BatchCreateInstances": { + "requestType": "BatchCreateInstancesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + "(google.api.http).body": "requests", + "(google.longrunning.operation_info).response_type": "BatchCreateInstancesResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", + "body": "requests" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchCreateInstancesResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FailoverInstance": { + "requestType": "FailoverInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "InjectFault": { + "requestType": "InjectFaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "(google.api.http).body": "*", + "(google.api.method_signature)": "fault_type,name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", + "body": "*" + } + }, + { + "(google.api.method_signature)": "fault_type,name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestartInstance": { + "requestType": "RestartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExecuteSql": { + "requestType": "ExecuteSqlRequest", + "responseType": "ExecuteSqlResponse", + "options": { + "(google.api.http).post": "/v1beta/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,database,user,sql_statement,password" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,database,user,sql_statement,password" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{backup.name=projects/*/locations/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{backup.name=projects/*/locations/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSupportedDatabaseFlags": { + "requestType": "ListSupportedDatabaseFlagsRequest", + "responseType": "ListSupportedDatabaseFlagsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GenerateClientCertificate": { + "requestType": "GenerateClientCertificateRequest", + "responseType": "GenerateClientCertificateResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectionInfo": { + "requestType": "GetConnectionInfoRequest", + "responseType": "ConnectionInfo", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user,user_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", + "body": "user" + } + }, + { + "(google.api.method_signature)": "parent,user,user_id" + } + ] + }, + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).patch": "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", + "body": "user" + } + }, + { + "(google.api.method_signature)": "user,update_mask" + } + ] + }, + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatabases": { + "requestType": "ListDatabasesRequest", + "responseType": "ListDatabasesResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateDatabase": { + "requestType": "CreateDatabaseRequest", + "responseType": "Database", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases", + "(google.api.http).body": "database", + "(google.api.method_signature)": "parent,database,database_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases", + "body": "database" + } + }, + { + "(google.api.method_signature)": "parent,database,database_id" + } + ] + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "view": { + "type": "ClusterView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateClusterRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cluster": { + "type": "Cluster", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportClusterRequest": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + }, + "exportOptions": { + "oneof": [ + "csvExportOptions", + "sqlExportOptions" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "csvExportOptions": { + "type": "CsvExportOptions", + "id": 4 + }, + "sqlExportOptions": { + "type": "SqlExportOptions", + "id": 5 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "database": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CsvExportOptions": { + "fields": { + "selectQuery": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quoteCharacter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "escapeCharacter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SqlExportOptions": { + "oneofs": { + "_schemaOnly": { + "oneof": [ + "schemaOnly" + ] + }, + "_cleanTargetObjects": { + "oneof": [ + "cleanTargetObjects" + ] + }, + "_ifExistTargetObjects": { + "oneof": [ + "ifExistTargetObjects" + ] + } + }, + "fields": { + "tables": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "cleanTargetObjects": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ifExistTargetObjects": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + }, + "ExportClusterResponse": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportClusterRequest": { + "oneofs": { + "importOptions": { + "oneof": [ + "sqlImportOptions", + "csvImportOptions" + ] + } + }, + "fields": { + "sqlImportOptions": { + "type": "SqlImportOptions", + "id": 4 + }, + "csvImportOptions": { + "type": "CsvImportOptions", + "id": 7 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "database": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SqlImportOptions": { + "fields": {} + }, + "CsvImportOptions": { + "fields": { + "table": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quoteCharacter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "escapeCharacter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ImportClusterResponse": { + "fields": { + "bytesDownloaded": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpgradeClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "version": { + "type": "DatabaseVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpgradeClusterResponse": { + "fields": { + "status": { + "type": "Status", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "clusterUpgradeDetails": { + "rule": "repeated", + "type": "ClusterUpgradeDetails", + "id": 3 + } + }, + "nested": { + "StageInfo": { + "fields": { + "stage": { + "type": "Stage", + "id": 1 + }, + "status": { + "type": "Status", + "id": 2 + }, + "logsUrl": { + "type": "string", + "id": 3 + } + } + }, + "InstanceUpgradeDetails": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "upgradeStatus": { + "type": "Status", + "id": 2 + }, + "instanceType": { + "type": "Instance.InstanceType", + "id": 3 + } + } + }, + "ClusterUpgradeDetails": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "upgradeStatus": { + "type": "Status", + "id": 2 + }, + "clusterType": { + "type": "Cluster.ClusterType", + "id": 3 + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 4 + }, + "stageInfo": { + "rule": "repeated", + "type": "StageInfo", + "id": 5 + }, + "instanceUpgradeDetails": { + "rule": "repeated", + "type": "InstanceUpgradeDetails", + "id": 6 + } + } + }, + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "NOT_STARTED": 4, + "IN_PROGRESS": 5, + "SUCCESS": 1, + "FAILED": 2, + "PARTIAL_SUCCESS": 3, + "CANCEL_IN_PROGRESS": 6, + "CANCELLED": 7 + } + }, + "Stage": { + "values": { + "STAGE_UNSPECIFIED": 0, + "ALLOYDB_PRECHECK": 1, + "PG_UPGRADE_CHECK": 2, + "PREPARE_FOR_UPGRADE": 5, + "PRIMARY_INSTANCE_UPGRADE": 3, + "READ_POOL_INSTANCES_UPGRADE": 4, + "ROLLBACK": 6, + "CLEANUP": 7 + } + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SwitchoverClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PromoteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreClusterRequest": { + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "continuousBackupSource" + ] + } + }, + "fields": { + "backupSource": { + "type": "BackupSource", + "id": 4 + }, + "continuousBackupSource": { + "type": "ContinuousBackupSource", + "id": 8 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "view": { + "type": "InstanceView", + "id": 2 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateSecondaryInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateInstanceRequests": { + "fields": { + "createInstanceRequests": { + "rule": "repeated", + "type": "CreateInstanceRequest", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" + } + }, + "requests": { + "type": "CreateInstanceRequests", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchCreateInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + } + } + }, + "BatchCreateInstancesMetadata": { + "fields": { + "instanceTargets": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "instanceStatuses": { + "keyType": "string", + "type": "BatchCreateInstanceStatus", + "id": 2 + } + } + }, + "BatchCreateInstanceStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "errorMsg": { + "type": "string", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "type": { + "type": "Instance.InstanceType", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING_CREATE": 1, + "READY": 2, + "CREATING": 3, + "DELETING": 4, + "FAILED": 5, + "ROLLED_BACK": 6 + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FailoverInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InjectFaultRequest": { + "fields": { + "faultType": { + "type": "FaultType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FaultType": { + "values": { + "FAULT_TYPE_UNSPECIFIED": 0, + "STOP_VM": 1 + } + } + } + }, + "RestartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteSqlRequest": { + "oneofs": { + "userCredential": { + "oneof": [ + "password" + ] + } + }, + "fields": { + "password": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sqlStatement": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecuteSqlResponse": { + "fields": { + "sqlResults": { + "rule": "repeated", + "type": "SqlResult", + "id": 1 + }, + "metadata": { + "type": "ExecuteSqlMetadata", + "id": 3 + } + } + }, + "ExecuteSqlMetadata": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "partialResult": { + "type": "bool", + "id": 2 + }, + "sqlStatementExecutionDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "status": { + "type": "Status", + "id": 4 + } + }, + "nested": { + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "OK": 1, + "PARTIAL": 2, + "ERROR": 3 + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" + } + }, + "backupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSupportedDatabaseFlagsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/SupportedDatabaseFlag" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "scope": { + "type": "SupportedDatabaseFlag.Scope", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSupportedDatabaseFlagsResponse": { + "fields": { + "supportedDatabaseFlags": { + "rule": "repeated", + "type": "SupportedDatabaseFlag", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GenerateClientCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pemCsr": { + "type": "string", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "certDuration": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publicKey": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useMetadataExchange": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GenerateClientCertificateResponse": { + "fields": { + "pemCertificate": { + "type": "string", + "id": 1, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificateChain": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "caCert": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetConnectionInfoRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "oneofs": { + "requestSpecific": { + "oneof": [ + "batchCreateInstancesMetadata", + "promoteClusterStatus", + "upgradeClusterStatus" + ] + } + }, + "fields": { + "batchCreateInstancesMetadata": { + "type": "BatchCreateInstancesMetadata", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "promoteClusterStatus": { + "type": "PromoteClusterStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "upgradeClusterStatus": { + "type": "UpgradeClusterStatus", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PromoteClusterStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": 1, + "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": 2, + "PROMOTE_CLUSTER_COMPLETED": 3 + } + } + } + }, + "UpgradeClusterStatus": { + "fields": { + "state": { + "type": "UpgradeClusterResponse.Status", + "id": 1 + }, + "cancellable": { + "type": "bool", + "id": 2 + }, + "sourceVersion": { + "type": "DatabaseVersion", + "id": 3 + }, + "targetVersion": { + "type": "DatabaseVersion", + "id": 4 + }, + "stages": { + "rule": "repeated", + "type": "StageStatus", + "id": 5 + } + }, + "nested": { + "StageStatus": { + "oneofs": { + "stageSpecificStatus": { + "oneof": [ + "readPoolInstancesUpgrade" + ] + } + }, + "fields": { + "readPoolInstancesUpgrade": { + "type": "ReadPoolInstancesUpgradeStageStatus", + "id": 11 + }, + "stage": { + "type": "UpgradeClusterResponse.Stage", + "id": 1 + }, + "state": { + "type": "UpgradeClusterResponse.Status", + "id": 2 + }, + "schedule": { + "type": "StageSchedule", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StageSchedule": { + "fields": { + "estimatedStartTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "actualStartTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "estimatedEndTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "actualEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + } + } + }, + "ReadPoolInstancesUpgradeStageStatus": { + "fields": { + "upgradeStats": { + "type": "Stats", + "id": 1 + } + }, + "nested": { + "Stats": { + "fields": { + "notStarted": { + "type": "int32", + "id": 1 + }, + "ongoing": { + "type": "int32", + "id": 2 + }, + "success": { + "type": "int32", + "id": 3 + }, + "failed": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "alloydb.googleapis.com/User" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatabasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatabasesResponse": { + "fields": { + "databases": { + "rule": "repeated", + "type": "Database", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDatabaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" + } + }, + "databaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "database": { + "type": "Database", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SqlResult": { + "fields": { + "columns": { + "rule": "repeated", + "type": "SqlResultColumn", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "SqlResultRow", + "id": 2 + } + } + }, + "SqlResultColumn": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + } + } + }, + "SqlResultRow": { + "fields": { + "values": { + "rule": "repeated", + "type": "SqlResultValue", + "id": 1 + } + } + }, + "SqlResultValue": { + "oneofs": { + "_value": { + "oneof": [ + "value" + ] + }, + "_nullValue": { + "oneof": [ + "nullValue" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "nullValue": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldInfoProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js new file mode 100644 index 00000000000..14fdd2d6902 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requests) { + // [START alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. + */ + // const parent = 'abc123' + /** + * Required. Resources being created. + */ + // const requests = {} + /** + * 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). + */ + // const requestId = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callBatchCreateInstances() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const [operation] = await alloydbClient.batchCreateInstances(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchCreateInstances(); + // [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js new file mode 100644 index 00000000000..760fff95db8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupId, backup) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const backupId = 'abc123' + /** + * Required. The resource being created + */ + // const backup = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateBackup() { + // Construct request + const request = { + parent, + backupId, + backup, + }; + + // Run request + const [operation] = await alloydbClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackup(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js new file mode 100644 index 00000000000..b37cc9228a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js new file mode 100644 index 00000000000..e419bd6866e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 00000000000..a946db743aa --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object (the secondary cluster). + */ + // const clusterId = 'abc123' + /** + * Required. Configuration of the requesting object (the secondary cluster). + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 00000000000..315c5e55034 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js new file mode 100644 index 00000000000..838734b1305 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, userId, user) { + // [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const userId = 'abc123' + /** + * Required. The resource being created + */ + // const user = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await alloydbClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js new file mode 100644 index 00000000000..b26f0b653e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * 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. + */ + // const etag = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js new file mode 100644 index 00000000000..61e770ea52d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * Optional. Whether to cascade delete child instances for given cluster. + */ + // const force = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js new file mode 100644 index 00000000000..eb1ecd7b41d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js new file mode 100644 index 00000000000..ec9646cf6d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js new file mode 100644 index 00000000000..47dd7e0edce --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance, database, sqlStatement) { + // [START alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The database native user’s password. + */ + // const password = 'abc123' + /** + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + */ + // const instance = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + /** + * 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. + */ + // const user = 'abc123' + /** + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + */ + // const sqlStatement = 'abc123' + /** + * Optional. If set, validates the sql statement by performing + * syntax and semantic validation and doesn't execute the query. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callExecuteSql() { + // Construct request + const request = { + instance, + database, + sqlStatement, + }; + + // Run request + const response = await alloydbClient.executeSql(request); + console.log(response); + } + + callExecuteSql(); + // [END alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js new file mode 100644 index 00000000000..165c351dfd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gcsDestination, name, database) { + // [START alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Option to export data to cloud storage. + */ + // const gcsDestination = {} + /** + * Options for exporting data in CSV format. Required field to be set for + * CSV file type. + */ + // const csvExportOptions = {} + /** + * Options for exporting data in SQL format. Required field to be set for + * SQL file type. + */ + // const sqlExportOptions = {} + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callExportCluster() { + // Construct request + const request = { + gcsDestination, + name, + database, + }; + + // Run request + const [operation] = await alloydbClient.exportCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js new file mode 100644 index 00000000000..8d94a7766b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callFailoverInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.failoverInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callFailoverInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js new file mode 100644 index 00000000000..5cd83fcbc1d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + */ + // const parent = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const certDuration = {} + /** + * Optional. The public key from the client. + */ + // const publicKey = 'abc123' + /** + * 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. + */ + // const useMetadataExchange = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGenerateClientCertificate() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await alloydbClient.generateClientCertificate(request); + console.log(response); + } + + callGenerateClientCertificate(); + // [END alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js new file mode 100644 index 00000000000..1cadee19727 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_GetBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js new file mode 100644 index 00000000000..27ebde91520 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const name = 'abc123' + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + */ + // const view = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js new file mode 100644 index 00000000000..743cbd01f40 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + */ + // const parent = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetConnectionInfo() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await alloydbClient.getConnectionInfo(request); + console.log(response); + } + + callGetConnectionInfo(); + // [END alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js new file mode 100644 index 00000000000..2efa79cc9e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * The view of the instance to return. + */ + // const view = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js new file mode 100644 index 00000000000..1e0af5a26ce --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_GetUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js new file mode 100644 index 00000000000..a76cf483a6e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, gcsUri) { + // [START alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Options for importing data in SQL format. + */ + // const sqlImportOptions = {} + /** + * Options for importing data in CSV format. + */ + // const csvImportOptions = {} + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * 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`. + */ + // const gcsUri = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + /** + * 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. + */ + // const user = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callImportCluster() { + // Construct request + const request = { + name, + gcsUri, + }; + + // Run request + const [operation] = await alloydbClient.importCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js new file mode 100644 index 00000000000..70d6a910b25 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(faultType, name) { + // [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The type of fault to be injected in an instance. + */ + // const faultType = {} + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callInjectFault() { + // Construct request + const request = { + faultType, + name, + }; + + // Run request + const [operation] = await alloydbClient.injectFault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInjectFault(); + // [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js new file mode 100644 index 00000000000..0a74f79be3a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListBackupsRequest + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results + */ + // const filter = 'abc123' + /** + * Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js new file mode 100644 index 00000000000..449cf63db89 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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/- + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js new file mode 100644 index 00000000000..0a8fc4e361d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListDatabasesRequest. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + */ + // const filter = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListDatabases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listDatabasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatabases(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js new file mode 100644 index 00000000000..35533876ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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/- + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js new file mode 100644 index 00000000000..b84a98bd60c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + */ + // const scope = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListSupportedDatabaseFlags() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listSupportedDatabaseFlagsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSupportedDatabaseFlags(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js new file mode 100644 index 00000000000..0ace79a7e47 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListUsersRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 00000000000..b56f720c5ae --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callPromoteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.promoteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPromoteCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js new file mode 100644 index 00000000000..ddcde70c47e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + */ + // const nodeIds = ['abc','def'] + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callRestartInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestartInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js new file mode 100644 index 00000000000..92518a1665d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Backup source. + */ + // const backupSource = {} + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + */ + // const continuousBackupSource = {} + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callRestoreCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.restoreCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js new file mode 100644 index 00000000000..2ea9bbf3f2a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callSwitchoverCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.switchoverCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSwitchoverCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js new file mode 100644 index 00000000000..a5e6fc1a857 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(backup) { + // [START alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backup = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + backup, + }; + + // Run request + const [operation] = await alloydbClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js new file mode 100644 index 00000000000..858582c25be --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cluster) { + // [START alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + cluster, + }; + + // Run request + const [operation] = await alloydbClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js new file mode 100644 index 00000000000..66841c2650b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance) { + // [START alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + instance, + }; + + // Run request + const [operation] = await alloydbClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js new file mode 100644 index 00000000000..1d85b36b1fc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(user) { + // [START alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const user = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * Optional. Allow missing fields in the update mask. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + }; + + // Run request + const response = await alloydbClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js new file mode 100644 index 00000000000..8c296fb49c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, version) { + // [START alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * Required. The version the cluster is going to be upgraded to. + */ + // const version = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const etag = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpgradeCluster() { + // Construct request + const request = { + name, + version, + }; + + // Run request + const [operation] = await alloydbClient.upgradeCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpgradeCluster(); + // [END alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js new file mode 100644 index 00000000000..adf96182a3c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Cluster created from CloudSQL backup run. + */ + // const cloudsqlBackupRunSource = {} + /** + * Required. The location of the new cluster. For the required format, see the + * comment on Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + + // Imports the Alloydb library + const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1; + + // Instantiates a client + const alloydbClient = new AlloyDBCSQLAdminClient(); + + async function callRestoreFromCloudSQL() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.restoreFromCloudSQL(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreFromCloudSQL(); + // [END alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json new file mode 100644 index 00000000000..3d02efb97c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json @@ -0,0 +1,2027 @@ +{ + "clientLibrary": { + "name": "nodejs-alloydb", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.alloydb.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListClusters_async", + "title": "AlloyDBAdmin listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists Clusters in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListClustersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListClusters", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetCluster_async", + "title": "AlloyDBAdmin getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1.ClusterView" + } + ], + "resultType": ".google.cloud.alloydb.v1.Cluster", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async", + "title": "AlloyDBAdmin createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Cluster in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async", + "title": "AlloyDBAdmin updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async", + "title": "AlloyDBAdmin exportCluster Sample", + "origin": "API_DEFINITION", + "description": " Exports data from the cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.export_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExportCluster", + "async": true, + "parameters": [ + { + "name": "gcs_destination", + "type": ".google.cloud.alloydb.v1.GcsDestination" + }, + { + "name": "csv_export_options", + "type": ".google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions" + }, + { + "name": "sql_export_options", + "type": ".google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ExportCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExportCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async", + "title": "AlloyDBAdmin importCluster Sample", + "origin": "API_DEFINITION", + "description": " Imports data to the cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.import_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ImportCluster", + "async": true, + "parameters": [ + { + "name": "sql_import_options", + "type": ".google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions" + }, + { + "name": "csv_import_options", + "type": ".google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "gcs_uri", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ImportCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ImportCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async", + "title": "AlloyDBAdmin upgradeCluster Sample", + "origin": "API_DEFINITION", + "description": " Upgrades a single Cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.upgrade_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpgradeCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.cloud.alloydb.v1.DatabaseVersion" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpgradeCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async", + "title": "AlloyDBAdmin deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async", + "title": "AlloyDBAdmin promoteCluster Sample", + "origin": "API_DEFINITION", + "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.promote_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.PromoteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.PromoteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async", + "title": "AlloyDBAdmin switchoverCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.switchover_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SwitchoverCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "SwitchoverCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async", + "title": "AlloyDBAdmin restoreCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.restore_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestoreCluster", + "async": true, + "parameters": [ + { + "name": "backup_source", + "type": ".google.cloud.alloydb.v1.BackupSource" + }, + { + "name": "continuous_backup_source", + "type": ".google.cloud.alloydb.v1.ContinuousBackupSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "RestoreCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestoreCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async", + "title": "AlloyDBAdmin createSecondaryCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListInstances_async", + "title": "AlloyDBAdmin listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListInstancesResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListInstances", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetInstance_async", + "title": "AlloyDBAdmin getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1.InstanceView" + } + ], + "resultType": ".google.cloud.alloydb.v1.Instance", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async", + "title": "AlloyDBAdmin createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async", + "title": "AlloyDBAdmin createSecondaryInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new SECONDARY Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async", + "title": "AlloyDBAdmin batchCreateInstances Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.batch_create_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateInstances", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": ".google.cloud.alloydb.v1.CreateInstanceRequests" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "BatchCreateInstances", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstances", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async", + "title": "AlloyDBAdmin updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async", + "title": "AlloyDBAdmin deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async", + "title": "AlloyDBAdmin failoverInstance Sample", + "origin": "API_DEFINITION", + "description": " Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.failover_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FailoverInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "FailoverInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_InjectFault_async", + "title": "AlloyDBAdmin injectFault Sample", + "origin": "API_DEFINITION", + "description": " Injects fault in an instance. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.inject_fault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.InjectFault", + "async": true, + "parameters": [ + { + "name": "fault_type", + "type": ".google.cloud.alloydb.v1.InjectFaultRequest.FaultType" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.InjectFault", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async", + "title": "AlloyDBAdmin restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart an Instance in a cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async", + "title": "AlloyDBAdmin executeSql Sample", + "origin": "API_DEFINITION", + "description": " Executes a SQL statement in a database inside an AlloyDB instance.", + "canonical": true, + "file": "alloy_d_b_admin.execute_sql.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteSql", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSql", + "async": true, + "parameters": [ + { + "name": "password", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": "TYPE_STRING" + }, + { + "name": "sql_statement", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1.ExecuteSqlResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ExecuteSql", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSql", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListBackups_async", + "title": "AlloyDBAdmin listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Backups in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListBackupsResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListBackups", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetBackup_async", + "title": "AlloyDBAdmin getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.Backup", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async", + "title": "AlloyDBAdmin createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Backup in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.alloydb.v1.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async", + "title": "AlloyDBAdmin updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup", + "type": ".google.cloud.alloydb.v1.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async", + "title": "AlloyDBAdmin deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async", + "title": "AlloyDBAdmin listSupportedDatabaseFlags Sample", + "origin": "API_DEFINITION", + "description": " Lists SupportedDatabaseFlags for a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_supported_database_flags.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSupportedDatabaseFlags", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlags", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "scope", + "type": ".google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListSupportedDatabaseFlags", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlags", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async", + "title": "AlloyDBAdmin generateClientCertificate Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.generate_client_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateClientCertificate", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "cert_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "public_key", + "type": "TYPE_STRING" + }, + { + "name": "use_metadata_exchange", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1.GenerateClientCertificateResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GenerateClientCertificate", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificate", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async", + "title": "AlloyDBAdmin getConnectionInfo Sample", + "origin": "API_DEFINITION", + "description": " Get instance metadata used for a connection.", + "canonical": true, + "file": "alloy_d_b_admin.get_connection_info.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionInfo", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfo", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ConnectionInfo", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetConnectionInfo", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfo", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListUsers_async", + "title": "AlloyDBAdmin listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists Users in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListUsersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListUsers", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetUser_async", + "title": "AlloyDBAdmin getUser Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateUser_async", + "title": "AlloyDBAdmin createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a new User in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async", + "title": "AlloyDBAdmin updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUser", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async", + "title": "AlloyDBAdmin deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single User.", + "canonical": true, + "file": "alloy_d_b_admin.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async", + "title": "AlloyDBAdmin listDatabases Sample", + "origin": "API_DEFINITION", + "description": " Lists Databases in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_databases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatabases", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1.ListDatabasesResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListDatabases", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabases", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async", + "title": "AlloyDBAdmin restoreFromCloudSQL Sample", + "origin": "API_DEFINITION", + "description": " Restores an AlloyDB cluster from a CloudSQL resource.", + "canonical": true, + "file": "alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreFromCloudSQL", + "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "async": true, + "parameters": [ + { + "name": "cloudsql_backup_run_source", + "type": ".google.cloud.alloydb.v1.CloudSQLBackupRunSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1.Cluster" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBCSQLAdminClient", + "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdminClient" + }, + "method": { + "shortName": "RestoreFromCloudSQL", + "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "service": { + "shortName": "AlloyDBCSQLAdmin", + "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdmin" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js new file mode 100644 index 00000000000..159c1f23ae9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requests) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. + */ + // const parent = 'abc123' + /** + * Required. Resources being created. + */ + // const requests = {} + /** + * 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). + */ + // const requestId = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callBatchCreateInstances() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const [operation] = await alloydbClient.batchCreateInstances(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchCreateInstances(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js new file mode 100644 index 00000000000..8ec6bb39226 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupId, backup) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const backupId = 'abc123' + /** + * Required. The resource being created + */ + // const backup = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateBackup() { + // Construct request + const request = { + parent, + backupId, + backup, + }; + + // Run request + const [operation] = await alloydbClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackup(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js new file mode 100644 index 00000000000..7ec98c9db98 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js new file mode 100644 index 00000000000..ab067ad68a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, databaseId, database) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const databaseId = 'abc123' + /** + * Required. The resource being created. + */ + // const database = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateDatabase() { + // Construct request + const request = { + parent, + databaseId, + database, + }; + + // Run request + const response = await alloydbClient.createDatabase(request); + console.log(response); + } + + callCreateDatabase(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js new file mode 100644 index 00000000000..d988841631b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 00000000000..9a9487742ac --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object (the secondary cluster). + */ + // const clusterId = 'abc123' + /** + * Required. Configuration of the requesting object (the secondary cluster). + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 00000000000..3ff62b344aa --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js new file mode 100644 index 00000000000..ab582adf7c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, userId, user) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const userId = 'abc123' + /** + * Required. The resource being created + */ + // const user = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await alloydbClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js new file mode 100644 index 00000000000..794b8d3587f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * 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. + */ + // const etag = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js new file mode 100644 index 00000000000..4b4d593566f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * Optional. Whether to cascade delete child instances for given cluster. + */ + // const force = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js new file mode 100644 index 00000000000..acb531eab1c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js new file mode 100644 index 00000000000..1edc6fe6f87 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js new file mode 100644 index 00000000000..6b47657e629 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance, database, user, sqlStatement) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The database native user’s password. + */ + // const password = 'abc123' + /** + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + */ + // const instance = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + /** + * 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. + */ + // const user = 'abc123' + /** + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + */ + // const sqlStatement = 'abc123' + /** + * Optional. If set, validates the sql statement by performing + * syntax and semantic validation and doesn't execute the query. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callExecuteSql() { + // Construct request + const request = { + instance, + database, + user, + sqlStatement, + }; + + // Run request + const response = await alloydbClient.executeSql(request); + console.log(response); + } + + callExecuteSql(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js new file mode 100644 index 00000000000..7e176680751 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gcsDestination, name, database) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Option to export data to cloud storage. + */ + // const gcsDestination = {} + /** + * Options for exporting data in CSV format. Required field to be set for + * CSV file type. + */ + // const csvExportOptions = {} + /** + * Options for exporting data in SQL format. Required field to be set for + * SQL file type. + */ + // const sqlExportOptions = {} + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callExportCluster() { + // Construct request + const request = { + gcsDestination, + name, + database, + }; + + // Run request + const [operation] = await alloydbClient.exportCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js new file mode 100644 index 00000000000..57e6dd3299a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callFailoverInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.failoverInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callFailoverInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js new file mode 100644 index 00000000000..b72ae40df68 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js @@ -0,0 +1,99 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + */ + // const parent = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). It is + * recommended to use public_key instead. + */ + // const pemCsr = 'abc123' + /** + * 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. + */ + // const certDuration = {} + /** + * Optional. The public key from the client. + */ + // const publicKey = 'abc123' + /** + * 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. + */ + // const useMetadataExchange = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGenerateClientCertificate() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await alloydbClient.generateClientCertificate(request); + console.log(response); + } + + callGenerateClientCertificate(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js new file mode 100644 index 00000000000..41734dbeb63 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js new file mode 100644 index 00000000000..b15f8e31cf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const name = 'abc123' + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + */ + // const view = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js new file mode 100644 index 00000000000..813d598abd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + */ + // const parent = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetConnectionInfo() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await alloydbClient.getConnectionInfo(request); + console.log(response); + } + + callGetConnectionInfo(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js new file mode 100644 index 00000000000..570ea167e99 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * The view of the instance to return. + */ + // const view = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js new file mode 100644 index 00000000000..36d6f01f262 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js new file mode 100644 index 00000000000..825e964f080 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, gcsUri) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Options for importing data in SQL format. + */ + // const sqlImportOptions = {} + /** + * Options for importing data in CSV format. + */ + // const csvImportOptions = {} + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * 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`. + */ + // const gcsUri = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + /** + * 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. + */ + // const user = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callImportCluster() { + // Construct request + const request = { + name, + gcsUri, + }; + + // Run request + const [operation] = await alloydbClient.importCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js new file mode 100644 index 00000000000..d07fea0c8b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(faultType, name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The type of fault to be injected in an instance. + */ + // const faultType = {} + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callInjectFault() { + // Construct request + const request = { + faultType, + name, + }; + + // Run request + const [operation] = await alloydbClient.injectFault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInjectFault(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js new file mode 100644 index 00000000000..f803eb473c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListBackupsRequest + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results + */ + // const filter = 'abc123' + /** + * Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js new file mode 100644 index 00000000000..5d473fa68e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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/- + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js new file mode 100644 index 00000000000..ea14804ec8b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListDatabasesRequest. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + */ + // const filter = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListDatabases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listDatabasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatabases(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js new file mode 100644 index 00000000000..30ec7f4fcc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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/- + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js new file mode 100644 index 00000000000..78d2c817bea --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + */ + // const scope = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListSupportedDatabaseFlags() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listSupportedDatabaseFlagsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSupportedDatabaseFlags(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js new file mode 100644 index 00000000000..5f38621cde9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListUsersRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 00000000000..7420b6e626c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callPromoteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.promoteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPromoteCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js new file mode 100644 index 00000000000..152fdad826c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + */ + // const nodeIds = ['abc','def'] + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callRestartInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestartInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js new file mode 100644 index 00000000000..2c5e047f2fe --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Backup source. + */ + // const backupSource = {} + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + */ + // const continuousBackupSource = {} + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callRestoreCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.restoreCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js new file mode 100644 index 00000000000..b28a933620f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callSwitchoverCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.switchoverCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSwitchoverCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js new file mode 100644 index 00000000000..6bdd55559f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(backup) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backup = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + backup, + }; + + // Run request + const [operation] = await alloydbClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js new file mode 100644 index 00000000000..b3910e399e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cluster) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + cluster, + }; + + // Run request + const [operation] = await alloydbClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js new file mode 100644 index 00000000000..db72d37ed6d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + instance, + }; + + // Run request + const [operation] = await alloydbClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js new file mode 100644 index 00000000000..224abf4a507 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(user) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const user = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * Optional. Allow missing fields in the update mask. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + }; + + // Run request + const response = await alloydbClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js new file mode 100644 index 00000000000..0aeea7a8925 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, version) { + // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * Required. The version the cluster is going to be upgraded to. + */ + // const version = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const etag = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpgradeCluster() { + // Construct request + const request = { + name, + version, + }; + + // Run request + const [operation] = await alloydbClient.upgradeCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpgradeCluster(); + // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js new file mode 100644 index 00000000000..16fe2e1d756 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Cluster created from CloudSQL backup run. + */ + // const cloudsqlBackupRunSource = {} + /** + * Required. The location of the new cluster. For the required format, see the + * comment on Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + + // Imports the Alloydb library + const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1alpha; + + // Instantiates a client + const alloydbClient = new AlloyDBCSQLAdminClient(); + + async function callRestoreFromCloudSQL() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.restoreFromCloudSQL(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreFromCloudSQL(); + // [END alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json new file mode 100644 index 00000000000..d56ea5cbf39 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json @@ -0,0 +1,2079 @@ +{ + "clientLibrary": { + "name": "nodejs-alloydb", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.alloydb.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async", + "title": "AlloyDBAdmin listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists Clusters in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListClustersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClusters", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async", + "title": "AlloyDBAdmin getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1alpha.ClusterView" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.Cluster", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async", + "title": "AlloyDBAdmin createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Cluster in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1alpha.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async", + "title": "AlloyDBAdmin updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1alpha.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async", + "title": "AlloyDBAdmin exportCluster Sample", + "origin": "API_DEFINITION", + "description": " Exports data from the cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.export_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportCluster", + "async": true, + "parameters": [ + { + "name": "gcs_destination", + "type": ".google.cloud.alloydb.v1alpha.GcsDestination" + }, + { + "name": "csv_export_options", + "type": ".google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions" + }, + { + "name": "sql_export_options", + "type": ".google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ExportCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async", + "title": "AlloyDBAdmin importCluster Sample", + "origin": "API_DEFINITION", + "description": " Imports data to the cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.import_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportCluster", + "async": true, + "parameters": [ + { + "name": "sql_import_options", + "type": ".google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions" + }, + { + "name": "csv_import_options", + "type": ".google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "gcs_uri", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ImportCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async", + "title": "AlloyDBAdmin upgradeCluster Sample", + "origin": "API_DEFINITION", + "description": " Upgrades a single Cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.upgrade_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpgradeCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.cloud.alloydb.v1alpha.DatabaseVersion" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpgradeCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async", + "title": "AlloyDBAdmin deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async", + "title": "AlloyDBAdmin promoteCluster Sample", + "origin": "API_DEFINITION", + "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.promote_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async", + "title": "AlloyDBAdmin switchoverCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.switchover_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SwitchoverCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "SwitchoverCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async", + "title": "AlloyDBAdmin restoreCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.restore_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreCluster", + "async": true, + "parameters": [ + { + "name": "backup_source", + "type": ".google.cloud.alloydb.v1alpha.BackupSource" + }, + { + "name": "continuous_backup_source", + "type": ".google.cloud.alloydb.v1alpha.ContinuousBackupSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1alpha.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "RestoreCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async", + "title": "AlloyDBAdmin createSecondaryCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1alpha.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async", + "title": "AlloyDBAdmin listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListInstancesResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstances", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async", + "title": "AlloyDBAdmin getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1alpha.InstanceView" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.Instance", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async", + "title": "AlloyDBAdmin createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1alpha.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async", + "title": "AlloyDBAdmin createSecondaryInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new SECONDARY Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1alpha.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async", + "title": "AlloyDBAdmin batchCreateInstances Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.batch_create_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateInstances", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": ".google.cloud.alloydb.v1alpha.CreateInstanceRequests" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "BatchCreateInstances", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstances", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async", + "title": "AlloyDBAdmin updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1alpha.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async", + "title": "AlloyDBAdmin deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async", + "title": "AlloyDBAdmin failoverInstance Sample", + "origin": "API_DEFINITION", + "description": " Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.failover_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FailoverInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "FailoverInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async", + "title": "AlloyDBAdmin injectFault Sample", + "origin": "API_DEFINITION", + "description": " Injects fault in an instance. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.inject_fault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFault", + "async": true, + "parameters": [ + { + "name": "fault_type", + "type": ".google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFault", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async", + "title": "AlloyDBAdmin restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart an Instance in a cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async", + "title": "AlloyDBAdmin executeSql Sample", + "origin": "API_DEFINITION", + "description": " Executes a SQL statement in a database inside an AlloyDB instance.", + "canonical": true, + "file": "alloy_d_b_admin.execute_sql.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteSql", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSql", + "async": true, + "parameters": [ + { + "name": "password", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": "TYPE_STRING" + }, + { + "name": "sql_statement", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ExecuteSqlResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ExecuteSql", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSql", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async", + "title": "AlloyDBAdmin listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Backups in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListBackupsResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackups", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async", + "title": "AlloyDBAdmin getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.Backup", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async", + "title": "AlloyDBAdmin createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Backup in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.alloydb.v1alpha.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async", + "title": "AlloyDBAdmin updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup", + "type": ".google.cloud.alloydb.v1alpha.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async", + "title": "AlloyDBAdmin deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async", + "title": "AlloyDBAdmin listSupportedDatabaseFlags Sample", + "origin": "API_DEFINITION", + "description": " Lists SupportedDatabaseFlags for a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_supported_database_flags.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSupportedDatabaseFlags", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlags", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "scope", + "type": ".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListSupportedDatabaseFlags", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlags", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async", + "title": "AlloyDBAdmin generateClientCertificate Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.generate_client_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateClientCertificate", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "pem_csr", + "type": "TYPE_STRING" + }, + { + "name": "cert_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "public_key", + "type": "TYPE_STRING" + }, + { + "name": "use_metadata_exchange", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GenerateClientCertificate", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificate", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async", + "title": "AlloyDBAdmin getConnectionInfo Sample", + "origin": "API_DEFINITION", + "description": " Get instance metadata used for a connection.", + "canonical": true, + "file": "alloy_d_b_admin.get_connection_info.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionInfo", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfo", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ConnectionInfo", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetConnectionInfo", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfo", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async", + "title": "AlloyDBAdmin listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists Users in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListUsersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsers", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async", + "title": "AlloyDBAdmin getUser Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async", + "title": "AlloyDBAdmin createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a new User in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1alpha.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async", + "title": "AlloyDBAdmin updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUser", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1alpha.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async", + "title": "AlloyDBAdmin deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single User.", + "canonical": true, + "file": "alloy_d_b_admin.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async", + "title": "AlloyDBAdmin listDatabases Sample", + "origin": "API_DEFINITION", + "description": " Lists Databases in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_databases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatabases", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.ListDatabasesResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListDatabases", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabases", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async", + "title": "AlloyDBAdmin createDatabase Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Database in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_database.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDatabase", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabase", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": ".google.cloud.alloydb.v1alpha.Database" + } + ], + "resultType": ".google.cloud.alloydb.v1alpha.Database", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateDatabase", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabase", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async", + "title": "AlloyDBAdmin restoreFromCloudSQL Sample", + "origin": "API_DEFINITION", + "description": " Restores an AlloyDB cluster from a CloudSQL resource.", + "canonical": true, + "file": "alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreFromCloudSQL", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "async": true, + "parameters": [ + { + "name": "cloudsql_backup_run_source", + "type": ".google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1alpha.Cluster" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBCSQLAdminClient", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdminClient" + }, + "method": { + "shortName": "RestoreFromCloudSQL", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "service": { + "shortName": "AlloyDBCSQLAdmin", + "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js new file mode 100644 index 00000000000..302a6b9b6c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, requests) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. + */ + // const parent = 'abc123' + /** + * Required. Resources being created. + */ + // const requests = {} + /** + * 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). + */ + // const requestId = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callBatchCreateInstances() { + // Construct request + const request = { + parent, + requests, + }; + + // Run request + const [operation] = await alloydbClient.batchCreateInstances(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchCreateInstances(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js new file mode 100644 index 00000000000..de8881d9769 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupId, backup) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const backupId = 'abc123' + /** + * Required. The resource being created + */ + // const backup = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateBackup() { + // Construct request + const request = { + parent, + backupId, + backup, + }; + + // Run request + const [operation] = await alloydbClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackup(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js new file mode 100644 index 00000000000..f554f9d87cf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js new file mode 100644 index 00000000000..aacb481086e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, databaseId, database) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const databaseId = 'abc123' + /** + * Required. The resource being created. + */ + // const database = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateDatabase() { + // Construct request + const request = { + parent, + databaseId, + database, + }; + + // Run request + const response = await alloydbClient.createDatabase(request); + console.log(response); + } + + callCreateDatabase(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js new file mode 100644 index 00000000000..346e9c20bfa --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 00000000000..8770b3427b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object (the secondary cluster). + */ + // const clusterId = 'abc123' + /** + * Required. Configuration of the requesting object (the secondary cluster). + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 00000000000..b08b0c4a1b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const instanceId = 'abc123' + /** + * Required. The resource being created + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateSecondaryInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await alloydbClient.createSecondaryInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecondaryInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js new file mode 100644 index 00000000000..a2f785a0062 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, userId, user) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const userId = 'abc123' + /** + * Required. The resource being created + */ + // const user = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await alloydbClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js new file mode 100644 index 00000000000..a89dc75a2e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * 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. + */ + // const etag = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js new file mode 100644 index 00000000000..2926f4fa27b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * Optional. Whether to cascade delete child instances for given cluster. + */ + // const force = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js new file mode 100644 index 00000000000..813cc5ed65d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js new file mode 100644 index 00000000000..7be0afa729b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js new file mode 100644 index 00000000000..731ebf74c79 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance, database, user, sqlStatement) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The database native user’s password. + */ + // const password = 'abc123' + /** + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + */ + // const instance = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + /** + * 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. + */ + // const user = 'abc123' + /** + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + */ + // const sqlStatement = 'abc123' + /** + * Optional. If set, validates the sql statement by performing + * syntax and semantic validation and doesn't execute the query. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callExecuteSql() { + // Construct request + const request = { + instance, + database, + user, + sqlStatement, + }; + + // Run request + const response = await alloydbClient.executeSql(request); + console.log(response); + } + + callExecuteSql(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js new file mode 100644 index 00000000000..5e1dead1ccb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gcsDestination, name, database) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Option to export data to cloud storage. + */ + // const gcsDestination = {} + /** + * Options for exporting data in CSV format. Required field to be set for + * CSV file type. + */ + // const csvExportOptions = {} + /** + * Options for exporting data in SQL format. Required field to be set for + * SQL file type. + */ + // const sqlExportOptions = {} + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callExportCluster() { + // Construct request + const request = { + gcsDestination, + name, + database, + }; + + // Run request + const [operation] = await alloydbClient.exportCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js new file mode 100644 index 00000000000..a01bb97decf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callFailoverInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.failoverInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callFailoverInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js new file mode 100644 index 00000000000..ae5c0115335 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js @@ -0,0 +1,99 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + */ + // const parent = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. A pem-encoded X.509 certificate signing request (CSR). It is + * recommended to use public_key instead. + */ + // const pemCsr = 'abc123' + /** + * 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. + */ + // const certDuration = {} + /** + * Optional. The public key from the client. + */ + // const publicKey = 'abc123' + /** + * 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. + */ + // const useMetadataExchange = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGenerateClientCertificate() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await alloydbClient.generateClientCertificate(request); + console.log(response); + } + + callGenerateClientCertificate(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js new file mode 100644 index 00000000000..c2583a607ae --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js new file mode 100644 index 00000000000..f9790f5d80e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const name = 'abc123' + /** + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + */ + // const view = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js new file mode 100644 index 00000000000..839d0c881b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + */ + // const parent = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetConnectionInfo() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await alloydbClient.getConnectionInfo(request); + console.log(response); + } + + callGetConnectionInfo(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js new file mode 100644 index 00000000000..a7767239e4a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * The view of the instance to return. + */ + // const view = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js new file mode 100644 index 00000000000..c3ae329f841 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + */ + // const name = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await alloydbClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js new file mode 100644 index 00000000000..bf4ce09e015 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, gcsUri) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Options for importing data in SQL format. + */ + // const sqlImportOptions = {} + /** + * Options for importing data in CSV format. + */ + // const csvImportOptions = {} + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * 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`. + */ + // const gcsUri = 'abc123' + /** + * 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. + */ + // const database = 'abc123' + /** + * 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. + */ + // const user = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callImportCluster() { + // Construct request + const request = { + name, + gcsUri, + }; + + // Run request + const [operation] = await alloydbClient.importCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js new file mode 100644 index 00000000000..044560ca42b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(faultType, name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The type of fault to be injected in an instance. + */ + // const faultType = {} + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callInjectFault() { + // Construct request + const request = { + faultType, + name, + }; + + // Run request + const [operation] = await alloydbClient.injectFault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInjectFault(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js new file mode 100644 index 00000000000..4501033661f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListBackupsRequest + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Filtering results + */ + // const filter = 'abc123' + /** + * Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js new file mode 100644 index 00000000000..8845d6666f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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/- + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js new file mode 100644 index 00000000000..cc5e3a38c3c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListDatabasesRequest. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + */ + // const filter = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListDatabases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listDatabasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatabases(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js new file mode 100644 index 00000000000..a54786f380f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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/- + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js new file mode 100644 index 00000000000..c200f126244 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const parent = 'abc123' + /** + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + */ + // const scope = {} + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListSupportedDatabaseFlags() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listSupportedDatabaseFlagsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSupportedDatabaseFlags(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js new file mode 100644 index 00000000000..d864c3dbd61 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListUsersRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = alloydbClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 00000000000..5457e744338 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * 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. + */ + // const etag = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callPromoteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.promoteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPromoteCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js new file mode 100644 index 00000000000..5f5c8e675e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + */ + // const nodeIds = ['abc','def'] + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callRestartInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestartInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js new file mode 100644 index 00000000000..af04906f9c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Backup source. + */ + // const backupSource = {} + /** + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + */ + // const continuousBackupSource = {} + /** + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callRestoreCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.restoreCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js new file mode 100644 index 00000000000..d5046c8191f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + */ + // const name = 'abc123' + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callSwitchoverCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await alloydbClient.switchoverCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSwitchoverCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js new file mode 100644 index 00000000000..c1795b46d8f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js @@ -0,0 +1,94 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(backup) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backup = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + backup, + }; + + // Run request + const [operation] = await alloydbClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js new file mode 100644 index 00000000000..f4040faf914 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cluster) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const cluster = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + cluster, + }; + + // Run request + const [operation] = await alloydbClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js new file mode 100644 index 00000000000..e2361d28f58 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(instance) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const instance = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + instance, + }; + + // Run request + const [operation] = await alloydbClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js new file mode 100644 index 00000000000..9044dee5eee --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(user) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const user = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + */ + // const validateOnly = true + /** + * Optional. Allow missing fields in the update mask. + */ + // const allowMissing = true + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + }; + + // Run request + const response = await alloydbClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js new file mode 100644 index 00000000000..fa4269e7d55 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, version) { + // [START alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the cluster. + */ + // const name = 'abc123' + /** + * Required. The version the cluster is going to be upgraded to. + */ + // const version = {} + /** + * 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). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation, for example, permission + * checks and any other type of validation, but does not actually execute the + * create request. + */ + // const validateOnly = true + /** + * 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. + */ + // const etag = 'abc123' + + // Imports the Alloydb library + const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBAdminClient(); + + async function callUpgradeCluster() { + // Construct request + const request = { + name, + version, + }; + + // Run request + const [operation] = await alloydbClient.upgradeCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpgradeCluster(); + // [END alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js new file mode 100644 index 00000000000..06b57fac034 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Cluster created from CloudSQL backup run. + */ + // const cloudsqlBackupRunSource = {} + /** + * Required. The location of the new cluster. For the required format, see the + * comment on Cluster.name field. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object. + */ + // const clusterId = 'abc123' + /** + * Required. The resource being created + */ + // const cluster = {} + + // Imports the Alloydb library + const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1beta; + + // Instantiates a client + const alloydbClient = new AlloyDBCSQLAdminClient(); + + async function callRestoreFromCloudSQL() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await alloydbClient.restoreFromCloudSQL(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreFromCloudSQL(); + // [END alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json new file mode 100644 index 00000000000..788ada239ba --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json @@ -0,0 +1,2079 @@ +{ + "clientLibrary": { + "name": "nodejs-alloydb", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.alloydb.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async", + "title": "AlloyDBAdmin listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists Clusters in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListClustersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClusters", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async", + "title": "AlloyDBAdmin getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1beta.ClusterView" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.Cluster", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async", + "title": "AlloyDBAdmin createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Cluster in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1beta.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async", + "title": "AlloyDBAdmin updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1beta.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async", + "title": "AlloyDBAdmin exportCluster Sample", + "origin": "API_DEFINITION", + "description": " Exports data from the cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.export_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportCluster", + "async": true, + "parameters": [ + { + "name": "gcs_destination", + "type": ".google.cloud.alloydb.v1beta.GcsDestination" + }, + { + "name": "csv_export_options", + "type": ".google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions" + }, + { + "name": "sql_export_options", + "type": ".google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ExportCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async", + "title": "AlloyDBAdmin importCluster Sample", + "origin": "API_DEFINITION", + "description": " Imports data to the cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.import_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportCluster", + "async": true, + "parameters": [ + { + "name": "sql_import_options", + "type": ".google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions" + }, + { + "name": "csv_import_options", + "type": ".google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "gcs_uri", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ImportCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async", + "title": "AlloyDBAdmin upgradeCluster Sample", + "origin": "API_DEFINITION", + "description": " Upgrades a single Cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.upgrade_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpgradeCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": ".google.cloud.alloydb.v1beta.DatabaseVersion" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpgradeCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async", + "title": "AlloyDBAdmin deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Cluster.", + "canonical": true, + "file": "alloy_d_b_admin.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async", + "title": "AlloyDBAdmin promoteCluster Sample", + "origin": "API_DEFINITION", + "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.promote_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "PromoteCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async", + "title": "AlloyDBAdmin switchoverCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.switchover_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SwitchoverCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "SwitchoverCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async", + "title": "AlloyDBAdmin restoreCluster Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.restore_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreCluster", + "async": true, + "parameters": [ + { + "name": "backup_source", + "type": ".google.cloud.alloydb.v1beta.BackupSource" + }, + { + "name": "continuous_backup_source", + "type": ".google.cloud.alloydb.v1beta.ContinuousBackupSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1beta.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "RestoreCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async", + "title": "AlloyDBAdmin createSecondaryCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1beta.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryCluster", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryCluster", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async", + "title": "AlloyDBAdmin listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListInstancesResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstances", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async", + "title": "AlloyDBAdmin getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.alloydb.v1beta.InstanceView" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.Instance", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async", + "title": "AlloyDBAdmin createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1beta.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async", + "title": "AlloyDBAdmin createSecondaryInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new SECONDARY Instance in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_secondary_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1beta.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateSecondaryInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async", + "title": "AlloyDBAdmin batchCreateInstances Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.batch_create_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateInstances", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": ".google.cloud.alloydb.v1beta.CreateInstanceRequests" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "BatchCreateInstances", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstances", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async", + "title": "AlloyDBAdmin updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.alloydb.v1beta.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async", + "title": "AlloyDBAdmin deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "alloy_d_b_admin.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async", + "title": "AlloyDBAdmin failoverInstance Sample", + "origin": "API_DEFINITION", + "description": " Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.failover_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FailoverInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "FailoverInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async", + "title": "AlloyDBAdmin injectFault Sample", + "origin": "API_DEFINITION", + "description": " Injects fault in an instance. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.inject_fault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", + "async": true, + "parameters": [ + { + "name": "fault_type", + "type": ".google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "InjectFault", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async", + "title": "AlloyDBAdmin restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart an Instance in a cluster. Imperative only.", + "canonical": true, + "file": "alloy_d_b_admin.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstance", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async", + "title": "AlloyDBAdmin executeSql Sample", + "origin": "API_DEFINITION", + "description": " Executes a SQL statement in a database inside an AlloyDB instance.", + "canonical": true, + "file": "alloy_d_b_admin.execute_sql.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExecuteSql", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSql", + "async": true, + "parameters": [ + { + "name": "password", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": "TYPE_STRING" + }, + { + "name": "sql_statement", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ExecuteSqlResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ExecuteSql", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSql", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async", + "title": "AlloyDBAdmin listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Backups in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListBackupsResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackups", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async", + "title": "AlloyDBAdmin getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.Backup", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async", + "title": "AlloyDBAdmin createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Backup in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.alloydb.v1beta.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async", + "title": "AlloyDBAdmin updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup", + "type": ".google.cloud.alloydb.v1beta.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async", + "title": "AlloyDBAdmin deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Backup.", + "canonical": true, + "file": "alloy_d_b_admin.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackup", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async", + "title": "AlloyDBAdmin listSupportedDatabaseFlags Sample", + "origin": "API_DEFINITION", + "description": " Lists SupportedDatabaseFlags for a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_supported_database_flags.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSupportedDatabaseFlags", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlags", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "scope", + "type": ".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListSupportedDatabaseFlags", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlags", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async", + "title": "AlloyDBAdmin generateClientCertificate Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "alloy_d_b_admin.generate_client_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateClientCertificate", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "pem_csr", + "type": "TYPE_STRING" + }, + { + "name": "cert_duration", + "type": ".google.protobuf.Duration" + }, + { + "name": "public_key", + "type": "TYPE_STRING" + }, + { + "name": "use_metadata_exchange", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GenerateClientCertificate", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificate", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async", + "title": "AlloyDBAdmin getConnectionInfo Sample", + "origin": "API_DEFINITION", + "description": " Get instance metadata used for a connection.", + "canonical": true, + "file": "alloy_d_b_admin.get_connection_info.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionInfo", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfo", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ConnectionInfo", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetConnectionInfo", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfo", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async", + "title": "AlloyDBAdmin listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists Users in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListUsersResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async", + "title": "AlloyDBAdmin getUser Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async", + "title": "AlloyDBAdmin createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a new User in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1beta.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async", + "title": "AlloyDBAdmin updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single User.", + "canonical": true, + "file": "alloy_d_b_admin.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "user", + "type": ".google.cloud.alloydb.v1beta.User" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.User", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async", + "title": "AlloyDBAdmin deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single User.", + "canonical": true, + "file": "alloy_d_b_admin.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async", + "title": "AlloyDBAdmin listDatabases Sample", + "origin": "API_DEFINITION", + "description": " Lists Databases in a given project and location.", + "canonical": true, + "file": "alloy_d_b_admin.list_databases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatabases", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.ListDatabasesResponse", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "ListDatabases", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabases", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async", + "title": "AlloyDBAdmin createDatabase Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Database in a given project, location, and cluster.", + "canonical": true, + "file": "alloy_d_b_admin.create_database.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDatabase", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabase", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "database", + "type": ".google.cloud.alloydb.v1beta.Database" + } + ], + "resultType": ".google.cloud.alloydb.v1beta.Database", + "client": { + "shortName": "AlloyDBAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" + }, + "method": { + "shortName": "CreateDatabase", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabase", + "service": { + "shortName": "AlloyDBAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + } + }, + { + "regionTag": "alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async", + "title": "AlloyDBAdmin restoreFromCloudSQL Sample", + "origin": "API_DEFINITION", + "description": " Restores an AlloyDB cluster from a CloudSQL resource.", + "canonical": true, + "file": "alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreFromCloudSQL", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "async": true, + "parameters": [ + { + "name": "cloudsql_backup_run_source", + "type": ".google.cloud.alloydb.v1beta.CloudSQLBackupRunSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.alloydb.v1beta.Cluster" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AlloyDBCSQLAdminClient", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdminClient" + }, + "method": { + "shortName": "RestoreFromCloudSQL", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "service": { + "shortName": "AlloyDBCSQLAdmin", + "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/index.ts b/owl-bot-staging/google-cloud-alloydb/src/index.ts new file mode 100644 index 00000000000..99c2645bb6c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/index.ts @@ -0,0 +1,31 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1alpha from './v1alpha'; +import * as v1beta from './v1beta'; + +const AlloyDBAdminClient = v1.AlloyDBAdminClient; +type AlloyDBAdminClient = v1.AlloyDBAdminClient; +const AlloyDBCSQLAdminClient = v1.AlloyDBCSQLAdminClient; +type AlloyDBCSQLAdminClient = v1.AlloyDBCSQLAdminClient; + +export {v1, v1alpha, v1beta, AlloyDBAdminClient, AlloyDBCSQLAdminClient}; +export default {v1, v1alpha, v1beta, AlloyDBAdminClient, AlloyDBCSQLAdminClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts new file mode 100644 index 00000000000..f92542dc310 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts @@ -0,0 +1,6582 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/alloy_d_b_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alloy_d_b_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources + * @class + * @memberof v1 + */ +export class AlloyDBAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('alloydb'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + alloyDBAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlloyDBAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AlloyDBAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlloyDBAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'alloydb.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + connectionInfoPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/flags/{flag}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listClusters: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), + listBackups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), + listSupportedDatabaseFlags: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'supportedDatabaseFlags'), + listUsers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users'), + listDatabases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const exportClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.ExportClusterResponse') as gax.protobuf.Type; + const exportClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const importClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.ImportClusterResponse') as gax.protobuf.Type; + const importClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const upgradeClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.UpgradeClusterResponse') as gax.protobuf.Type; + const upgradeClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const promoteClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const promoteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const switchoverClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const switchoverClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const restoreClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const restoreClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const createSecondaryClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const createSecondaryClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const createSecondaryInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; + const createSecondaryInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const batchCreateInstancesResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.BatchCreateInstancesResponse') as gax.protobuf.Type; + const batchCreateInstancesMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const failoverInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; + const failoverInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const injectFaultResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; + const injectFaultMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Backup') as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Backup') as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata)), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata)), + exportCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportClusterResponse.decode.bind(exportClusterResponse), + exportClusterMetadata.decode.bind(exportClusterMetadata)), + importCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importClusterResponse.decode.bind(importClusterResponse), + importClusterMetadata.decode.bind(importClusterMetadata)), + upgradeCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + upgradeClusterResponse.decode.bind(upgradeClusterResponse), + upgradeClusterMetadata.decode.bind(upgradeClusterMetadata)), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata)), + promoteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + promoteClusterResponse.decode.bind(promoteClusterResponse), + promoteClusterMetadata.decode.bind(promoteClusterMetadata)), + switchoverCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + switchoverClusterResponse.decode.bind(switchoverClusterResponse), + switchoverClusterMetadata.decode.bind(switchoverClusterMetadata)), + restoreCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreClusterResponse.decode.bind(restoreClusterResponse), + restoreClusterMetadata.decode.bind(restoreClusterMetadata)), + createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryClusterResponse.decode.bind(createSecondaryClusterResponse), + createSecondaryClusterMetadata.decode.bind(createSecondaryClusterMetadata)), + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryInstanceResponse.decode.bind(createSecondaryInstanceResponse), + createSecondaryInstanceMetadata.decode.bind(createSecondaryInstanceMetadata)), + batchCreateInstances: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), + batchCreateInstancesMetadata.decode.bind(batchCreateInstancesMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + failoverInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + failoverInstanceResponse.decode.bind(failoverInstanceResponse), + failoverInstanceMetadata.decode.bind(failoverInstanceMetadata)), + injectFault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + injectFaultResponse.decode.bind(injectFaultResponse), + injectFaultMetadata.decode.bind(injectFaultMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata)), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata)), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.alloydb.v1.AlloyDBAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alloyDBAdminStub) { + return this.alloyDBAdminStub; + } + + // Put together the "service stub" for + // google.cloud.alloydb.v1.AlloyDBAdmin. + this.alloyDBAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1.AlloyDBAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.alloydb.v1.AlloyDBAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alloyDBAdminStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'exportCluster', 'importCluster', 'upgradeCluster', 'deleteCluster', 'promoteCluster', 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', 'executeSql', 'listBackups', 'getBackup', 'createBackup', 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', 'listUsers', 'getUser', 'createUser', 'updateUser', 'deleteUser', 'listDatabases']; + for (const methodName of alloyDBAdminStubMethods) { + const callPromise = this.alloyDBAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alloyDBAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {google.cloud.alloydb.v1.ClusterView} [request.view] + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.Cluster|Cluster}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.get_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.alloydb.v1.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.cloud.alloydb.v1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.cloud.alloydb.v1.IGetClusterRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.cloud.alloydb.v1.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCluster request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCluster(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {google.cloud.alloydb.v1.InstanceView} request.view + * The view of the instance to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.get_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.alloydb.v1.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.alloydb.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.alloydb.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request?: protos.google.cloud.alloydb.v1.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInstance request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstance(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Executes a SQL statement in a database inside an AlloyDB instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.password] + * Optional. The database native user’s password. + * @param {string} request.instance + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * @param {string} request.database + * 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 {string} [request.user] + * 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 {string} request.sqlStatement + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * @param {boolean} [request.validateOnly] + * Optional. If set, validates the sql statement by performing + * syntax and semantic validation and doesn't execute the query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.ExecuteSqlResponse|ExecuteSqlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.execute_sql.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async + */ + executeSql( + request?: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|undefined, {}|undefined + ]>; + executeSql( + request: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request?: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance': request.instance ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeSql request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeSql(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.get_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.alloydb.v1.IGetBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|undefined, {}|undefined + ]>; + getBackup( + request: protos.google.cloud.alloydb.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request: protos.google.cloud.alloydb.v1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request?: protos.google.cloud.alloydb.v1.IGetBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBackup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @param {string} [request.requestId] + * 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 {google.protobuf.Duration} [request.certDuration] + * 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 {string} [request.publicKey] + * Optional. The public key from the client. + * @param {boolean} [request.useMetadataExchange] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse|GenerateClientCertificateResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async + */ + generateClientCertificate( + request?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|undefined, {}|undefined + ]>; + generateClientCertificate( + request: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): void; + generateClientCertificate( + request: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): void; + generateClientCertificate( + request?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('generateClientCertificate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateClientCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.generateClientCertificate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|undefined, + {}|undefined + ]) => { + this._log.info('generateClientCertificate response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get instance metadata used for a connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @param {string} [request.requestId] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.ConnectionInfo|ConnectionInfo}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.get_connection_info.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async + */ + getConnectionInfo( + request?: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|undefined, {}|undefined + ]>; + getConnectionInfo( + request: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): void; + getConnectionInfo( + request: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): void; + getConnectionInfo( + request?: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConnectionInfo request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConnectionInfo(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConnectionInfo response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.get_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetUser_async + */ + getUser( + request?: protos.google.cloud.alloydb.v1.IGetUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|undefined, {}|undefined + ]>; + getUser( + request: protos.google.cloud.alloydb.v1.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request: protos.google.cloud.alloydb.v1.IGetUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request?: protos.google.cloud.alloydb.v1.IGetUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new User in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.userId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.User} request.user + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateUser_async + */ + createUser( + request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|undefined, {}|undefined + ]>; + createUser( + request: protos.google.cloud.alloydb.v1.ICreateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request: protos.google.cloud.alloydb.v1.ICreateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('createUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the parameters of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1.User} request.user + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * Optional. Allow missing fields in the update mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async + */ + updateUser( + request?: protos.google.cloud.alloydb.v1.IUpdateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|undefined, {}|undefined + ]>; + updateUser( + request: protos.google.cloud.alloydb.v1.IUpdateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request: protos.google.cloud.alloydb.v1.IUpdateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request?: protos.google.cloud.alloydb.v1.IUpdateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user.name': request.user!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_user.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async + */ + deleteUser( + request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|undefined, {}|undefined + ]>; + deleteUser( + request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteUser request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new Cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls.createCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async + */ + async checkCreateClusterProgress(name: string): Promise>{ + this._log.info('createCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls.updateCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async + */ + async checkUpdateClusterProgress(name: string): Promise>{ + this._log.info('updateCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports data from the cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1.GcsDestination} request.gcsDestination + * Required. Option to export data to cloud storage. + * @param {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} request.csvExportOptions + * Options for exporting data in CSV format. Required field to be set for + * CSV file type. + * @param {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} request.sqlExportOptions + * Options for exporting data in SQL format. Required field to be set for + * SQL file type. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.database + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.export_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async + */ + exportCluster( + request?: protos.google.cloud.alloydb.v1.IExportClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportCluster( + request: protos.google.cloud.alloydb.v1.IExportClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportCluster( + request: protos.google.cloud.alloydb.v1.IExportClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportCluster( + request?: protos.google.cloud.alloydb.v1.IExportClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportCluster request %j', request); + return this.innerApiCalls.exportCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('exportCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `exportCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.export_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async + */ + async checkExportClusterProgress(name: string): Promise>{ + this._log.info('exportCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports data to the cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} request.sqlImportOptions + * Options for importing data in SQL format. + * @param {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} request.csvImportOptions + * Options for importing data in CSV format. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.gcsUri + * 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 {string} [request.database] + * 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 {string} [request.user] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.import_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async + */ + importCluster( + request?: protos.google.cloud.alloydb.v1.IImportClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importCluster( + request: protos.google.cloud.alloydb.v1.IImportClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importCluster( + request: protos.google.cloud.alloydb.v1.IImportClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importCluster( + request?: protos.google.cloud.alloydb.v1.IImportClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importCluster request %j', request); + return this.innerApiCalls.importCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.import_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async + */ + async checkImportClusterProgress(name: string): Promise>{ + this._log.info('importCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Upgrades a single Cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {google.cloud.alloydb.v1.DatabaseVersion} request.version + * Required. The version the cluster is going to be upgraded to. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {string} [request.etag] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async + */ + upgradeCluster( + request?: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + upgradeCluster( + request: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeCluster( + request: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeCluster( + request?: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('upgradeCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('upgradeCluster request %j', request); + return this.innerApiCalls.upgradeCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('upgradeCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `upgradeCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async + */ + async checkUpgradeClusterProgress(name: string): Promise>{ + this._log.info('upgradeCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.upgradeCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.force] + * Optional. Whether to cascade delete child instances for given cluster. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async + */ + async checkDeleteClusterProgress(name: string): Promise>{ + this._log.info('deleteCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async + */ + promoteCluster( + request?: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + promoteCluster( + request: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteCluster( + request: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteCluster( + request?: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteCluster request %j', request); + return this.innerApiCalls.promoteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('promoteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `promoteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async + */ + async checkPromoteClusterProgress(name: string): Promise>{ + this._log.info('promoteCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.switchover_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async + */ + switchoverCluster( + request?: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + switchoverCluster( + request: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + switchoverCluster( + request: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + switchoverCluster( + request?: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('switchoverCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('switchoverCluster request %j', request); + return this.innerApiCalls.switchoverCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('switchoverCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `switchoverCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.switchover_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async + */ + async checkSwitchoverClusterProgress(name: string): Promise>{ + this._log.info('switchoverCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.switchoverCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1.BackupSource} request.backupSource + * Backup source. + * @param {google.cloud.alloydb.v1.ContinuousBackupSource} request.continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async + */ + restoreCluster( + request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreCluster( + request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreCluster( + request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreCluster( + request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCluster request %j', request); + return this.innerApiCalls.restoreCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async + */ + async checkRestoreClusterProgress(name: string): Promise>{ + this._log.info('restoreCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object (the secondary cluster). + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryCluster request %j', request); + return this.innerApiCalls.createSecondaryCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecondaryCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + async checkCreateSecondaryClusterProgress(name: string): Promise>{ + this._log.info('createSecondaryCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} request.instanceId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Instance} request.instance + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls.createInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async + */ + async checkCreateInstanceProgress(name: string): Promise>{ + this._log.info('createInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new SECONDARY Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} request.instanceId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Instance} request.instance + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async + */ + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryInstance request %j', request); + return this.innerApiCalls.createSecondaryInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecondaryInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async + */ + async checkCreateSecondaryInstanceProgress(name: string): Promise>{ + this._log.info('createSecondaryInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. + * @param {google.cloud.alloydb.v1.CreateInstanceRequests} request.requests + * Required. Resources being created. + * @param {string} [request.requestId] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.batch_create_instances.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async + */ + batchCreateInstances( + request?: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchCreateInstances( + request: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateInstances( + request: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateInstances( + request?: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchCreateInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchCreateInstances request %j', request); + return this.innerApiCalls.batchCreateInstances(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchCreateInstances response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchCreateInstances()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.batch_create_instances.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async + */ + async checkBatchCreateInstancesProgress(name: string): Promise>{ + this._log.info('batchCreateInstances long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateInstances, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1.Instance} request.instance + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async + */ + updateInstance( + request?: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request?: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance.name': request.instance!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls.updateInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + this._log.info('updateInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + this._log.info('deleteInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async + */ + failoverInstance( + request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + failoverInstance( + request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + failoverInstance( + request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + failoverInstance( + request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('failoverInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('failoverInstance request %j', request); + return this.innerApiCalls.failoverInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('failoverInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `failoverInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async + */ + async checkFailoverInstanceProgress(name: string): Promise>{ + this._log.info('failoverInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Injects fault in an instance. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} request.faultType + * Required. The type of fault to be injected in an instance. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_InjectFault_async + */ + injectFault( + request?: protos.google.cloud.alloydb.v1.IInjectFaultRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + injectFault( + request: protos.google.cloud.alloydb.v1.IInjectFaultRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + injectFault( + request: protos.google.cloud.alloydb.v1.IInjectFaultRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + injectFault( + request?: protos.google.cloud.alloydb.v1.IInjectFaultRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('injectFault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('injectFault request %j', request); + return this.innerApiCalls.injectFault(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('injectFault response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `injectFault()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_InjectFault_async + */ + async checkInjectFaultProgress(name: string): Promise>{ + this._log.info('injectFault long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restart an Instance in a cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {string[]} [request.nodeIds] + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.restart_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async + */ + restartInstance( + request?: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request?: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartInstance request %j', request); + return this.innerApiCalls.restartInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restartInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.restart_instance.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async + */ + async checkRestartInstanceProgress(name: string): Promise>{ + this._log.info('restartInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Backup in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.backupId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Backup} request.backup + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async + */ + createBackup( + request?: protos.google.cloud.alloydb.v1.ICreateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackup( + request: protos.google.cloud.alloydb.v1.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request: protos.google.cloud.alloydb.v1.ICreateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request?: protos.google.cloud.alloydb.v1.ICreateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls.createBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.create_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async + */ + async checkCreateBackupProgress(name: string): Promise>{ + this._log.info('createBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1.Backup} request.backup + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackup( + request: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request?: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls.updateBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.update_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async + */ + async checkUpdateBackupProgress(name: string): Promise>{ + this._log.info('updateBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {string} [request.etag] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackup( + request: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request?: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.delete_backup.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async + */ + async checkDeleteBackupProgress(name: string): Promise>{ + this._log.info('deleteBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Cluster|Cluster}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClusters( + request?: protos.google.cloud.alloydb.v1.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.ICluster[], + protos.google.cloud.alloydb.v1.IListClustersRequest|null, + protos.google.cloud.alloydb.v1.IListClustersResponse + ]>; + listClusters( + request: protos.google.cloud.alloydb.v1.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListClustersRequest, + protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1.ICluster>): void; + listClusters( + request: protos.google.cloud.alloydb.v1.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListClustersRequest, + protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1.ICluster>): void; + listClusters( + request?: protos.google.cloud.alloydb.v1.IListClustersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1.IListClustersRequest, + protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1.ICluster>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListClustersRequest, + protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1.ICluster>): + Promise<[ + protos.google.cloud.alloydb.v1.ICluster[], + protos.google.cloud.alloydb.v1.IListClustersRequest|null, + protos.google.cloud.alloydb.v1.IListClustersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListClustersRequest, + protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1.ICluster>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1.ICluster[], + protos.google.cloud.alloydb.v1.IListClustersRequest|null, + protos.google.cloud.alloydb.v1.IListClustersResponse + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listClusters`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Cluster|Cluster} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClustersStream( + request?: protos.google.cloud.alloydb.v1.IListClustersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters stream %j', request); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listClusters`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_clusters.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.alloydb.v1.IListClustersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters iterate %j', request); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Instances in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IInstance[], + protos.google.cloud.alloydb.v1.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.alloydb.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListInstancesRequest, + protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IInstance>): void; + listInstances( + request: protos.google.cloud.alloydb.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListInstancesRequest, + protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IInstance>): void; + listInstances( + request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1.IListInstancesRequest, + protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListInstancesRequest, + protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IInstance>): + Promise<[ + protos.google.cloud.alloydb.v1.IInstance[], + protos.google.cloud.alloydb.v1.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1.IListInstancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListInstancesRequest, + protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IInstance>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1.IInstance[], + protos.google.cloud.alloydb.v1.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1.IListInstancesResponse + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstances`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances stream %j', request); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1.Instance|Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_instances.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances iterate %j', request); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Backups in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Backup|Backup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackups( + request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IBackup[], + protos.google.cloud.alloydb.v1.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1.IListBackupsResponse + ]>; + listBackups( + request: protos.google.cloud.alloydb.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListBackupsRequest, + protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1.IBackup>): void; + listBackups( + request: protos.google.cloud.alloydb.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListBackupsRequest, + protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1.IBackup>): void; + listBackups( + request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1.IListBackupsRequest, + protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1.IBackup>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListBackupsRequest, + protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1.IBackup>): + Promise<[ + protos.google.cloud.alloydb.v1.IBackup[], + protos.google.cloud.alloydb.v1.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1.IListBackupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListBackupsRequest, + protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1.IBackup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1.IBackup[], + protos.google.cloud.alloydb.v1.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1.IListBackupsResponse + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Backup|Backup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_backups.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.SupportedDatabaseFlag|SupportedDatabaseFlag}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSupportedDatabaseFlagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSupportedDatabaseFlags( + request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse + ]>; + listSupportedDatabaseFlags( + request: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>): void; + listSupportedDatabaseFlags( + request: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>): void; + listSupportedDatabaseFlags( + request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>): + Promise<[ + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSupportedDatabaseFlags values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSupportedDatabaseFlags request %j', request); + return this.innerApiCalls + .listSupportedDatabaseFlags(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse + ]) => { + this._log.info('listSupportedDatabaseFlags values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.SupportedDatabaseFlag|SupportedDatabaseFlag} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSupportedDatabaseFlagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSupportedDatabaseFlagsStream( + request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSupportedDatabaseFlags stream %j', request); + return this.descriptors.page.listSupportedDatabaseFlags.createStream( + this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSupportedDatabaseFlags`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1.SupportedDatabaseFlag|SupportedDatabaseFlag}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async + */ + listSupportedDatabaseFlagsAsync( + request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSupportedDatabaseFlags iterate %j', request); + return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( + this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Users in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.User|User}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsers( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IUser[], + protos.google.cloud.alloydb.v1.IListUsersRequest|null, + protos.google.cloud.alloydb.v1.IListUsersResponse + ]>; + listUsers( + request: protos.google.cloud.alloydb.v1.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1.IUser>): void; + listUsers( + request: protos.google.cloud.alloydb.v1.IListUsersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1.IUser>): void; + listUsers( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1.IUser>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1.IUser>): + Promise<[ + protos.google.cloud.alloydb.v1.IUser[], + protos.google.cloud.alloydb.v1.IListUsersRequest|null, + protos.google.cloud.alloydb.v1.IListUsersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1.IUser>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUsers request %j', request); + return this.innerApiCalls + .listUsers(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1.IUser[], + protos.google.cloud.alloydb.v1.IListUsersRequest|null, + protos.google.cloud.alloydb.v1.IListUsersResponse + ]) => { + this._log.info('listUsers values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUsers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.User|User} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsersStream( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUsers stream %j', request); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1.User|User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_users.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListUsers_async + */ + listUsersAsync( + request?: protos.google.cloud.alloydb.v1.IListUsersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUsers iterate %j', request); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Databases in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Database|Database}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabases( + request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1.IDatabase[], + protos.google.cloud.alloydb.v1.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1.IListDatabasesResponse + ]>; + listDatabases( + request: protos.google.cloud.alloydb.v1.IListDatabasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListDatabasesRequest, + protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IDatabase>): void; + listDatabases( + request: protos.google.cloud.alloydb.v1.IListDatabasesRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListDatabasesRequest, + protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IDatabase>): void; + listDatabases( + request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1.IListDatabasesRequest, + protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IDatabase>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1.IListDatabasesRequest, + protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IDatabase>): + Promise<[ + protos.google.cloud.alloydb.v1.IDatabase[], + protos.google.cloud.alloydb.v1.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1.IListDatabasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1.IListDatabasesRequest, + protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1.IDatabase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1.IDatabase[], + protos.google.cloud.alloydb.v1.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1.IListDatabasesResponse + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Database|Database} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabasesStream( + request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases stream %j', request); + return this.descriptors.page.listDatabases.createStream( + this.innerApiCalls.listDatabases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatabases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1.Database|Database}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_admin.list_databases.js + * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async + */ + listDatabasesAsync( + request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases iterate %j', request); + return this.descriptors.page.listDatabases.asyncIterate( + this.innerApiCalls['listDatabases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project:string,location:string,cluster:string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified connectionInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + connectionInfoPath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.connectionInfoPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; + } + + /** + * Parse the location from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; + } + + /** + * Parse the cluster from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; + } + + /** + * Parse the instance from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,location:string,cluster:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the location from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).location; + } + + /** + * Parse the cluster from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the cluster from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified supportedDatabaseFlag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} flag + * @returns {string} Resource name string. + */ + supportedDatabaseFlagPath(project:string,location:string,flag:string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ + project: project, + location: location, + flag: flag, + }); + } + + /** + * Parse the project from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; + } + + /** + * Parse the location from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; + } + + /** + * Parse the flag from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the flag. + */ + matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project:string,location:string,cluster:string,user:string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alloyDBAdminStub && !this._terminated) { + return this.alloyDBAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json new file mode 100644 index 00000000000..9f4d18d5deb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json @@ -0,0 +1,223 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1.AlloyDBAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpgradeCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SwitchoverCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FailoverInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteSql": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSupportedDatabaseFlags": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GenerateClientCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetConnectionInfo": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatabases": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json new file mode 100644 index 00000000000..9d50f544344 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json @@ -0,0 +1,7 @@ +[ + "../../protos/google/cloud/alloydb/v1/csql_resources.proto", + "../../protos/google/cloud/alloydb/v1/csql_service.proto", + "../../protos/google/cloud/alloydb/v1/data_model.proto", + "../../protos/google/cloud/alloydb/v1/resources.proto", + "../../protos/google/cloud/alloydb/v1/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts new file mode 100644 index 00000000000..6b704db7833 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts @@ -0,0 +1,1422 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/alloy_d_b_c_s_q_l_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alloy_d_b_c_s_q_l_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for interactions with CloudSQL. + * @class + * @memberof v1 + */ +export class AlloyDBCSQLAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('alloydb'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + alloyDBCSQLAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlloyDBCSQLAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AlloyDBCSQLAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlloyDBCSQLAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'alloydb.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + connectionInfoPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/flags/{flag}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const restoreFromCloudSQLResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; + const restoreFromCloudSQLMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + restoreFromCloudSQL: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreFromCloudSQLResponse.decode.bind(restoreFromCloudSQLResponse), + restoreFromCloudSQLMetadata.decode.bind(restoreFromCloudSQLMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.alloydb.v1.AlloyDBCSQLAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alloyDBCSQLAdminStub) { + return this.alloyDBCSQLAdminStub; + } + + // Put together the "service stub" for + // google.cloud.alloydb.v1.AlloyDBCSQLAdmin. + this.alloyDBCSQLAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1.AlloyDBCSQLAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.alloydb.v1.AlloyDBCSQLAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alloyDBCSQLAdminStubMethods = + ['restoreFromCloudSqL']; + for (const methodName of alloyDBCSQLAdminStubMethods) { + const callPromise = this.alloyDBCSQLAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alloyDBCSQLAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * Restores an AlloyDB cluster from a CloudSQL resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1.CloudSQLBackupRunSource} request.cloudsqlBackupRunSource + * Cluster created from CloudSQL backup run. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1.Cluster} request.cluster + * Required. The resource being created + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js + * region_tag:alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async + */ + restoreFromCloudSQL( + request?: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreFromCloudSQL( + request: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreFromCloudSQL( + request: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreFromCloudSQL( + request?: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreFromCloudSQL response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreFromCloudSQL request %j', request); + return this.innerApiCalls.restoreFromCloudSqL(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreFromCloudSQL response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreFromCloudSQL()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js + * region_tag:alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async + */ + async checkRestoreFromCloudSQLProgress(name: string): Promise>{ + this._log.info('restoreFromCloudSQL long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreFromCloudSQL, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project:string,location:string,cluster:string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified connectionInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + connectionInfoPath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.connectionInfoPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; + } + + /** + * Parse the location from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; + } + + /** + * Parse the cluster from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; + } + + /** + * Parse the instance from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,location:string,cluster:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the location from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).location; + } + + /** + * Parse the cluster from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the cluster from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified supportedDatabaseFlag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} flag + * @returns {string} Resource name string. + */ + supportedDatabaseFlagPath(project:string,location:string,flag:string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ + project: project, + location: location, + flag: flag, + }); + } + + /** + * Parse the project from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; + } + + /** + * Parse the location from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; + } + + /** + * Parse the flag from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the flag. + */ + matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project:string,location:string,cluster:string,user:string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alloyDBCSQLAdminStub && !this._terminated) { + return this.alloyDBCSQLAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json new file mode 100644 index 00000000000..7d7118bea32 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1.AlloyDBCSQLAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RestoreFromCloudSQL": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json new file mode 100644 index 00000000000..9d50f544344 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json @@ -0,0 +1,7 @@ +[ + "../../protos/google/cloud/alloydb/v1/csql_resources.proto", + "../../protos/google/cloud/alloydb/v1/csql_service.proto", + "../../protos/google/cloud/alloydb/v1/data_model.proto", + "../../protos/google/cloud/alloydb/v1/resources.proto", + "../../protos/google/cloud/alloydb/v1/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..a9cc6ea4db3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json @@ -0,0 +1,441 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.alloydb.v1", + "libraryPackage": "@google-cloud/alloydb", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "ExportCluster": { + "methods": [ + "exportCluster" + ] + }, + "ImportCluster": { + "methods": [ + "importCluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgradeCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags", + "listSupportedDatabaseFlagsStream", + "listSupportedDatabaseFlagsAsync" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "ExportCluster": { + "methods": [ + "exportCluster" + ] + }, + "ImportCluster": { + "methods": [ + "importCluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgradeCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags", + "listSupportedDatabaseFlagsStream", + "listSupportedDatabaseFlagsAsync" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + } + } + } + } + }, + "AlloyDBCSQLAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBCSQLAdminClient", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restoreFromCloudSQL" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlloyDBCSQLAdminClient", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restoreFromCloudSQL" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/index.ts b/owl-bot-staging/google-cloud-alloydb/src/v1/index.ts new file mode 100644 index 00000000000..dd5000cd3cb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AlloyDBAdminClient} from './alloy_d_b_admin_client'; +export {AlloyDBCSQLAdminClient} from './alloy_d_b_c_s_q_l_admin_client'; diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts new file mode 100644 index 00000000000..b99e0fa1f61 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts @@ -0,0 +1,6683 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/alloy_d_b_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alloy_d_b_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources + * @class + * @memberof v1alpha + */ +export class AlloyDBAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('alloydb'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + alloyDBAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlloyDBAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AlloyDBAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlloyDBAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'alloydb.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + connectionInfoPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/flags/{flag}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listClusters: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), + listBackups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), + listSupportedDatabaseFlags: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'supportedDatabaseFlags'), + listUsers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users'), + listDatabases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const exportClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.ExportClusterResponse') as gax.protobuf.Type; + const exportClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const importClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.ImportClusterResponse') as gax.protobuf.Type; + const importClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const upgradeClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.UpgradeClusterResponse') as gax.protobuf.Type; + const upgradeClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const promoteClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const promoteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const switchoverClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const switchoverClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const restoreClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const restoreClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const createSecondaryClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const createSecondaryClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const createSecondaryInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; + const createSecondaryInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const batchCreateInstancesResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse') as gax.protobuf.Type; + const batchCreateInstancesMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const failoverInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; + const failoverInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const injectFaultResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; + const injectFaultMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Backup') as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Backup') as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata)), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata)), + exportCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportClusterResponse.decode.bind(exportClusterResponse), + exportClusterMetadata.decode.bind(exportClusterMetadata)), + importCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importClusterResponse.decode.bind(importClusterResponse), + importClusterMetadata.decode.bind(importClusterMetadata)), + upgradeCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + upgradeClusterResponse.decode.bind(upgradeClusterResponse), + upgradeClusterMetadata.decode.bind(upgradeClusterMetadata)), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata)), + promoteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + promoteClusterResponse.decode.bind(promoteClusterResponse), + promoteClusterMetadata.decode.bind(promoteClusterMetadata)), + switchoverCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + switchoverClusterResponse.decode.bind(switchoverClusterResponse), + switchoverClusterMetadata.decode.bind(switchoverClusterMetadata)), + restoreCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreClusterResponse.decode.bind(restoreClusterResponse), + restoreClusterMetadata.decode.bind(restoreClusterMetadata)), + createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryClusterResponse.decode.bind(createSecondaryClusterResponse), + createSecondaryClusterMetadata.decode.bind(createSecondaryClusterMetadata)), + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryInstanceResponse.decode.bind(createSecondaryInstanceResponse), + createSecondaryInstanceMetadata.decode.bind(createSecondaryInstanceMetadata)), + batchCreateInstances: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), + batchCreateInstancesMetadata.decode.bind(batchCreateInstancesMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + failoverInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + failoverInstanceResponse.decode.bind(failoverInstanceResponse), + failoverInstanceMetadata.decode.bind(failoverInstanceMetadata)), + injectFault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + injectFaultResponse.decode.bind(injectFaultResponse), + injectFaultMetadata.decode.bind(injectFaultMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata)), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata)), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.alloydb.v1alpha.AlloyDBAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alloyDBAdminStub) { + return this.alloyDBAdminStub; + } + + // Put together the "service stub" for + // google.cloud.alloydb.v1alpha.AlloyDBAdmin. + this.alloyDBAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1alpha.AlloyDBAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.alloydb.v1alpha.AlloyDBAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alloyDBAdminStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'exportCluster', 'importCluster', 'upgradeCluster', 'deleteCluster', 'promoteCluster', 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', 'executeSql', 'listBackups', 'getBackup', 'createBackup', 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', 'listUsers', 'getUser', 'createUser', 'updateUser', 'deleteUser', 'listDatabases', 'createDatabase']; + for (const methodName of alloyDBAdminStubMethods) { + const callPromise = this.alloyDBAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alloyDBAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {google.cloud.alloydb.v1alpha.ClusterView} [request.view] + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCluster request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCluster(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {google.cloud.alloydb.v1alpha.InstanceView} request.view + * The view of the instance to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request?: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInstance request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstance(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Executes a SQL statement in a database inside an AlloyDB instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.password] + * Optional. The database native user’s password. + * @param {string} request.instance + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * @param {string} request.database + * 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 {string} request.user + * 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 {string} request.sqlStatement + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * @param {boolean} [request.validateOnly] + * Optional. If set, validates the sql statement by performing + * syntax and semantic validation and doesn't execute the query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse|ExecuteSqlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async + */ + executeSql( + request?: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|undefined, {}|undefined + ]>; + executeSql( + request: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request?: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance': request.instance ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeSql request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeSql(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|undefined, {}|undefined + ]>; + getBackup( + request: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request?: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBackup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @param {string} [request.requestId] + * 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 {string} [request.pemCsr] + * Optional. A pem-encoded X.509 certificate signing request (CSR). It is + * recommended to use public_key instead. + * @param {google.protobuf.Duration} [request.certDuration] + * 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 {string} [request.publicKey] + * Optional. The public key from the client. + * @param {boolean} [request.useMetadataExchange] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse|GenerateClientCertificateResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async + */ + generateClientCertificate( + request?: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|undefined, {}|undefined + ]>; + generateClientCertificate( + request: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): void; + generateClientCertificate( + request: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): void; + generateClientCertificate( + request?: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('generateClientCertificate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateClientCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.generateClientCertificate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|undefined, + {}|undefined + ]) => { + this._log.info('generateClientCertificate response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get instance metadata used for a connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @param {string} [request.requestId] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.ConnectionInfo|ConnectionInfo}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async + */ + getConnectionInfo( + request?: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|undefined, {}|undefined + ]>; + getConnectionInfo( + request: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): void; + getConnectionInfo( + request: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): void; + getConnectionInfo( + request?: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConnectionInfo request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConnectionInfo(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConnectionInfo response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async + */ + getUser( + request?: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|undefined, {}|undefined + ]>; + getUser( + request: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request?: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new User in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.userId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.User} request.user + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async + */ + createUser( + request?: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|undefined, {}|undefined + ]>; + createUser( + request: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request?: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('createUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the parameters of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1alpha.User} request.user + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * Optional. Allow missing fields in the update mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async + */ + updateUser( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|undefined, {}|undefined + ]>; + updateUser( + request: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user.name': request.user!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_user.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async + */ + deleteUser( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|undefined, {}|undefined + ]>; + deleteUser( + request: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteUser request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new Database in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.databaseId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Database} request.database + * Required. The resource being created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Database|Database}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_database.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async + */ + createDatabase( + request?: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|undefined, {}|undefined + ]>; + createDatabase( + request: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>): void; + createDatabase( + request: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, + callback: Callback< + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>): void; + createDatabase( + request?: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDatabase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDatabase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDatabase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IDatabase, + protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDatabase response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new Cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls.createCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async + */ + async checkCreateClusterProgress(name: string): Promise>{ + this._log.info('createCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1alpha.Cluster} request.cluster + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls.updateCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async + */ + async checkUpdateClusterProgress(name: string): Promise>{ + this._log.info('updateCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports data from the cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1alpha.GcsDestination} request.gcsDestination + * Required. Option to export data to cloud storage. + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} request.csvExportOptions + * Options for exporting data in CSV format. Required field to be set for + * CSV file type. + * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} request.sqlExportOptions + * Options for exporting data in SQL format. Required field to be set for + * SQL file type. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.database + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async + */ + exportCluster( + request?: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportCluster( + request: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportCluster( + request: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportCluster( + request?: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportCluster request %j', request); + return this.innerApiCalls.exportCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('exportCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `exportCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async + */ + async checkExportClusterProgress(name: string): Promise>{ + this._log.info('exportCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports data to the cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} request.sqlImportOptions + * Options for importing data in SQL format. + * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} request.csvImportOptions + * Options for importing data in CSV format. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.gcsUri + * 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 {string} [request.database] + * 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 {string} [request.user] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async + */ + importCluster( + request?: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importCluster( + request: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importCluster( + request: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importCluster( + request?: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importCluster request %j', request); + return this.innerApiCalls.importCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async + */ + async checkImportClusterProgress(name: string): Promise>{ + this._log.info('importCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Upgrades a single Cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {google.cloud.alloydb.v1alpha.DatabaseVersion} request.version + * Required. The version the cluster is going to be upgraded to. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {string} [request.etag] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async + */ + upgradeCluster( + request?: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + upgradeCluster( + request: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeCluster( + request: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeCluster( + request?: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('upgradeCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('upgradeCluster request %j', request); + return this.innerApiCalls.upgradeCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('upgradeCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `upgradeCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async + */ + async checkUpgradeClusterProgress(name: string): Promise>{ + this._log.info('upgradeCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.upgradeCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.force] + * Optional. Whether to cascade delete child instances for given cluster. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async + */ + async checkDeleteClusterProgress(name: string): Promise>{ + this._log.info('deleteCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async + */ + promoteCluster( + request?: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + promoteCluster( + request: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteCluster( + request: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteCluster( + request?: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteCluster request %j', request); + return this.innerApiCalls.promoteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('promoteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `promoteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async + */ + async checkPromoteClusterProgress(name: string): Promise>{ + this._log.info('promoteCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async + */ + switchoverCluster( + request?: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + switchoverCluster( + request: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + switchoverCluster( + request: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + switchoverCluster( + request?: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('switchoverCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('switchoverCluster request %j', request); + return this.innerApiCalls.switchoverCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('switchoverCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `switchoverCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async + */ + async checkSwitchoverClusterProgress(name: string): Promise>{ + this._log.info('switchoverCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.switchoverCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1alpha.BackupSource} request.backupSource + * Backup source. + * @param {google.cloud.alloydb.v1alpha.ContinuousBackupSource} request.continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async + */ + restoreCluster( + request?: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreCluster( + request: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreCluster( + request: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreCluster( + request?: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCluster request %j', request); + return this.innerApiCalls.restoreCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async + */ + async checkRestoreClusterProgress(name: string): Promise>{ + this._log.info('restoreCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object (the secondary cluster). + * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryCluster request %j', request); + return this.innerApiCalls.createSecondaryCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecondaryCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + async checkCreateSecondaryClusterProgress(name: string): Promise>{ + this._log.info('createSecondaryCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} request.instanceId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Instance} request.instance + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request?: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls.createInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async + */ + async checkCreateInstanceProgress(name: string): Promise>{ + this._log.info('createInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new SECONDARY Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} request.instanceId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Instance} request.instance + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async + */ + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryInstance request %j', request); + return this.innerApiCalls.createSecondaryInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecondaryInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async + */ + async checkCreateSecondaryInstanceProgress(name: string): Promise>{ + this._log.info('createSecondaryInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. + * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequests} request.requests + * Required. Resources being created. + * @param {string} [request.requestId] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async + */ + batchCreateInstances( + request?: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchCreateInstances( + request: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateInstances( + request: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateInstances( + request?: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchCreateInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchCreateInstances request %j', request); + return this.innerApiCalls.batchCreateInstances(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchCreateInstances response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchCreateInstances()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async + */ + async checkBatchCreateInstancesProgress(name: string): Promise>{ + this._log.info('batchCreateInstances long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateInstances, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1alpha.Instance} request.instance + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async + */ + updateInstance( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance.name': request.instance!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls.updateInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + this._log.info('updateInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + this._log.info('deleteInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async + */ + failoverInstance( + request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + failoverInstance( + request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + failoverInstance( + request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + failoverInstance( + request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('failoverInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('failoverInstance request %j', request); + return this.innerApiCalls.failoverInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('failoverInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `failoverInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async + */ + async checkFailoverInstanceProgress(name: string): Promise>{ + this._log.info('failoverInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Injects fault in an instance. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} request.faultType + * Required. The type of fault to be injected in an instance. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async + */ + injectFault( + request?: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + injectFault( + request: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + injectFault( + request: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + injectFault( + request?: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('injectFault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('injectFault request %j', request); + return this.innerApiCalls.injectFault(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('injectFault response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `injectFault()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async + */ + async checkInjectFaultProgress(name: string): Promise>{ + this._log.info('injectFault long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restart an Instance in a cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {string[]} [request.nodeIds] + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async + */ + restartInstance( + request?: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request?: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartInstance request %j', request); + return this.innerApiCalls.restartInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restartInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async + */ + async checkRestartInstanceProgress(name: string): Promise>{ + this._log.info('restartInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Backup in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.backupId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Backup} request.backup + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async + */ + createBackup( + request?: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackup( + request: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request?: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls.createBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async + */ + async checkCreateBackupProgress(name: string): Promise>{ + this._log.info('createBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1alpha.Backup} request.backup + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackup( + request: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request?: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls.updateBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async + */ + async checkUpdateBackupProgress(name: string): Promise>{ + this._log.info('updateBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {string} [request.etag] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackup( + request: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request?: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async + */ + async checkDeleteBackupProgress(name: string): Promise>{ + this._log.info('deleteBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClusters( + request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.ICluster[], + protos.google.cloud.alloydb.v1alpha.IListClustersRequest|null, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse + ]>; + listClusters( + request: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ICluster>): void; + listClusters( + request: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ICluster>): void; + listClusters( + request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ICluster>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ICluster>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.ICluster[], + protos.google.cloud.alloydb.v1alpha.IListClustersRequest|null, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ICluster>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.ICluster[], + protos.google.cloud.alloydb.v1alpha.IListClustersRequest|null, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listClusters`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClustersStream( + request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters stream %j', request); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listClusters`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters iterate %j', request); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Instances in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IInstance[], + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IInstance>): void; + listInstances( + request: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IInstance>): void; + listInstances( + request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IInstance>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IInstance[], + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IInstance>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IInstance[], + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstances`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances stream %j', request); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_instances.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances iterate %j', request); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Backups in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackups( + request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IBackup[], + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse + ]>; + listBackups( + request: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IBackup>): void; + listBackups( + request: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IBackup>): void; + listBackups( + request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IBackup>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IBackup>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IBackup[], + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IBackup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IBackup[], + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_backups.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag|SupportedDatabaseFlag}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSupportedDatabaseFlagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSupportedDatabaseFlags( + request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse + ]>; + listSupportedDatabaseFlags( + request: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>): void; + listSupportedDatabaseFlags( + request: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>): void; + listSupportedDatabaseFlags( + request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSupportedDatabaseFlags values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSupportedDatabaseFlags request %j', request); + return this.innerApiCalls + .listSupportedDatabaseFlags(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse + ]) => { + this._log.info('listSupportedDatabaseFlags values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag|SupportedDatabaseFlag} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSupportedDatabaseFlagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSupportedDatabaseFlagsStream( + request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSupportedDatabaseFlags stream %j', request); + return this.descriptors.page.listSupportedDatabaseFlags.createStream( + this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSupportedDatabaseFlags`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag|SupportedDatabaseFlag}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async + */ + listSupportedDatabaseFlagsAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSupportedDatabaseFlags iterate %j', request); + return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( + this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Users in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.User|User}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsers( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser[], + protos.google.cloud.alloydb.v1alpha.IListUsersRequest|null, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse + ]>; + listUsers( + request: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IUser>): void; + listUsers( + request: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IUser>): void; + listUsers( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IUser>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IUser>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IUser[], + protos.google.cloud.alloydb.v1alpha.IListUsersRequest|null, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IUser>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUsers request %j', request); + return this.innerApiCalls + .listUsers(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IUser[], + protos.google.cloud.alloydb.v1alpha.IListUsersRequest|null, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse + ]) => { + this._log.info('listUsers values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUsers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsersStream( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUsers stream %j', request); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1alpha.User|User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_users.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async + */ + listUsersAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUsers iterate %j', request); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Databases in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Database|Database}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabases( + request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IDatabase[], + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse + ]>; + listDatabases( + request: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IDatabase>): void; + listDatabases( + request: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IDatabase>): void; + listDatabases( + request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IDatabase>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IDatabase>): + Promise<[ + protos.google.cloud.alloydb.v1alpha.IDatabase[], + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1alpha.IDatabase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IDatabase[], + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Database|Database} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabasesStream( + request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases stream %j', request); + return this.descriptors.page.listDatabases.createStream( + this.innerApiCalls.listDatabases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatabases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1alpha.Database|Database}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_databases.js + * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async + */ + listDatabasesAsync( + request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases iterate %j', request); + return this.descriptors.page.listDatabases.asyncIterate( + this.innerApiCalls['listDatabases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project:string,location:string,cluster:string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified connectionInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + connectionInfoPath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.connectionInfoPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; + } + + /** + * Parse the location from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; + } + + /** + * Parse the cluster from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; + } + + /** + * Parse the instance from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,location:string,cluster:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the location from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).location; + } + + /** + * Parse the cluster from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the cluster from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified supportedDatabaseFlag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} flag + * @returns {string} Resource name string. + */ + supportedDatabaseFlagPath(project:string,location:string,flag:string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ + project: project, + location: location, + flag: flag, + }); + } + + /** + * Parse the project from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; + } + + /** + * Parse the location from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; + } + + /** + * Parse the flag from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the flag. + */ + matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project:string,location:string,cluster:string,user:string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alloyDBAdminStub && !this._terminated) { + return this.alloyDBAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json new file mode 100644 index 00000000000..1d47fe63323 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json @@ -0,0 +1,228 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1alpha.AlloyDBAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpgradeCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SwitchoverCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FailoverInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteSql": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSupportedDatabaseFlags": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GenerateClientCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetConnectionInfo": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatabases": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json new file mode 100644 index 00000000000..cd27a68e5cc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/alloydb/v1alpha/csql_resources.proto", + "../../protos/google/cloud/alloydb/v1alpha/csql_service.proto", + "../../protos/google/cloud/alloydb/v1alpha/data_model.proto", + "../../protos/google/cloud/alloydb/v1alpha/gemini.proto", + "../../protos/google/cloud/alloydb/v1alpha/resources.proto", + "../../protos/google/cloud/alloydb/v1alpha/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts new file mode 100644 index 00000000000..940408e18a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts @@ -0,0 +1,1422 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alloy_d_b_c_s_q_l_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for interactions with CloudSQL. + * @class + * @memberof v1alpha + */ +export class AlloyDBCSQLAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('alloydb'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + alloyDBCSQLAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlloyDBCSQLAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AlloyDBCSQLAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlloyDBCSQLAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'alloydb.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + connectionInfoPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/flags/{flag}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const restoreFromCloudSQLResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; + const restoreFromCloudSQLMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + restoreFromCloudSQL: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreFromCloudSQLResponse.decode.bind(restoreFromCloudSQLResponse), + restoreFromCloudSQLMetadata.decode.bind(restoreFromCloudSQLMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alloyDBCSQLAdminStub) { + return this.alloyDBCSQLAdminStub; + } + + // Put together the "service stub" for + // google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin. + this.alloyDBCSQLAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alloyDBCSQLAdminStubMethods = + ['restoreFromCloudSqL']; + for (const methodName of alloyDBCSQLAdminStubMethods) { + const callPromise = this.alloyDBCSQLAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alloyDBCSQLAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * Restores an AlloyDB cluster from a CloudSQL resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} request.cloudsqlBackupRunSource + * Cluster created from CloudSQL backup run. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster + * Required. The resource being created + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js + * region_tag:alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async + */ + restoreFromCloudSQL( + request?: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreFromCloudSQL( + request: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreFromCloudSQL( + request: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreFromCloudSQL( + request?: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreFromCloudSQL response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreFromCloudSQL request %j', request); + return this.innerApiCalls.restoreFromCloudSqL(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreFromCloudSQL response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreFromCloudSQL()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js + * region_tag:alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async + */ + async checkRestoreFromCloudSQLProgress(name: string): Promise>{ + this._log.info('restoreFromCloudSQL long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreFromCloudSQL, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project:string,location:string,cluster:string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified connectionInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + connectionInfoPath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.connectionInfoPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; + } + + /** + * Parse the location from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; + } + + /** + * Parse the cluster from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; + } + + /** + * Parse the instance from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,location:string,cluster:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the location from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).location; + } + + /** + * Parse the cluster from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the cluster from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified supportedDatabaseFlag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} flag + * @returns {string} Resource name string. + */ + supportedDatabaseFlagPath(project:string,location:string,flag:string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ + project: project, + location: location, + flag: flag, + }); + } + + /** + * Parse the project from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; + } + + /** + * Parse the location from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; + } + + /** + * Parse the flag from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the flag. + */ + matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project:string,location:string,cluster:string,user:string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alloyDBCSQLAdminStub && !this._terminated) { + return this.alloyDBCSQLAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json new file mode 100644 index 00000000000..e881759a6af --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RestoreFromCloudSQL": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json new file mode 100644 index 00000000000..cd27a68e5cc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/alloydb/v1alpha/csql_resources.proto", + "../../protos/google/cloud/alloydb/v1alpha/csql_service.proto", + "../../protos/google/cloud/alloydb/v1alpha/data_model.proto", + "../../protos/google/cloud/alloydb/v1alpha/gemini.proto", + "../../protos/google/cloud/alloydb/v1alpha/resources.proto", + "../../protos/google/cloud/alloydb/v1alpha/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..0fec579ceb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json @@ -0,0 +1,451 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.alloydb.v1alpha", + "libraryPackage": "@google-cloud/alloydb", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "ExportCluster": { + "methods": [ + "exportCluster" + ] + }, + "ImportCluster": { + "methods": [ + "importCluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgradeCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags", + "listSupportedDatabaseFlagsStream", + "listSupportedDatabaseFlagsAsync" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "ExportCluster": { + "methods": [ + "exportCluster" + ] + }, + "ImportCluster": { + "methods": [ + "importCluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgradeCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags", + "listSupportedDatabaseFlagsStream", + "listSupportedDatabaseFlagsAsync" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + } + } + } + } + }, + "AlloyDBCSQLAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBCSQLAdminClient", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restoreFromCloudSQL" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlloyDBCSQLAdminClient", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restoreFromCloudSQL" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts new file mode 100644 index 00000000000..dd5000cd3cb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts @@ -0,0 +1,20 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AlloyDBAdminClient} from './alloy_d_b_admin_client'; +export {AlloyDBCSQLAdminClient} from './alloy_d_b_c_s_q_l_admin_client'; diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts new file mode 100644 index 00000000000..d88b42c02aa --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts @@ -0,0 +1,6683 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/alloy_d_b_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alloy_d_b_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources + * @class + * @memberof v1beta + */ +export class AlloyDBAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('alloydb'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + alloyDBAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlloyDBAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AlloyDBAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlloyDBAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'alloydb.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + connectionInfoPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/flags/{flag}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listClusters: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), + listBackups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), + listSupportedDatabaseFlags: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'supportedDatabaseFlags'), + listUsers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users'), + listDatabases: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1beta/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const exportClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.ExportClusterResponse') as gax.protobuf.Type; + const exportClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const importClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.ImportClusterResponse') as gax.protobuf.Type; + const importClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const upgradeClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.UpgradeClusterResponse') as gax.protobuf.Type; + const upgradeClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const promoteClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const promoteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const switchoverClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const switchoverClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const restoreClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const restoreClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const createSecondaryClusterResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const createSecondaryClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const createSecondaryInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; + const createSecondaryInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const batchCreateInstancesResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse') as gax.protobuf.Type; + const batchCreateInstancesMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const failoverInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; + const failoverInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const injectFaultResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; + const injectFaultMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Backup') as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Backup') as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata)), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata)), + exportCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportClusterResponse.decode.bind(exportClusterResponse), + exportClusterMetadata.decode.bind(exportClusterMetadata)), + importCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importClusterResponse.decode.bind(importClusterResponse), + importClusterMetadata.decode.bind(importClusterMetadata)), + upgradeCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + upgradeClusterResponse.decode.bind(upgradeClusterResponse), + upgradeClusterMetadata.decode.bind(upgradeClusterMetadata)), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata)), + promoteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + promoteClusterResponse.decode.bind(promoteClusterResponse), + promoteClusterMetadata.decode.bind(promoteClusterMetadata)), + switchoverCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + switchoverClusterResponse.decode.bind(switchoverClusterResponse), + switchoverClusterMetadata.decode.bind(switchoverClusterMetadata)), + restoreCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreClusterResponse.decode.bind(restoreClusterResponse), + restoreClusterMetadata.decode.bind(restoreClusterMetadata)), + createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryClusterResponse.decode.bind(createSecondaryClusterResponse), + createSecondaryClusterMetadata.decode.bind(createSecondaryClusterMetadata)), + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecondaryInstanceResponse.decode.bind(createSecondaryInstanceResponse), + createSecondaryInstanceMetadata.decode.bind(createSecondaryInstanceMetadata)), + batchCreateInstances: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), + batchCreateInstancesMetadata.decode.bind(batchCreateInstancesMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + failoverInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + failoverInstanceResponse.decode.bind(failoverInstanceResponse), + failoverInstanceMetadata.decode.bind(failoverInstanceMetadata)), + injectFault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + injectFaultResponse.decode.bind(injectFaultResponse), + injectFaultMetadata.decode.bind(injectFaultMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata)), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata)), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.alloydb.v1beta.AlloyDBAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alloyDBAdminStub) { + return this.alloyDBAdminStub; + } + + // Put together the "service stub" for + // google.cloud.alloydb.v1beta.AlloyDBAdmin. + this.alloyDBAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1beta.AlloyDBAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.alloydb.v1beta.AlloyDBAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alloyDBAdminStubMethods = + ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'exportCluster', 'importCluster', 'upgradeCluster', 'deleteCluster', 'promoteCluster', 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', 'executeSql', 'listBackups', 'getBackup', 'createBackup', 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', 'listUsers', 'getUser', 'createUser', 'updateUser', 'deleteUser', 'listDatabases', 'createDatabase']; + for (const methodName of alloyDBAdminStubMethods) { + const callPromise = this.alloyDBAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alloyDBAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {google.cloud.alloydb.v1beta.ClusterView} [request.view] + * Optional. The view of the cluster to return. Returns all default fields if + * not set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.get_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCluster request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCluster(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {google.cloud.alloydb.v1beta.InstanceView} request.view + * The view of the instance to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.get_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request?: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInstance request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstance(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Executes a SQL statement in a database inside an AlloyDB instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.password] + * Optional. The database native user’s password. + * @param {string} request.instance + * Required. The instance where the SQL will be executed. For the required + * format, see the comment on the Instance.name field. + * @param {string} request.database + * 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 {string} request.user + * 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 {string} request.sqlStatement + * Required. SQL statement to execute on database. Any valid statement is + * permitted, including DDL, DML, DQL statements. + * @param {boolean} [request.validateOnly] + * Optional. If set, validates the sql statement by performing + * syntax and semantic validation and doesn't execute the query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse|ExecuteSqlResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.execute_sql.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async + */ + executeSql( + request?: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|undefined, {}|undefined + ]>; + executeSql( + request: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): void; + executeSql( + request?: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance': request.instance ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('executeSql request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.executeSql(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|undefined, + {}|undefined + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.get_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|undefined, {}|undefined + ]>; + getBackup( + request: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request?: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBackup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. The required format is: + * * projects/{project}/locations/{location}/clusters/{cluster} + * @param {string} [request.requestId] + * 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 {string} [request.pemCsr] + * Optional. A pem-encoded X.509 certificate signing request (CSR). It is + * recommended to use public_key instead. + * @param {google.protobuf.Duration} [request.certDuration] + * 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 {string} [request.publicKey] + * Optional. The public key from the client. + * @param {boolean} [request.useMetadataExchange] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse|GenerateClientCertificateResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async + */ + generateClientCertificate( + request?: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|undefined, {}|undefined + ]>; + generateClientCertificate( + request: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): void; + generateClientCertificate( + request: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): void; + generateClientCertificate( + request?: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('generateClientCertificate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateClientCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.generateClientCertificate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|undefined, + {}|undefined + ]) => { + this._log.info('generateClientCertificate response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Get instance metadata used for a connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. The required format is: + * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} + * @param {string} [request.requestId] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.ConnectionInfo|ConnectionInfo}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async + */ + getConnectionInfo( + request?: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|undefined, {}|undefined + ]>; + getConnectionInfo( + request: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): void; + getConnectionInfo( + request: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): void; + getConnectionInfo( + request?: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getConnectionInfo request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getConnectionInfo(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|undefined, + {}|undefined + ]) => { + this._log.info('getConnectionInfo response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.get_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async + */ + getUser( + request?: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|undefined, {}|undefined + ]>; + getUser( + request: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request?: protos.google.cloud.alloydb.v1beta.IGetUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new User in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.userId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.User} request.user + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async + */ + createUser( + request?: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|undefined, {}|undefined + ]>; + createUser( + request: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request?: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('createUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the parameters of a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1beta.User} request.user + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * Optional. Allow missing fields in the update mask. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.User|User}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async + */ + updateUser( + request?: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|undefined, {}|undefined + ]>; + updateUser( + request: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request?: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user.name': request.user!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateUser request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a single User. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the User.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_user.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async + */ + deleteUser( + request?: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|undefined, {}|undefined + ]>; + deleteUser( + request: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request?: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteUser request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteUser(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteUser response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new Database in a given project, location, and cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.databaseId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Database} request.database + * Required. The resource being created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Database|Database}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_database.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async + */ + createDatabase( + request?: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|undefined, {}|undefined + ]>; + createDatabase( + request: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>): void; + createDatabase( + request: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, + callback: Callback< + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>): void; + createDatabase( + request?: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDatabase request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDatabase response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDatabase(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IDatabase, + protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDatabase response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new Cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls.createCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async + */ + async checkCreateClusterProgress(name: string): Promise>{ + this._log.info('createCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1beta.Cluster} request.cluster + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls.updateCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async + */ + async checkUpdateClusterProgress(name: string): Promise>{ + this._log.info('updateCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Exports data from the cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1beta.GcsDestination} request.gcsDestination + * Required. Option to export data to cloud storage. + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} request.csvExportOptions + * Options for exporting data in CSV format. Required field to be set for + * CSV file type. + * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} request.sqlExportOptions + * Options for exporting data in SQL format. Required field to be set for + * SQL file type. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.database + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.export_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async + */ + exportCluster( + request?: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportCluster( + request: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportCluster( + request: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportCluster( + request?: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportCluster request %j', request); + return this.innerApiCalls.exportCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('exportCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `exportCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.export_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async + */ + async checkExportClusterProgress(name: string): Promise>{ + this._log.info('exportCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports data to the cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} request.sqlImportOptions + * Options for importing data in SQL format. + * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} request.csvImportOptions + * Options for importing data in CSV format. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.gcsUri + * 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 {string} [request.database] + * 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 {string} [request.user] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.import_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async + */ + importCluster( + request?: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importCluster( + request: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importCluster( + request: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importCluster( + request?: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importCluster request %j', request); + return this.innerApiCalls.importCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.import_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async + */ + async checkImportClusterProgress(name: string): Promise>{ + this._log.info('importCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Upgrades a single Cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {google.cloud.alloydb.v1beta.DatabaseVersion} request.version + * Required. The version the cluster is going to be upgraded to. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {string} [request.etag] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async + */ + upgradeCluster( + request?: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + upgradeCluster( + request: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeCluster( + request: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeCluster( + request?: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('upgradeCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('upgradeCluster request %j', request); + return this.innerApiCalls.upgradeCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('upgradeCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `upgradeCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async + */ + async checkUpgradeClusterProgress(name: string): Promise>{ + this._log.info('upgradeCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.upgradeCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.force] + * Optional. Whether to cascade delete child instances for given cluster. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async + */ + async checkDeleteClusterProgress(name: string): Promise>{ + this._log.info('deleteCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Promotes a SECONDARY cluster. This turns down replication + * from the PRIMARY cluster and promotes a secondary cluster + * into its own standalone cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async + */ + promoteCluster( + request?: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + promoteCluster( + request: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteCluster( + request: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteCluster( + request?: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteCluster request %j', request); + return this.innerApiCalls.promoteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('promoteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `promoteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async + */ + async checkPromoteClusterProgress(name: string): Promise>{ + this._log.info('promoteCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Cluster.name field + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async + */ + switchoverCluster( + request?: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + switchoverCluster( + request: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + switchoverCluster( + request: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + switchoverCluster( + request?: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('switchoverCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('switchoverCluster request %j', request); + return this.innerApiCalls.switchoverCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('switchoverCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `switchoverCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async + */ + async checkSwitchoverClusterProgress(name: string): Promise>{ + this._log.info('switchoverCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.switchoverCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1beta.BackupSource} request.backupSource + * Backup source. + * @param {google.cloud.alloydb.v1beta.ContinuousBackupSource} request.continuousBackupSource + * ContinuousBackup source. Continuous backup needs to be enabled in the + * source cluster for this operation to succeed. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async + */ + restoreCluster( + request?: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreCluster( + request: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreCluster( + request: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreCluster( + request?: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCluster request %j', request); + return this.innerApiCalls.restoreCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async + */ + async checkRestoreClusterProgress(name: string): Promise>{ + this._log.info('restoreCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a cluster of type SECONDARY in the given location using + * the primary cluster as the source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of the new cluster. For the required + * format, see the comment on the Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object (the secondary cluster). + * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster + * Required. Configuration of the requesting object (the secondary cluster). + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryCluster( + request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryCluster( + request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryCluster request %j', request); + return this.innerApiCalls.createSecondaryCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecondaryCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async + */ + async checkCreateSecondaryClusterProgress(name: string): Promise>{ + this._log.info('createSecondaryCluster long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} request.instanceId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Instance} request.instance + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request?: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls.createInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async + */ + async checkCreateInstanceProgress(name: string): Promise>{ + this._log.info('createInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new SECONDARY Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} request.instanceId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Instance} request.instance + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async + */ + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryInstance( + request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecondaryInstance( + request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryInstance request %j', request); + return this.innerApiCalls.createSecondaryInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecondaryInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async + */ + async checkCreateSecondaryInstanceProgress(name: string): Promise>{ + this._log.info('createSecondaryInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource. + * @param {google.cloud.alloydb.v1beta.CreateInstanceRequests} request.requests + * Required. Resources being created. + * @param {string} [request.requestId] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async + */ + batchCreateInstances( + request?: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchCreateInstances( + request: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateInstances( + request: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchCreateInstances( + request?: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchCreateInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchCreateInstances request %j', request); + return this.innerApiCalls.batchCreateInstances(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchCreateInstances response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchCreateInstances()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async + */ + async checkBatchCreateInstancesProgress(name: string): Promise>{ + this._log.info('batchCreateInstances long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateInstances, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1beta.Instance} request.instance + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async + */ + updateInstance( + request?: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request?: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'instance.name': request.instance!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls.updateInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + this._log.info('updateInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {string} [request.etag] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + this._log.info('deleteInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Forces a Failover for a highly available instance. + * Failover promotes the HA standby instance as the new primary. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async + */ + failoverInstance( + request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + failoverInstance( + request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + failoverInstance( + request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + failoverInstance( + request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('failoverInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('failoverInstance request %j', request); + return this.innerApiCalls.failoverInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('failoverInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `failoverInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async + */ + async checkFailoverInstanceProgress(name: string): Promise>{ + this._log.info('failoverInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Injects fault in an instance. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} request.faultType + * Required. The type of fault to be injected in an instance. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async + */ + injectFault( + request?: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + injectFault( + request: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + injectFault( + request: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + injectFault( + request?: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('injectFault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('injectFault request %j', request); + return this.innerApiCalls.injectFault(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('injectFault response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `injectFault()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.inject_fault.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async + */ + async checkInjectFaultProgress(name: string): Promise>{ + this._log.info('injectFault long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restart an Instance in a cluster. + * Imperative only. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the resource. For the required format, see the + * comment on the Instance.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * 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 {string[]} [request.nodeIds] + * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + * restart upon. Applicable only to read instances. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.restart_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async + */ + restartInstance( + request?: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request?: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartInstance request %j', request); + return this.innerApiCalls.restartInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restartInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.restart_instance.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async + */ + async checkRestartInstanceProgress(name: string): Promise>{ + this._log.info('restartInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new Backup in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.backupId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Backup} request.backup + * Required. The resource being created + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async + */ + createBackup( + request?: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackup( + request: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackup( + request?: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls.createBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.create_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async + */ + async checkCreateBackupProgress(name: string): Promise>{ + this._log.info('createBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 {google.cloud.alloydb.v1beta.Backup} request.backup + * Required. The resource being updated + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {boolean} [request.allowMissing] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackup( + request: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request?: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls.updateBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.update_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async + */ + async checkUpdateBackupProgress(name: string): Promise>{ + this._log.info('updateBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. For the required format, see the comment on + * the Backup.name field. + * @param {string} [request.requestId] + * 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 {boolean} [request.validateOnly] + * Optional. If set, the backend validates the request, but doesn't actually + * execute it. + * @param {string} [request.etag] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackup( + request: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request?: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_backup.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async + */ + async checkDeleteBackupProgress(name: string): Promise>{ + this._log.info('deleteBackup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClusters( + request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.ICluster[], + protos.google.cloud.alloydb.v1beta.IListClustersRequest|null, + protos.google.cloud.alloydb.v1beta.IListClustersResponse + ]>; + listClusters( + request: protos.google.cloud.alloydb.v1beta.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListClustersRequest, + protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ICluster>): void; + listClusters( + request: protos.google.cloud.alloydb.v1beta.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListClustersRequest, + protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ICluster>): void; + listClusters( + request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListClustersRequest, + protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ICluster>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListClustersRequest, + protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ICluster>): + Promise<[ + protos.google.cloud.alloydb.v1beta.ICluster[], + protos.google.cloud.alloydb.v1beta.IListClustersRequest|null, + protos.google.cloud.alloydb.v1beta.IListClustersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListClustersRequest, + protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ICluster>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.ICluster[], + protos.google.cloud.alloydb.v1beta.IListClustersRequest|null, + protos.google.cloud.alloydb.v1beta.IListClustersResponse + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listClusters`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClustersStream( + request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters stream %j', request); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listClusters`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_clusters.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters iterate %j', request); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Instances in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IInstance[], + protos.google.cloud.alloydb.v1beta.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IInstance>): void; + listInstances( + request: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IInstance>): void; + listInstances( + request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IInstance>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IInstance[], + protos.google.cloud.alloydb.v1beta.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IInstance>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IInstance[], + protos.google.cloud.alloydb.v1beta.IListInstancesRequest|null, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstances`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances stream %j', request); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1beta.Instance|Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_instances.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances iterate %j', request); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Backups in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Backup|Backup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackups( + request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IBackup[], + protos.google.cloud.alloydb.v1beta.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse + ]>; + listBackups( + request: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IBackup>): void; + listBackups( + request: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IBackup>): void; + listBackups( + request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IBackup>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IBackup>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IBackup[], + protos.google.cloud.alloydb.v1beta.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IBackup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IBackup[], + protos.google.cloud.alloydb.v1beta.IListBackupsRequest|null, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Backup|Backup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListBackupsRequest + * @param {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} request.filter + * Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1beta.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_backups.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists SupportedDatabaseFlags for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag|SupportedDatabaseFlag}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSupportedDatabaseFlagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSupportedDatabaseFlags( + request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse + ]>; + listSupportedDatabaseFlags( + request: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>): void; + listSupportedDatabaseFlags( + request: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>): void; + listSupportedDatabaseFlags( + request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>): + Promise<[ + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSupportedDatabaseFlags values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSupportedDatabaseFlags request %j', request); + return this.innerApiCalls + .listSupportedDatabaseFlags(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest|null, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse + ]) => { + this._log.info('listSupportedDatabaseFlags values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag|SupportedDatabaseFlag} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSupportedDatabaseFlagsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSupportedDatabaseFlagsStream( + request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSupportedDatabaseFlags stream %j', request); + return this.descriptors.page.listSupportedDatabaseFlags.createStream( + this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSupportedDatabaseFlags`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * 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 {number} request.pageSize + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} [request.scope] + * Optional. The scope for which supported flags are requested. If not + * specified, default is DATABASE. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag|SupportedDatabaseFlag}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async + */ + listSupportedDatabaseFlagsAsync( + request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSupportedDatabaseFlags iterate %j', request); + return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( + this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Users in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.User|User}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsers( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser[], + protos.google.cloud.alloydb.v1beta.IListUsersRequest|null, + protos.google.cloud.alloydb.v1beta.IListUsersResponse + ]>; + listUsers( + request: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IUser>): void; + listUsers( + request: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IUser>): void; + listUsers( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IUser>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IUser>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IUser[], + protos.google.cloud.alloydb.v1beta.IListUsersRequest|null, + protos.google.cloud.alloydb.v1beta.IListUsersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IUser>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUsers request %j', request); + return this.innerApiCalls + .listUsers(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IUser[], + protos.google.cloud.alloydb.v1beta.IListUsersRequest|null, + protos.google.cloud.alloydb.v1beta.IListUsersResponse + ]) => { + this._log.info('listUsers values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUsers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.User|User} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsersStream( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUsers stream %j', request); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListUsersRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1beta.User|User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_users.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async + */ + listUsersAsync( + request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUsers iterate %j', request); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Databases in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Database|Database}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabases( + request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.alloydb.v1beta.IDatabase[], + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse + ]>; + listDatabases( + request: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IDatabase>): void; + listDatabases( + request: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + callback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IDatabase>): void; + listDatabases( + request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IDatabase>, + callback?: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IDatabase>): + Promise<[ + protos.google.cloud.alloydb.v1beta.IDatabase[], + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, + protos.google.cloud.alloydb.v1beta.IDatabase>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IDatabase[], + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest|null, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Database|Database} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatabasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatabasesStream( + request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases stream %j', request); + return this.descriptors.page.listDatabases.createStream( + this.innerApiCalls.listDatabases as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDatabases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListDatabasesRequest. + * @param {number} [request.pageSize] + * 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 {string} [request.pageToken] + * 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 {string} [request.filter] + * Optional. Filtering results. + * This field is currently not supported, its value will be ignored if passed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.alloydb.v1beta.Database|Database}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_admin.list_databases.js + * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async + */ + listDatabasesAsync( + request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDatabases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDatabases iterate %j', request); + return this.descriptors.page.listDatabases.asyncIterate( + this.innerApiCalls['listDatabases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project:string,location:string,cluster:string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified connectionInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + connectionInfoPath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.connectionInfoPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; + } + + /** + * Parse the location from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; + } + + /** + * Parse the cluster from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; + } + + /** + * Parse the instance from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,location:string,cluster:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the location from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).location; + } + + /** + * Parse the cluster from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the cluster from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified supportedDatabaseFlag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} flag + * @returns {string} Resource name string. + */ + supportedDatabaseFlagPath(project:string,location:string,flag:string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ + project: project, + location: location, + flag: flag, + }); + } + + /** + * Parse the project from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; + } + + /** + * Parse the location from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; + } + + /** + * Parse the flag from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the flag. + */ + matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project:string,location:string,cluster:string,user:string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alloyDBAdminStub && !this._terminated) { + return this.alloyDBAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json new file mode 100644 index 00000000000..353aa21106c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json @@ -0,0 +1,228 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1beta.AlloyDBAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpgradeCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PromoteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SwitchoverCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecondaryCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecondaryInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FailoverInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InjectFault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteSql": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSupportedDatabaseFlags": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GenerateClientCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetConnectionInfo": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatabases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json new file mode 100644 index 00000000000..8b640e7d02b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/alloydb/v1beta/csql_resources.proto", + "../../protos/google/cloud/alloydb/v1beta/csql_service.proto", + "../../protos/google/cloud/alloydb/v1beta/data_model.proto", + "../../protos/google/cloud/alloydb/v1beta/gemini.proto", + "../../protos/google/cloud/alloydb/v1beta/resources.proto", + "../../protos/google/cloud/alloydb/v1beta/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts new file mode 100644 index 00000000000..f998ac8f4b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts @@ -0,0 +1,1422 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './alloy_d_b_c_s_q_l_admin_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for interactions with CloudSQL. + * @class + * @memberof v1beta + */ +export class AlloyDBCSQLAdminClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('alloydb'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + alloyDBCSQLAdminStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlloyDBCSQLAdminClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AlloyDBCSQLAdminClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AlloyDBCSQLAdminClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'alloydb.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + connectionInfoPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' + ), + databasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/flags/{flag}' + ), + userPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1beta/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const restoreFromCloudSQLResponse = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; + const restoreFromCloudSQLMetadata = protoFilesRoot.lookup( + '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + restoreFromCloudSQL: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreFromCloudSQLResponse.decode.bind(restoreFromCloudSQLResponse), + restoreFromCloudSQLMetadata.decode.bind(restoreFromCloudSQLMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.alloyDBCSQLAdminStub) { + return this.alloyDBCSQLAdminStub; + } + + // Put together the "service stub" for + // google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin. + this.alloyDBCSQLAdminStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alloyDBCSQLAdminStubMethods = + ['restoreFromCloudSqL']; + for (const methodName of alloyDBCSQLAdminStubMethods) { + const callPromise = this.alloyDBCSQLAdminStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.alloyDBCSQLAdminStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'alloydb.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * Restores an AlloyDB cluster from a CloudSQL resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} request.cloudsqlBackupRunSource + * Cluster created from CloudSQL backup run. + * @param {string} request.parent + * Required. The location of the new cluster. For the required format, see the + * comment on Cluster.name field. + * @param {string} request.clusterId + * Required. ID of the requesting object. + * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster + * Required. The resource being created + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js + * region_tag:alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async + */ + restoreFromCloudSQL( + request?: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreFromCloudSQL( + request: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreFromCloudSQL( + request: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreFromCloudSQL( + request?: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreFromCloudSQL response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreFromCloudSQL request %j', request); + return this.innerApiCalls.restoreFromCloudSqL(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreFromCloudSQL response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreFromCloudSQL()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js + * region_tag:alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async + */ + async checkRestoreFromCloudSQLProgress(name: string): Promise>{ + this._log.info('restoreFromCloudSQL long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreFromCloudSQL, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * 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 + * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * 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`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project:string,location:string,cluster:string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified connectionInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + connectionInfoPath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.connectionInfoPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; + } + + /** + * Parse the location from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; + } + + /** + * Parse the cluster from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; + } + + /** + * Parse the instance from ConnectionInfo resource. + * + * @param {string} connectionInfoName + * A fully-qualified path representing ConnectionInfo resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromConnectionInfoName(connectionInfoName: string) { + return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; + } + + /** + * Return a fully-qualified database resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} database + * @returns {string} Resource name string. + */ + databasePath(project:string,location:string,cluster:string,database:string) { + return this.pathTemplates.databasePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + database: database, + }); + } + + /** + * Parse the project from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).project; + } + + /** + * Parse the location from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).location; + } + + /** + * Parse the cluster from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; + } + + /** + * Parse the database from Database resource. + * + * @param {string} databaseName + * A fully-qualified path representing Database resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromDatabaseName(databaseName: string) { + return this.pathTemplates.databasePathTemplate.match(databaseName).database; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,cluster:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + cluster: cluster, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the cluster from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified supportedDatabaseFlag resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} flag + * @returns {string} Resource name string. + */ + supportedDatabaseFlagPath(project:string,location:string,flag:string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ + project: project, + location: location, + flag: flag, + }); + } + + /** + * Parse the project from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; + } + + /** + * Parse the location from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; + } + + /** + * Parse the flag from SupportedDatabaseFlag resource. + * + * @param {string} supportedDatabaseFlagName + * A fully-qualified path representing SupportedDatabaseFlag resource. + * @returns {string} A string representing the flag. + */ + matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { + return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(project:string,location:string,cluster:string,user:string) { + return this.pathTemplates.userPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + user: user, + }); + } + + /** + * Parse the project from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).project; + } + + /** + * Parse the location from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).location; + } + + /** + * Parse the cluster from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).cluster; + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.alloyDBCSQLAdminStub && !this._terminated) { + return this.alloyDBCSQLAdminStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json new file mode 100644 index 00000000000..8da946a0a96 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "RestoreFromCloudSQL": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json new file mode 100644 index 00000000000..8b640e7d02b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/alloydb/v1beta/csql_resources.proto", + "../../protos/google/cloud/alloydb/v1beta/csql_service.proto", + "../../protos/google/cloud/alloydb/v1beta/data_model.proto", + "../../protos/google/cloud/alloydb/v1beta/gemini.proto", + "../../protos/google/cloud/alloydb/v1beta/resources.proto", + "../../protos/google/cloud/alloydb/v1beta/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..bd4da19419f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json @@ -0,0 +1,451 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.alloydb.v1beta", + "libraryPackage": "@google-cloud/alloydb", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "ExportCluster": { + "methods": [ + "exportCluster" + ] + }, + "ImportCluster": { + "methods": [ + "importCluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgradeCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags", + "listSupportedDatabaseFlagsStream", + "listSupportedDatabaseFlagsAsync" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlloyDBAdminClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generateClientCertificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "getConnectionInfo" + ] + }, + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "ExportCluster": { + "methods": [ + "exportCluster" + ] + }, + "ImportCluster": { + "methods": [ + "importCluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgradeCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restoreCluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "createSecondaryCluster" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "createSecondaryInstance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batchCreateInstances" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "FailoverInstance": { + "methods": [ + "failoverInstance" + ] + }, + "InjectFault": { + "methods": [ + "injectFault" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "listSupportedDatabaseFlags", + "listSupportedDatabaseFlagsStream", + "listSupportedDatabaseFlagsAsync" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] + } + } + } + } + }, + "AlloyDBCSQLAdmin": { + "clients": { + "grpc": { + "libraryClient": "AlloyDBCSQLAdminClient", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restoreFromCloudSQL" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AlloyDBCSQLAdminClient", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restoreFromCloudSQL" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts b/owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts new file mode 100644 index 00000000000..dd5000cd3cb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts @@ -0,0 +1,20 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AlloyDBAdminClient} from './alloy_d_b_admin_client'; +export {AlloyDBCSQLAdminClient} from './alloy_d_b_c_s_q_l_admin_client'; diff --git a/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..601c54db846 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const alloydb = require('@google-cloud/alloydb'); + +function main() { + const alloyDBAdminClient = new alloydb.AlloyDBAdminClient(); + const alloyDBCSQLAdminClient = new alloydb.AlloyDBCSQLAdminClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..a1b508a0e5c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AlloyDBAdminClient, AlloyDBCSQLAdminClient} from '@google-cloud/alloydb'; + +// check that the client class type name can be used +function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { + client.close(); +} +function doStuffWithAlloyDBCSQLAdminClient(client: AlloyDBCSQLAdminClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const alloyDBAdminClient = new AlloyDBAdminClient(); + doStuffWithAlloyDBAdminClient(alloyDBAdminClient); + // check that the client instance can be created + const alloyDBCSQLAdminClient = new AlloyDBCSQLAdminClient(); + doStuffWithAlloyDBCSQLAdminClient(alloyDBCSQLAdminClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts new file mode 100644 index 00000000000..3519b7eefbc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts @@ -0,0 +1,7199 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alloydbadminModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AlloyDBAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = alloydbadminModule.v1.AlloyDBAdminClient.servicePath; + assert.strictEqual(servicePath, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = alloydbadminModule.v1.AlloyDBAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbadminModule.v1.AlloyDBAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new alloydbadminModule.v1.AlloyDBAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = alloydbadminModule.v1.AlloyDBAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBAdminStub, undefined); + await client.initialize(); + assert(client.alloyDBAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.alloyDBAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('executeSql', () => { + it('invokes executeSql without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExecuteSqlResponse() + ); + client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); + const [response] = await client.executeSql(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExecuteSqlResponse() + ); + client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeSql( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IExecuteSqlResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeSql(request), expectedError); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeSql(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IBackup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('generateClientCertificate', () => { + it('invokes generateClientCertificate without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse() + ); + client.innerApiCalls.generateClientCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.generateClientCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse() + ); + client.innerApiCalls.generateClientCertificate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateClientCertificate( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateClientCertificate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.generateClientCertificate(request), expectedError); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.generateClientCertificate(request), expectedError); + }); + }); + + describe('getConnectionInfo', () => { + it('invokes getConnectionInfo without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ConnectionInfo() + ); + client.innerApiCalls.getConnectionInfo = stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionInfo(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ConnectionInfo() + ); + client.innerApiCalls.getConnectionInfo = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionInfo( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IConnectionInfo|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionInfo = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConnectionInfo(request), expectedError); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConnectionInfo(request), expectedError); + }); + }); + + describe('getUser', () => { + it('invokes getUser without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() + ); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() + ); + client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() + ); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() + ); + client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createUser(request), expectedError); + }); + }); + + describe('updateUser', () => { + it('invokes updateUser without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() + ); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1.User() + ); + client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUser(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with closed client', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportCluster', () => { + it('invokes exportCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importCluster', () => { + it('invokes importCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.importCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('upgradeCluster', () => { + it('invokes upgradeCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.upgradeCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.upgradeCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgradeClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpgradeClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpgradeClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpgradeClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('promoteCluster', () => { + it('invokes promoteCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.promoteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.promoteCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.promoteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.promoteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPromoteClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPromoteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPromoteClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPromoteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('switchoverCluster', () => { + it('invokes switchoverCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.switchoverCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.switchoverCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.switchoverCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.switchoverCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.switchoverCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSwitchoverClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkSwitchoverClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSwitchoverClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkSwitchoverClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecondaryCluster', () => { + it('invokes createSecondaryCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecondaryCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecondaryCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecondaryCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecondaryCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecondaryClusterProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecondaryClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecondaryClusterProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecondaryClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecondaryInstance', () => { + it('invokes createSecondaryInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecondaryInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecondaryInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecondaryInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecondaryInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecondaryInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecondaryInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecondaryInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecondaryInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchCreateInstances', () => { + it('invokes batchCreateInstances without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateInstances(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateInstances( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateInstances(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchCreateInstancesProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchCreateInstancesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateInstancesProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchCreateInstancesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('failoverInstance', () => { + it('invokes failoverInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.failoverInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.failoverInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.failoverInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.failoverInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkFailoverInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkFailoverInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkFailoverInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkFailoverInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('injectFault', () => { + it('invokes injectFault without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); + const [operation] = await client.injectFault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.injectFault( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.injectFault(request), expectedError); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.injectFault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInjectFaultProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkInjectFaultProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInjectFaultProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkInjectFaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.ICluster[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), + ]; + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IBackup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + ]; + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSupportedDatabaseFlags', () => { + it('invokes listSupportedDatabaseFlags without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + ]; + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(expectedResponse); + const [response] = await client.listSupportedDatabaseFlags(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlags without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + ]; + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSupportedDatabaseFlags( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlags with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSupportedDatabaseFlags(request), expectedError); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlagsStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + ]; + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSupportedDatabaseFlagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSupportedDatabaseFlagsStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSupportedDatabaseFlagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSupportedDatabaseFlags without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), + ]; + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = []; + const iterable = client.listSupportedDatabaseFlagsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSupportedDatabaseFlags with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSupportedDatabaseFlagsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUsers', () => { + it('invokes listUsers without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsers( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsersStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + ]; + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsersStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), + ]; + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.IUser[] = []; + const iterable = client.listUsersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.IUser[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDatabases', () => { + it('invokes listDatabases without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); + const [response] = await client.listDatabases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatabases( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IDatabase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatabases(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabasesStream without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + ]; + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Database[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatabasesStream with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1.Database[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), + ]; + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1.IDatabase[] = []; + const iterable = client.listDatabasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatabasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1.IDatabase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup: "backupValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cluster', async () => { + const fakePath = "/rendered/path/cluster"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('connectionInfo', async () => { + const fakePath = "/rendered/path/connectionInfo"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.connectionInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionInfoPath', () => { + const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionInfoName', () => { + const result = client.matchProjectFromConnectionInfoName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionInfoName', () => { + const result = client.matchLocationFromConnectionInfoName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromConnectionInfoName', () => { + const result = client.matchClusterFromConnectionInfoName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromConnectionInfoName', () => { + const result = client.matchInstanceFromConnectionInfoName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + database: "databaseValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatabaseName', () => { + const result = client.matchLocationFromDatabaseName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromDatabaseName', () => { + const result = client.matchClusterFromDatabaseName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromInstanceName', () => { + const result = client.matchClusterFromInstanceName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('supportedDatabaseFlag', async () => { + const fakePath = "/rendered/path/supportedDatabaseFlag"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + flag: "flagValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.supportedDatabaseFlagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.supportedDatabaseFlagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('supportedDatabaseFlagPath', () => { + const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSupportedDatabaseFlagName', () => { + const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSupportedDatabaseFlagName', () => { + const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFlagFromSupportedDatabaseFlagName', () => { + const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "flagValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('user', async () => { + const fakePath = "/rendered/path/user"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + user: "userValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts new file mode 100644 index 00000000000..76aa6227cde --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts @@ -0,0 +1,7307 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alloydbadminModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.AlloyDBAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = alloydbadminModule.v1alpha.AlloyDBAdminClient.servicePath; + assert.strictEqual(servicePath, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = alloydbadminModule.v1alpha.AlloyDBAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new alloydbadminModule.v1alpha.AlloyDBAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = alloydbadminModule.v1alpha.AlloyDBAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBAdminStub, undefined); + await client.initialize(); + assert(client.alloyDBAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.alloyDBAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('executeSql', () => { + it('invokes executeSql without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse() + ); + client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); + const [response] = await client.executeSql(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse() + ); + client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeSql( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeSql(request), expectedError); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeSql(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IBackup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('generateClientCertificate', () => { + it('invokes generateClientCertificate without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse() + ); + client.innerApiCalls.generateClientCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.generateClientCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse() + ); + client.innerApiCalls.generateClientCertificate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateClientCertificate( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateClientCertificate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.generateClientCertificate(request), expectedError); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.generateClientCertificate(request), expectedError); + }); + }); + + describe('getConnectionInfo', () => { + it('invokes getConnectionInfo without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ConnectionInfo() + ); + client.innerApiCalls.getConnectionInfo = stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionInfo(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ConnectionInfo() + ); + client.innerApiCalls.getConnectionInfo = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionInfo( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IConnectionInfo|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionInfo = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConnectionInfo(request), expectedError); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConnectionInfo(request), expectedError); + }); + }); + + describe('getUser', () => { + it('invokes getUser without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() + ); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() + ); + client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() + ); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() + ); + client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createUser(request), expectedError); + }); + }); + + describe('updateUser', () => { + it('invokes updateUser without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() + ); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.User() + ); + client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUser(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('createDatabase', () => { + it('invokes createDatabase without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Database() + ); + client.innerApiCalls.createDatabase = stubSimpleCall(expectedResponse); + const [response] = await client.createDatabase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.Database() + ); + client.innerApiCalls.createDatabase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDatabase( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IDatabase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDatabase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase with closed client', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDatabase(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportCluster', () => { + it('invokes exportCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importCluster', () => { + it('invokes importCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.importCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('upgradeCluster', () => { + it('invokes upgradeCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.upgradeCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.upgradeCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgradeClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpgradeClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpgradeClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpgradeClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('promoteCluster', () => { + it('invokes promoteCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.promoteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.promoteCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.promoteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.promoteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPromoteClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPromoteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPromoteClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPromoteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('switchoverCluster', () => { + it('invokes switchoverCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.switchoverCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.switchoverCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.switchoverCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.switchoverCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.switchoverCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSwitchoverClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkSwitchoverClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSwitchoverClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkSwitchoverClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecondaryCluster', () => { + it('invokes createSecondaryCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecondaryCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecondaryCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecondaryCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecondaryCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecondaryClusterProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecondaryClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecondaryClusterProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecondaryClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecondaryInstance', () => { + it('invokes createSecondaryInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecondaryInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecondaryInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecondaryInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecondaryInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecondaryInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecondaryInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecondaryInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecondaryInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchCreateInstances', () => { + it('invokes batchCreateInstances without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateInstances(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateInstances( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateInstances(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchCreateInstancesProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchCreateInstancesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateInstancesProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchCreateInstancesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('failoverInstance', () => { + it('invokes failoverInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.failoverInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.failoverInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.failoverInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.failoverInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkFailoverInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkFailoverInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkFailoverInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkFailoverInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('injectFault', () => { + it('invokes injectFault without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); + const [operation] = await client.injectFault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.injectFault( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.injectFault(request), expectedError); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.injectFault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInjectFaultProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkInjectFaultProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInjectFaultProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkInjectFaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.ICluster[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + ]; + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), + ]; + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IBackup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + ]; + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSupportedDatabaseFlags', () => { + it('invokes listSupportedDatabaseFlags without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + ]; + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(expectedResponse); + const [response] = await client.listSupportedDatabaseFlags(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlags without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + ]; + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSupportedDatabaseFlags( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlags with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSupportedDatabaseFlags(request), expectedError); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlagsStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + ]; + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSupportedDatabaseFlagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSupportedDatabaseFlagsStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSupportedDatabaseFlagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSupportedDatabaseFlags without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), + ]; + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = []; + const iterable = client.listSupportedDatabaseFlagsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSupportedDatabaseFlags with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSupportedDatabaseFlagsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUsers', () => { + it('invokes listUsers without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsers( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsersStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + ]; + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsersStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), + ]; + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.IUser[] = []; + const iterable = client.listUsersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.IUser[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDatabases', () => { + it('invokes listDatabases without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); + const [response] = await client.listDatabases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatabases( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IDatabase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatabases(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabasesStream without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + ]; + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Database[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatabasesStream with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1alpha.Database[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), + ]; + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1alpha.IDatabase[] = []; + const iterable = client.listDatabasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatabasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1alpha.IDatabase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup: "backupValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cluster', async () => { + const fakePath = "/rendered/path/cluster"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('connectionInfo', async () => { + const fakePath = "/rendered/path/connectionInfo"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.connectionInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionInfoPath', () => { + const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionInfoName', () => { + const result = client.matchProjectFromConnectionInfoName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionInfoName', () => { + const result = client.matchLocationFromConnectionInfoName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromConnectionInfoName', () => { + const result = client.matchClusterFromConnectionInfoName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromConnectionInfoName', () => { + const result = client.matchInstanceFromConnectionInfoName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + database: "databaseValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatabaseName', () => { + const result = client.matchLocationFromDatabaseName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromDatabaseName', () => { + const result = client.matchClusterFromDatabaseName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromInstanceName', () => { + const result = client.matchClusterFromInstanceName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('supportedDatabaseFlag', async () => { + const fakePath = "/rendered/path/supportedDatabaseFlag"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + flag: "flagValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.supportedDatabaseFlagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.supportedDatabaseFlagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('supportedDatabaseFlagPath', () => { + const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSupportedDatabaseFlagName', () => { + const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSupportedDatabaseFlagName', () => { + const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFlagFromSupportedDatabaseFlagName', () => { + const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "flagValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('user', async () => { + const fakePath = "/rendered/path/user"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + user: "userValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts new file mode 100644 index 00000000000..4e5ce268f3c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts @@ -0,0 +1,7307 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alloydbadminModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.AlloyDBAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = alloydbadminModule.v1beta.AlloyDBAdminClient.servicePath; + assert.strictEqual(servicePath, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = alloydbadminModule.v1beta.AlloyDBAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new alloydbadminModule.v1beta.AlloyDBAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = alloydbadminModule.v1beta.AlloyDBAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBAdminStub, undefined); + await client.initialize(); + assert(client.alloyDBAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.alloyDBAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('executeSql', () => { + it('invokes executeSql without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse() + ); + client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); + const [response] = await client.executeSql(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse() + ); + client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.executeSql( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.executeSql(request), expectedError); + const actualRequest = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes executeSql with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); + request.instance = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.executeSql(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IBackup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('generateClientCertificate', () => { + it('invokes generateClientCertificate without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse() + ); + client.innerApiCalls.generateClientCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.generateClientCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse() + ); + client.innerApiCalls.generateClientCertificate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateClientCertificate( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateClientCertificate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.generateClientCertificate(request), expectedError); + const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateClientCertificate with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.generateClientCertificate(request), expectedError); + }); + }); + + describe('getConnectionInfo', () => { + it('invokes getConnectionInfo without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ConnectionInfo() + ); + client.innerApiCalls.getConnectionInfo = stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionInfo(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ConnectionInfo() + ); + client.innerApiCalls.getConnectionInfo = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionInfo( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IConnectionInfo|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionInfo = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConnectionInfo(request), expectedError); + const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionInfo with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getConnectionInfo(request), expectedError); + }); + }); + + describe('getUser', () => { + it('invokes getUser without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() + ); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() + ); + client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() + ); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() + ); + client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createUser(request), expectedError); + }); + }); + + describe('updateUser', () => { + it('invokes updateUser without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() + ); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.User() + ); + client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUser( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUser(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('createDatabase', () => { + it('invokes createDatabase without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Database() + ); + client.innerApiCalls.createDatabase = stubSimpleCall(expectedResponse); + const [response] = await client.createDatabase(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.Database() + ); + client.innerApiCalls.createDatabase = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDatabase( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IDatabase|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDatabase = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDatabase(request), expectedError); + const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatabase with closed client', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDatabase(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportCluster', () => { + it('invokes exportCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importCluster', () => { + it('invokes importCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.importCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkImportClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('upgradeCluster', () => { + it('invokes upgradeCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.upgradeCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.upgradeCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgradeClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpgradeClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpgradeClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpgradeClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('promoteCluster', () => { + it('invokes promoteCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.promoteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.promoteCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.promoteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.promoteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPromoteClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPromoteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPromoteClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkPromoteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('switchoverCluster', () => { + it('invokes switchoverCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.switchoverCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.switchoverCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.switchoverCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.switchoverCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes switchoverCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.switchoverCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSwitchoverClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkSwitchoverClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSwitchoverClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkSwitchoverClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecondaryCluster', () => { + it('invokes createSecondaryCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecondaryCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecondaryCluster( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecondaryCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryCluster with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecondaryCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecondaryClusterProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecondaryClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecondaryClusterProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecondaryClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecondaryInstance', () => { + it('invokes createSecondaryInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecondaryInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecondaryInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecondaryInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecondaryInstance with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecondaryInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecondaryInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecondaryInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecondaryInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecondaryInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchCreateInstances', () => { + it('invokes batchCreateInstances without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchCreateInstances(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateInstances( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateInstances with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateInstances(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchCreateInstancesProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBatchCreateInstancesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchCreateInstancesProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBatchCreateInstancesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('failoverInstance', () => { + it('invokes failoverInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.failoverInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.failoverInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.failoverInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes failoverInstance with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.failoverInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkFailoverInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkFailoverInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkFailoverInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkFailoverInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('injectFault', () => { + it('invokes injectFault without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); + const [operation] = await client.injectFault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.injectFault( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.injectFault(request), expectedError); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes injectFault with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.injectFault = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.injectFault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInjectFaultProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkInjectFaultProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInjectFaultProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkInjectFaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.ICluster[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), + ]; + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IBackup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + ]; + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSupportedDatabaseFlags', () => { + it('invokes listSupportedDatabaseFlags without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + ]; + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(expectedResponse); + const [response] = await client.listSupportedDatabaseFlags(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlags without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + ]; + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSupportedDatabaseFlags( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlags with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSupportedDatabaseFlags(request), expectedError); + const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSupportedDatabaseFlagsStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + ]; + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSupportedDatabaseFlagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSupportedDatabaseFlagsStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSupportedDatabaseFlagsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSupportedDatabaseFlags without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), + ]; + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = []; + const iterable = client.listSupportedDatabaseFlagsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSupportedDatabaseFlags with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSupportedDatabaseFlagsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUsers', () => { + it('invokes listUsers without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsers( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsersStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + ]; + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsersStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.User[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), + ]; + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.IUser[] = []; + const iterable = client.listUsersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.IUser[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDatabases', () => { + it('invokes listDatabases without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); + const [response] = await client.listDatabases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + ]; + client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatabases( + request, + (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IDatabase[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabases with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatabases(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatabasesStream without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + ]; + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Database[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatabasesStream with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatabasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.alloydb.v1beta.Database[] = []; + stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Database) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); + assert( + (client.descriptors.page.listDatabases.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), + ]; + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.alloydb.v1beta.IDatabase[] = []; + const iterable = client.listDatabasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatabases with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatabasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.alloydb.v1beta.IDatabase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDatabases.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup: "backupValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cluster', async () => { + const fakePath = "/rendered/path/cluster"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('connectionInfo', async () => { + const fakePath = "/rendered/path/connectionInfo"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.connectionInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionInfoPath', () => { + const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionInfoName', () => { + const result = client.matchProjectFromConnectionInfoName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionInfoName', () => { + const result = client.matchLocationFromConnectionInfoName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromConnectionInfoName', () => { + const result = client.matchClusterFromConnectionInfoName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromConnectionInfoName', () => { + const result = client.matchInstanceFromConnectionInfoName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + database: "databaseValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatabaseName', () => { + const result = client.matchLocationFromDatabaseName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromDatabaseName', () => { + const result = client.matchClusterFromDatabaseName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromInstanceName', () => { + const result = client.matchClusterFromInstanceName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('supportedDatabaseFlag', async () => { + const fakePath = "/rendered/path/supportedDatabaseFlag"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + flag: "flagValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.supportedDatabaseFlagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.supportedDatabaseFlagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('supportedDatabaseFlagPath', () => { + const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSupportedDatabaseFlagName', () => { + const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSupportedDatabaseFlagName', () => { + const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFlagFromSupportedDatabaseFlagName', () => { + const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "flagValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('user', async () => { + const fakePath = "/rendered/path/user"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + user: "userValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts new file mode 100644 index 00000000000..bba7f6897e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts @@ -0,0 +1,1522 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alloydbcsqladminModule from '../src'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AlloyDBCSQLAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient.servicePath; + assert.strictEqual(servicePath, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); + await client.initialize(); + assert(client.alloyDBCSQLAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.alloyDBCSQLAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('restoreFromCloudSQL', () => { + it('invokes restoreFromCloudSQL without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreFromCloudSQL(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreFromCloudSQL( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL with call error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreFromCloudSQL(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL with LRO error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreFromCloudSQL(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreFromCloudSQLProgress without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreFromCloudSQLProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreFromCloudSQLProgress with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreFromCloudSQLProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup: "backupValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cluster', async () => { + const fakePath = "/rendered/path/cluster"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('connectionInfo', async () => { + const fakePath = "/rendered/path/connectionInfo"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.connectionInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionInfoPath', () => { + const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionInfoName', () => { + const result = client.matchProjectFromConnectionInfoName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionInfoName', () => { + const result = client.matchLocationFromConnectionInfoName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromConnectionInfoName', () => { + const result = client.matchClusterFromConnectionInfoName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromConnectionInfoName', () => { + const result = client.matchInstanceFromConnectionInfoName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + database: "databaseValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatabaseName', () => { + const result = client.matchLocationFromDatabaseName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromDatabaseName', () => { + const result = client.matchClusterFromDatabaseName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromInstanceName', () => { + const result = client.matchClusterFromInstanceName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('supportedDatabaseFlag', async () => { + const fakePath = "/rendered/path/supportedDatabaseFlag"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + flag: "flagValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.supportedDatabaseFlagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.supportedDatabaseFlagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('supportedDatabaseFlagPath', () => { + const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSupportedDatabaseFlagName', () => { + const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSupportedDatabaseFlagName', () => { + const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFlagFromSupportedDatabaseFlagName', () => { + const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "flagValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('user', async () => { + const fakePath = "/rendered/path/user"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + user: "userValue", + }; + const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts new file mode 100644 index 00000000000..81760b330d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts @@ -0,0 +1,1522 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alloydbcsqladminModule from '../src'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.AlloyDBCSQLAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient.servicePath; + assert.strictEqual(servicePath, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); + await client.initialize(); + assert(client.alloyDBCSQLAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.alloyDBCSQLAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('restoreFromCloudSQL', () => { + it('invokes restoreFromCloudSQL without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreFromCloudSQL(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreFromCloudSQL( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL with call error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreFromCloudSQL(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL with LRO error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreFromCloudSQL(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreFromCloudSQLProgress without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreFromCloudSQLProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreFromCloudSQLProgress with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreFromCloudSQLProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup: "backupValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cluster', async () => { + const fakePath = "/rendered/path/cluster"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('connectionInfo', async () => { + const fakePath = "/rendered/path/connectionInfo"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.connectionInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionInfoPath', () => { + const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionInfoName', () => { + const result = client.matchProjectFromConnectionInfoName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionInfoName', () => { + const result = client.matchLocationFromConnectionInfoName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromConnectionInfoName', () => { + const result = client.matchClusterFromConnectionInfoName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromConnectionInfoName', () => { + const result = client.matchInstanceFromConnectionInfoName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + database: "databaseValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatabaseName', () => { + const result = client.matchLocationFromDatabaseName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromDatabaseName', () => { + const result = client.matchClusterFromDatabaseName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromInstanceName', () => { + const result = client.matchClusterFromInstanceName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('supportedDatabaseFlag', async () => { + const fakePath = "/rendered/path/supportedDatabaseFlag"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + flag: "flagValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.supportedDatabaseFlagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.supportedDatabaseFlagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('supportedDatabaseFlagPath', () => { + const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSupportedDatabaseFlagName', () => { + const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSupportedDatabaseFlagName', () => { + const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFlagFromSupportedDatabaseFlagName', () => { + const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "flagValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('user', async () => { + const fakePath = "/rendered/path/user"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + user: "userValue", + }; + const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts new file mode 100644 index 00000000000..f1da9d89fc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts @@ -0,0 +1,1522 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as alloydbcsqladminModule from '../src'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.AlloyDBCSQLAdminClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient.servicePath; + assert.strictEqual(servicePath, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'alloydb.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); + await client.initialize(); + assert(client.alloyDBCSQLAdminStub); + }); + + it('has close method for the initialized client', done => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.alloyDBCSQLAdminStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('restoreFromCloudSQL', () => { + it('invokes restoreFromCloudSQL without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreFromCloudSQL(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreFromCloudSQL( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL with call error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreFromCloudSQL(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreFromCloudSQL with LRO error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreFromCloudSQL(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreFromCloudSQLProgress without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestoreFromCloudSQLProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreFromCloudSQLProgress with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRestoreFromCloudSQLProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup: "backupValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cluster', async () => { + const fakePath = "/rendered/path/cluster"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('connectionInfo', async () => { + const fakePath = "/rendered/path/connectionInfo"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.connectionInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionInfoPath', () => { + const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionInfoName', () => { + const result = client.matchProjectFromConnectionInfoName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionInfoName', () => { + const result = client.matchLocationFromConnectionInfoName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromConnectionInfoName', () => { + const result = client.matchClusterFromConnectionInfoName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromConnectionInfoName', () => { + const result = client.matchInstanceFromConnectionInfoName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('database', async () => { + const fakePath = "/rendered/path/database"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + database: "databaseValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.databasePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.databasePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('databasePath', () => { + const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.databasePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatabaseName', () => { + const result = client.matchProjectFromDatabaseName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatabaseName', () => { + const result = client.matchLocationFromDatabaseName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromDatabaseName', () => { + const result = client.matchClusterFromDatabaseName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatabaseFromDatabaseName', () => { + const result = client.matchDatabaseFromDatabaseName(fakePath); + assert.strictEqual(result, "databaseValue"); + assert((client.pathTemplates.databasePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + instance: "instanceValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromInstanceName', () => { + const result = client.matchClusterFromInstanceName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('supportedDatabaseFlag', async () => { + const fakePath = "/rendered/path/supportedDatabaseFlag"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + flag: "flagValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.supportedDatabaseFlagPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.supportedDatabaseFlagPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('supportedDatabaseFlagPath', () => { + const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSupportedDatabaseFlagName', () => { + const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSupportedDatabaseFlagName', () => { + const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFlagFromSupportedDatabaseFlagName', () => { + const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); + assert.strictEqual(result, "flagValue"); + assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('user', async () => { + const fakePath = "/rendered/path/user"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + cluster: "clusterValue", + user: "userValue", + }; + const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.userPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.userPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUserName', () => { + const result = client.matchProjectFromUserName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUserName', () => { + const result = client.matchLocationFromUserName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromUserName', () => { + const result = client.matchClusterFromUserName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, "userValue"); + assert((client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-alloydb/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/webpack.config.js new file mode 100644 index 00000000000..ee88fe6afc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AlloyDBAdmin', + filename: './alloy-d-b-admin.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From aa4ab1cc7dc7d2ec64f474b9f88afc1c8fd78ac9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 3 Mar 2026 21:35:20 +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 --- .../google-cloud-alloydb/.eslintignore | 7 - .../google-cloud-alloydb/.eslintrc.json | 3 - .../google-cloud-alloydb/.gitattributes | 4 - .../google-cloud-alloydb/.gitignore | 14 - .../google-cloud-alloydb/.jsdoc.js | 55 - .../google-cloud-alloydb/.mocharc.js | 33 - owl-bot-staging/google-cloud-alloydb/.nycrc | 24 - .../google-cloud-alloydb/.prettierignore | 6 - .../google-cloud-alloydb/.prettierrc.js | 22 - .../google-cloud-alloydb/CODE_OF_CONDUCT.md | 94 - .../google-cloud-alloydb/CONTRIBUTING.md | 76 - owl-bot-staging/google-cloud-alloydb/LICENSE | 202 - .../google-cloud-alloydb/README.md | 232 - .../cloud/alloydb/v1/csql_resources.proto | 40 - .../cloud/alloydb/v1/csql_service.proto | 79 - .../google/cloud/alloydb/v1/data_model.proto | 62 - .../google/cloud/alloydb/v1/resources.proto | 1718 - .../google/cloud/alloydb/v1/service.proto | 2234 - .../alloydb/v1alpha/csql_resources.proto | 40 - .../cloud/alloydb/v1alpha/csql_service.proto | 79 - .../cloud/alloydb/v1alpha/data_model.proto | 62 - .../google/cloud/alloydb/v1alpha/gemini.proto | 60 - .../cloud/alloydb/v1alpha/resources.proto | 1795 - .../cloud/alloydb/v1alpha/service.proto | 2305 - .../cloud/alloydb/v1beta/csql_resources.proto | 40 - .../cloud/alloydb/v1beta/csql_service.proto | 79 - .../cloud/alloydb/v1beta/data_model.proto | 62 - .../google/cloud/alloydb/v1beta/gemini.proto | 60 - .../cloud/alloydb/v1beta/resources.proto | 1786 - .../google/cloud/alloydb/v1beta/service.proto | 2305 - .../google-cloud-alloydb/protos/protos.d.ts | 54745 ------ .../google-cloud-alloydb/protos/protos.js | 142445 --------------- .../google-cloud-alloydb/protos/protos.json | 17399 -- .../alloy_d_b_admin.batch_create_instances.js | 81 - .../v1/alloy_d_b_admin.create_backup.js | 91 - .../v1/alloy_d_b_admin.create_cluster.js | 93 - .../v1/alloy_d_b_admin.create_instance.js | 93 - ...lloy_d_b_admin.create_secondary_cluster.js | 93 - ...loy_d_b_admin.create_secondary_instance.js | 93 - .../v1/alloy_d_b_admin.create_user.js | 90 - .../v1/alloy_d_b_admin.delete_backup.js | 88 - .../v1/alloy_d_b_admin.delete_cluster.js | 93 - .../v1/alloy_d_b_admin.delete_instance.js | 89 - .../v1/alloy_d_b_admin.delete_user.js | 81 - .../v1/alloy_d_b_admin.execute_sql.js | 90 - .../v1/alloy_d_b_admin.export_cluster.js | 84 - .../v1/alloy_d_b_admin.failover_instance.js | 83 - ...y_d_b_admin.generate_client_certificate.js | 94 - .../v1/alloy_d_b_admin.get_backup.js | 61 - .../v1/alloy_d_b_admin.get_cluster.js | 67 - .../v1/alloy_d_b_admin.get_connection_info.js | 76 - .../v1/alloy_d_b_admin.get_instance.js | 66 - .../generated/v1/alloy_d_b_admin.get_user.js | 62 - .../v1/alloy_d_b_admin.import_cluster.js | 91 - .../v1/alloy_d_b_admin.inject_fault.js | 88 - .../v1/alloy_d_b_admin.list_backups.js | 80 - .../v1/alloy_d_b_admin.list_clusters.js | 83 - .../v1/alloy_d_b_admin.list_databases.js | 81 - .../v1/alloy_d_b_admin.list_instances.js | 85 - ...d_b_admin.list_supported_database_flags.js | 82 - .../v1/alloy_d_b_admin.list_users.js | 80 - .../v1/alloy_d_b_admin.promote_cluster.js | 89 - .../v1/alloy_d_b_admin.restart_instance.js | 88 - .../v1/alloy_d_b_admin.restore_cluster.js | 102 - .../v1/alloy_d_b_admin.switchover_cluster.js | 83 - .../v1/alloy_d_b_admin.update_backup.js | 94 - .../v1/alloy_d_b_admin.update_cluster.js | 95 - .../v1/alloy_d_b_admin.update_instance.js | 95 - .../v1/alloy_d_b_admin.update_user.js | 92 - .../v1/alloy_d_b_admin.upgrade_cluster.js | 93 - ..._c_s_q_l_admin.restore_from_cloud_s_q_l.js | 77 - ...ppet_metadata_google.cloud.alloydb.v1.json | 2027 - .../alloy_d_b_admin.batch_create_instances.js | 81 - .../v1alpha/alloy_d_b_admin.create_backup.js | 91 - .../v1alpha/alloy_d_b_admin.create_cluster.js | 93 - .../alloy_d_b_admin.create_database.js | 71 - .../alloy_d_b_admin.create_instance.js | 93 - ...lloy_d_b_admin.create_secondary_cluster.js | 93 - ...loy_d_b_admin.create_secondary_instance.js | 93 - .../v1alpha/alloy_d_b_admin.create_user.js | 90 - .../v1alpha/alloy_d_b_admin.delete_backup.js | 88 - .../v1alpha/alloy_d_b_admin.delete_cluster.js | 93 - .../alloy_d_b_admin.delete_instance.js | 89 - .../v1alpha/alloy_d_b_admin.delete_user.js | 81 - .../v1alpha/alloy_d_b_admin.execute_sql.js | 91 - .../v1alpha/alloy_d_b_admin.export_cluster.js | 84 - .../alloy_d_b_admin.failover_instance.js | 83 - ...y_d_b_admin.generate_client_certificate.js | 99 - .../v1alpha/alloy_d_b_admin.get_backup.js | 61 - .../v1alpha/alloy_d_b_admin.get_cluster.js | 67 - .../alloy_d_b_admin.get_connection_info.js | 76 - .../v1alpha/alloy_d_b_admin.get_instance.js | 66 - .../v1alpha/alloy_d_b_admin.get_user.js | 62 - .../v1alpha/alloy_d_b_admin.import_cluster.js | 91 - .../v1alpha/alloy_d_b_admin.inject_fault.js | 88 - .../v1alpha/alloy_d_b_admin.list_backups.js | 80 - .../v1alpha/alloy_d_b_admin.list_clusters.js | 83 - .../v1alpha/alloy_d_b_admin.list_databases.js | 81 - .../v1alpha/alloy_d_b_admin.list_instances.js | 85 - ...d_b_admin.list_supported_database_flags.js | 82 - .../v1alpha/alloy_d_b_admin.list_users.js | 80 - .../alloy_d_b_admin.promote_cluster.js | 89 - .../alloy_d_b_admin.restart_instance.js | 88 - .../alloy_d_b_admin.restore_cluster.js | 102 - .../alloy_d_b_admin.switchover_cluster.js | 83 - .../v1alpha/alloy_d_b_admin.update_backup.js | 94 - .../v1alpha/alloy_d_b_admin.update_cluster.js | 95 - .../alloy_d_b_admin.update_instance.js | 95 - .../v1alpha/alloy_d_b_admin.update_user.js | 92 - .../alloy_d_b_admin.upgrade_cluster.js | 93 - ..._c_s_q_l_admin.restore_from_cloud_s_q_l.js | 77 - ...metadata_google.cloud.alloydb.v1alpha.json | 2079 - .../alloy_d_b_admin.batch_create_instances.js | 81 - .../v1beta/alloy_d_b_admin.create_backup.js | 91 - .../v1beta/alloy_d_b_admin.create_cluster.js | 93 - .../v1beta/alloy_d_b_admin.create_database.js | 71 - .../v1beta/alloy_d_b_admin.create_instance.js | 93 - ...lloy_d_b_admin.create_secondary_cluster.js | 93 - ...loy_d_b_admin.create_secondary_instance.js | 93 - .../v1beta/alloy_d_b_admin.create_user.js | 90 - .../v1beta/alloy_d_b_admin.delete_backup.js | 88 - .../v1beta/alloy_d_b_admin.delete_cluster.js | 93 - .../v1beta/alloy_d_b_admin.delete_instance.js | 89 - .../v1beta/alloy_d_b_admin.delete_user.js | 81 - .../v1beta/alloy_d_b_admin.execute_sql.js | 91 - .../v1beta/alloy_d_b_admin.export_cluster.js | 84 - .../alloy_d_b_admin.failover_instance.js | 83 - ...y_d_b_admin.generate_client_certificate.js | 99 - .../v1beta/alloy_d_b_admin.get_backup.js | 61 - .../v1beta/alloy_d_b_admin.get_cluster.js | 67 - .../alloy_d_b_admin.get_connection_info.js | 76 - .../v1beta/alloy_d_b_admin.get_instance.js | 66 - .../v1beta/alloy_d_b_admin.get_user.js | 62 - .../v1beta/alloy_d_b_admin.import_cluster.js | 91 - .../v1beta/alloy_d_b_admin.inject_fault.js | 88 - .../v1beta/alloy_d_b_admin.list_backups.js | 80 - .../v1beta/alloy_d_b_admin.list_clusters.js | 83 - .../v1beta/alloy_d_b_admin.list_databases.js | 81 - .../v1beta/alloy_d_b_admin.list_instances.js | 85 - ...d_b_admin.list_supported_database_flags.js | 82 - .../v1beta/alloy_d_b_admin.list_users.js | 80 - .../v1beta/alloy_d_b_admin.promote_cluster.js | 89 - .../alloy_d_b_admin.restart_instance.js | 88 - .../v1beta/alloy_d_b_admin.restore_cluster.js | 102 - .../alloy_d_b_admin.switchover_cluster.js | 83 - .../v1beta/alloy_d_b_admin.update_backup.js | 94 - .../v1beta/alloy_d_b_admin.update_cluster.js | 95 - .../v1beta/alloy_d_b_admin.update_instance.js | 95 - .../v1beta/alloy_d_b_admin.update_user.js | 92 - .../v1beta/alloy_d_b_admin.upgrade_cluster.js | 93 - ..._c_s_q_l_admin.restore_from_cloud_s_q_l.js | 77 - ..._metadata_google.cloud.alloydb.v1beta.json | 2079 - .../google-cloud-alloydb/src/index.ts | 31 - .../src/v1/alloy_d_b_admin_client.ts | 6582 - .../src/v1/alloy_d_b_admin_client_config.json | 223 - .../src/v1/alloy_d_b_admin_proto_list.json | 7 - .../src/v1/alloy_d_b_c_s_q_l_admin_client.ts | 1422 - ...alloy_d_b_c_s_q_l_admin_client_config.json | 30 - .../alloy_d_b_c_s_q_l_admin_proto_list.json | 7 - .../src/v1/gapic_metadata.json | 441 - .../google-cloud-alloydb/src/v1/index.ts | 20 - .../src/v1alpha/alloy_d_b_admin_client.ts | 6683 - .../alloy_d_b_admin_client_config.json | 228 - .../v1alpha/alloy_d_b_admin_proto_list.json | 8 - .../v1alpha/alloy_d_b_c_s_q_l_admin_client.ts | 1422 - ...alloy_d_b_c_s_q_l_admin_client_config.json | 30 - .../alloy_d_b_c_s_q_l_admin_proto_list.json | 8 - .../src/v1alpha/gapic_metadata.json | 451 - .../google-cloud-alloydb/src/v1alpha/index.ts | 20 - .../src/v1beta/alloy_d_b_admin_client.ts | 6683 - .../v1beta/alloy_d_b_admin_client_config.json | 228 - .../v1beta/alloy_d_b_admin_proto_list.json | 8 - .../v1beta/alloy_d_b_c_s_q_l_admin_client.ts | 1422 - ...alloy_d_b_c_s_q_l_admin_client_config.json | 30 - .../alloy_d_b_c_s_q_l_admin_proto_list.json | 8 - .../src/v1beta/gapic_metadata.json | 451 - .../google-cloud-alloydb/src/v1beta/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - .../system-test/install.ts | 49 - .../test/gapic_alloy_d_b_admin_v1.ts | 7199 - .../test/gapic_alloy_d_b_admin_v1alpha.ts | 7307 - .../test/gapic_alloy_d_b_admin_v1beta.ts | 7307 - .../test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts | 1522 - .../gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts | 1522 - .../gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts | 1522 - .../google-cloud-alloydb/tsconfig.json | 22 - .../google-cloud-alloydb/webpack.config.js | 64 - .../google/cloud/alloydb/v1/resources.proto | 11 + .../cloud/alloydb/v1alpha/resources.proto | 11 + .../cloud/alloydb/v1beta/resources.proto | 11 + .../google-cloud-alloydb/protos/protos.d.ts | 309 + .../google-cloud-alloydb/protos/protos.js | 699 + .../google-cloud-alloydb/protos/protos.json | 45 + 194 files changed, 1086 insertions(+), 297287 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-alloydb/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-alloydb/.gitignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/.nycrc delete mode 100644 owl-bot-staging/google-cloud-alloydb/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-alloydb/LICENSE delete mode 100644 owl-bot-staging/google-cloud-alloydb/README.md delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/webpack.config.js diff --git a/owl-bot-staging/google-cloud-alloydb/.eslintignore b/owl-bot-staging/google-cloud-alloydb/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-alloydb/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-alloydb/.gitattributes b/owl-bot-staging/google-cloud-alloydb/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-alloydb/.gitignore b/owl-bot-staging/google-cloud-alloydb/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-alloydb/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/.jsdoc.js deleted file mode 100644 index 2622fc93a10..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/alloydb', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-alloydb/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-alloydb/.nycrc b/owl-bot-staging/google-cloud-alloydb/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/.prettierignore b/owl-bot-staging/google-cloud-alloydb/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-alloydb/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md b/owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md deleted file mode 100644 index 22fe4269f70..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Alloydb API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=alloydb.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/LICENSE b/owl-bot-staging/google-cloud-alloydb/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/LICENSE +++ /dev/null @@ -1,202 +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-alloydb/README.md b/owl-bot-staging/google-cloud-alloydb/README.md deleted file mode 100644 index 682032063e8..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/README.md +++ /dev/null @@ -1,232 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [AlloyDB API: Nodejs Client][homepage] - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority - -[![npm version](https://img.shields.io/npm/v/@google-cloud/alloydb.svg)](https://www.npmjs.org/package/@google-cloud/alloydb) - -AlloyDB API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [AlloyDB API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/alloydb/latest) -* [AlloyDB API Documentation](https://cloud.google.com/alloydb/docs) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the AlloyDB API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/alloydb -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| batch create instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js) | -| create backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js) | -| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js) | -| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js) | -| create secondary cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js) | -| create secondary instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js) | -| create user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js) | -| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js) | -| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js) | -| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js) | -| delete user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js) | -| execute sql | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js) | -| export cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js) | -| failover instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js) | -| generate client certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js) | -| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js) | -| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js) | -| get connection info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js) | -| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js) | -| get user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js) | -| import cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js) | -| inject fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js) | -| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js) | -| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js) | -| list databases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js) | -| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js) | -| list supported database flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js) | -| list users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js) | -| promote cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js) | -| restart instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js) | -| restore cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js) | -| switchover cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js) | -| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js) | -| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js) | -| update instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js) | -| update user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js) | -| upgrade cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js) | -| restore from cloud s q l | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json) | -| batch create instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js) | -| create backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js) | -| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js) | -| create database | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js) | -| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js) | -| create secondary cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js) | -| create secondary instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js) | -| create user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js) | -| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js) | -| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js) | -| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js) | -| delete user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js) | -| execute sql | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js) | -| export cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js) | -| failover instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js) | -| generate client certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js) | -| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js) | -| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js) | -| get connection info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js) | -| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js) | -| get user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js) | -| import cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js) | -| inject fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js) | -| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js) | -| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js) | -| list databases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js) | -| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js) | -| list supported database flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js) | -| list users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js) | -| promote cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js) | -| restart instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js) | -| restore cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js) | -| switchover cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js) | -| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js) | -| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js) | -| update instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js) | -| update user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js) | -| upgrade cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js) | -| restore from cloud s q l | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json) | -| batch create instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js) | -| create backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js) | -| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js) | -| create database | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js) | -| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js) | -| create secondary cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js) | -| create secondary instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js) | -| create user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js) | -| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js) | -| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js) | -| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js) | -| delete user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js) | -| execute sql | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js) | -| export cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js) | -| failover instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js) | -| generate client certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js) | -| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js) | -| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js) | -| get connection info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js) | -| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js) | -| get user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js) | -| import cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js) | -| inject fault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js) | -| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js) | -| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js) | -| list databases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js) | -| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js) | -| list supported database flags | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js) | -| list users | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js) | -| promote cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js) | -| restart instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js) | -| restore cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js) | -| switchover cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js) | -| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js) | -| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js) | -| update instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js) | -| update user | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js) | -| upgrade cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js) | -| restore from cloud s q l | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/alloydb@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=alloydb.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-alloydb diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto deleted file mode 100644 index 43893ff3350..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_resources.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1"; -option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "CsqlResourcesProto"; -option java_package = "com.google.cloud.alloydb.v1"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; -option ruby_package = "Google::Cloud::AlloyDB::V1"; - -// The source CloudSQL backup resource. -message CloudSQLBackupRunSource { - // The project ID of the source CloudSQL instance. This should be the same as - // the AlloyDB cluster's project. - string project = 1; - - // Required. The CloudSQL instance ID. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The CloudSQL backup run ID. - int64 backup_run_id = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto deleted file mode 100644 index bff72301bcb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/csql_service.proto +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1/csql_resources.proto"; -import "google/cloud/alloydb/v1/resources.proto"; -import "google/cloud/alloydb/v1/service.proto"; -import "google/longrunning/operations.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1"; -option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "CSQLServiceProto"; -option java_package = "com.google.cloud.alloydb.v1"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; -option ruby_package = "Google::Cloud::AlloyDB::V1"; - -// Service for interactions with CloudSQL. -service AlloyDBCSQLAdmin { - option (google.api.default_host) = "alloydb.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Restores an AlloyDB cluster from a CloudSQL resource. - rpc RestoreFromCloudSQL(RestoreFromCloudSQLRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL" - body: "*" - }; - option (google.api.method_signature) = "parent,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } -} - -// Message for registering Restoring from CloudSQL resource. -message RestoreFromCloudSQLRequest { - // The source CloudSQL resource to restore from. - oneof source { - // Cluster created from CloudSQL backup run. - CloudSQLBackupRunSource cloudsql_backup_run_source = 101; - } - - // Required. The location of the new cluster. For the required format, see the - // comment on Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto deleted file mode 100644 index cdbcc925ffb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1"; -option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "DataModelProto"; -option java_package = "com.google.cloud.alloydb.v1"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; -option ruby_package = "Google::Cloud::AlloyDB::V1"; - -// SqlResult represents the result for the execution of a sql statement. -message SqlResult { - // List of columns included in the result. This also includes the data type - // of the column. - repeated SqlResultColumn columns = 1; - - // Rows returned by the SQL statement. - repeated SqlResultRow rows = 2; -} - -// Contains the name and datatype of a column in a SQL Result. -message SqlResultColumn { - // Name of the column. - string name = 1; - - // Datatype of the column as reported by the postgres driver. - // Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - // "INT", and "BIGINT". - string type = 2; -} - -// A single row from a sql result. -message SqlResultRow { - // List of values in a row of sql result. - repeated SqlResultValue values = 1; -} - -// A single value in a row from a sql result. -message SqlResultValue { - // The cell value represented in string format. - // Timestamps are converted to string using RFC3339Nano format. - optional string value = 1; - - // Set to true if cell value is null. - optional bool null_value = 2; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto deleted file mode 100644 index a5a80e137f6..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto +++ /dev/null @@ -1,1718 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1/csql_resources.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/type/dayofweek.proto"; -import "google/type/timeofday.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1"; -option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.cloud.alloydb.v1"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; -option ruby_package = "Google::Cloud::AlloyDB::V1"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/Network" - pattern: "projects/{project}/global/networks/{network}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/ServiceAttachment" - pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" -}; - -// View on Instance. Pass this enum to rpcs that returns an Instance message to -// control which subsets of fields to get. -enum 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; -} - -// View on Cluster. Pass this enum to rpcs that returns a cluster message to -// control which subsets of fields to get. -enum 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; -} - -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // 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; -} - -// Subscription_type added to distinguish between Standard and Trial -// subscriptions. By default, a subscription type is considered STANDARD unless -// explicitly specified. -enum 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; -} - -// The username/password for a database user. Used for specifying initial -// users at cluster creation time. -message UserPassword { - // The database username. - string user = 1; - - // The initial password for the user. - string password = 2; -} - -// Subset of the source instance configuration that is available when reading -// the cluster resource. -message MigrationSource { - // Denote the type of migration source that created this cluster. - enum MigrationSourceType { - // Migration source is unknown. - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - - // DMS source means the cluster was created via DMS migration job. - DMS = 1; - } - - // Output only. The host and port of the on-premises instance in host:port - // format - string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Place holder for the external source identifier(e.g DMS job - // name) that created the cluster. - string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Type of migration source. - MigrationSourceType source_type = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// EncryptionConfig describes the encryption config of a cluster or a backup -// that is encrypted with a CMEK (customer-managed encryption key). -message EncryptionConfig { - // 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] - string kms_key_name = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; -} - -// EncryptionInfo describes the encryption information of a cluster or a backup. -message EncryptionInfo { - // Possible encryption types. - enum 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; - } - - // Output only. Type of encryption. - Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cloud KMS key versions that are being used to protect the - // database or the backup. - repeated string kms_key_versions = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// SSL configuration. -message SslConfig { - // SSL mode options. - enum 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 [deprecated = true]; - - // SSL connections are required. CA verification not enforced. - // Clients may use locally self-signed certificates (default psql client - // behavior). - SSL_MODE_REQUIRE = 2 [deprecated = true]; - - // 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 [deprecated = true]; - - // SSL connections are optional. CA verification not enforced. - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - - // SSL connections are required. CA verification not enforced. - ENCRYPTED_ONLY = 5; - } - - // Certificate Authority (CA) source for SSL/TLS certificates. - enum 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; - } - - // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - // supported currently, and is the default value. - CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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. -message AutomatedBackupPolicy { - // 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. - message WeeklySchedule { - // 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. - repeated google.type.TimeOfDay start_times = 1; - - // 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. - repeated google.type.DayOfWeek days_of_week = 2; - } - - // A time based retention policy specifies that all backups within a certain - // time period should be retained. - message TimeBasedRetention { - // The retention period. - google.protobuf.Duration retention_period = 1; - } - - // A quantity based policy specifies that a certain number of the most recent - // successful backups should be retained. - message QuantityBasedRetention { - // The number of backups to retain. - int32 count = 1; - } - - // The schedule for this automated backup policy. - // - // A schedule specifies times at which to start a backup. If a backup - // window is also provided, the backup is guaranteed to be started and - // completed within the start time plus the backup window. If the backup is - // not completed within the backup window it is marked as failed. - // - // If not set, the schedule defaults to a weekly schedule with one backup - // per day and a start time chosen arbitrarily. - oneof schedule { - // Weekly schedule for the Backup. - WeeklySchedule weekly_schedule = 2; - } - - // The retention policy for automated backups. - // - // The retention policy for a backup is fixed at the time the backup is - // created. Changes to this field only apply to new backups taken with the - // policy; the retentions of existing backups remain unchanged. - // - // If no retention policy is set, a default of 14 days is used. - oneof retention { - // Time-based Backup retention policy. - TimeBasedRetention time_based_retention = 4; - - // Quantity-based Backup retention policy to retain recent backups. - QuantityBasedRetention quantity_based_retention = 5; - } - - // Whether automated automated backups are enabled. If not set, defaults to - // true. - optional bool enabled = 1; - - // 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. - google.protobuf.Duration backup_window = 3; - - // 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. - EncryptionConfig encryption_config = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string location = 6; - - // Labels to apply to backups created using this configuration. - map labels = 7; -} - -// ContinuousBackupConfig describes the continuous backups recovery -// configurations of a cluster. -message ContinuousBackupConfig { - // Whether ContinuousBackup is enabled. - optional bool enabled = 1; - - // 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. - int32 recovery_window_days = 4; - - // 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. - EncryptionConfig encryption_config = 3; -} - -// ContinuousBackupInfo describes the continuous backup properties of a -// cluster. -message ContinuousBackupInfo { - // Output only. The encryption information for the WALs and backups required - // for ContinuousBackup. - EncryptionInfo encryption_info = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When ContinuousBackup was most recently enabled. Set to null - // if ContinuousBackup is not enabled. - google.protobuf.Timestamp enabled_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Days of the week on which a continuous backup is taken. - repeated google.type.DayOfWeek schedule = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp earliest_restorable_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message describing a BackupSource. -message BackupSource { - // 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. - string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The name of the backup resource with the format: - // * projects/{project}/locations/{region}/backups/{backup_id} - string backup_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; -} - -// Message describing a ContinuousBackupSource. -message ContinuousBackupSource { - // 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. - string cluster = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The point in time to restore to. - google.protobuf.Timestamp point_in_time = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// MaintenanceUpdatePolicy defines the policy for system updates. -message MaintenanceUpdatePolicy { - // MaintenanceWindow specifies a preferred day and time for maintenance. - message MaintenanceWindow { - // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. - google.type.DayOfWeek day = 1; - - // Preferred time to start the maintenance operation on the specified day. - // Maintenance will start within 1 hour of this time. - google.type.TimeOfDay start_time = 2; - } - - // 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. - message DenyMaintenancePeriod { - // 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 - google.type.Date start_date = 1; - - // 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 - google.type.Date end_date = 2; - - // 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 - google.type.TimeOfDay time = 3; - } - - // Preferred windows to perform maintenance. Currently limited to 1. - repeated MaintenanceWindow maintenance_windows = 1; - - // Periods to deny maintenance. Currently limited to 1. - repeated DenyMaintenancePeriod deny_maintenance_periods = 2; -} - -// 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. -message MaintenanceSchedule { - // Output only. The scheduled start time for the maintenance. - google.protobuf.Timestamp start_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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. -message Cluster { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Cluster" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}" - plural: "clusters" - singular: "cluster" - style: DECLARATIVE_FRIENDLY - }; - - // Metadata related to network configuration. - message NetworkConfig { - // 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. - string network = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // 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. - string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration information for the secondary cluster. This should be set - // if and only if the cluster is of type SECONDARY. - message SecondaryConfig { - // The name of the primary cluster name with the format: - // * projects/{project}/locations/{region}/clusters/{cluster_id} - string primary_cluster_name = 1 [(google.api.resource_reference) = { - type: "alloydb.googleapis.com/Cluster" - }]; - } - - // 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. - message PrimaryConfig { - // Output only. Names of the clusters that are replicating from this - // cluster. - repeated string secondary_cluster_names = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Cluster" - } - ]; - } - - // PscConfig contains PSC related configuration at a cluster level. - message PscConfig { - // Optional. Create an instance that allows connections from Private Service - // Connect endpoints to the instance. - bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The project number that needs to be allowlisted on the - // network attachment to enable outbound connectivity. - int64 service_owned_project_number = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Contains information and all metadata related to TRIAL clusters. - message TrialMetadata { - // start time of the trial cluster. - google.protobuf.Timestamp start_time = 1; - - // End time of the trial cluster. - google.protobuf.Timestamp end_time = 2; - - // Upgrade time of trial cluster to Standard cluster. - google.protobuf.Timestamp upgrade_time = 3; - - // grace end time of the cluster. - google.protobuf.Timestamp grace_end_time = 4; - } - - // Configuration for Dataplex integration. - message DataplexConfig { - // Dataplex is enabled by default for resources such as clusters and - // instances. This flag controls the integration of AlloyDB PG - // resources (like databases, schemas, and tables) with Dataplex." - bool enabled = 1; - } - - // Cluster State - enum 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; - } - - // Type of Cluster - enum 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; - } - - // In case of an imported cluster, this field contains information about the - // source this cluster was imported from. - oneof source { - // Output only. Cluster created from backup. - BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster created via DMS migration. - MigrationSource migration_source = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster created from CloudSQL snapshot. - CloudSQLBackupRunSource cloudsql_backup_run_source = 42 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Cluster. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Update time stamp - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 7; - - // Output only. The current serving state of the cluster. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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` - ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; - - NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string network = 10 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } - ]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 11; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 12; - - // 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. - bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. Initial user to setup during cluster creation. - // If used in `RestoreCluster` this is ignored. - UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; - - // 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. - AutomatedBackupPolicy automated_backup_policy = 17; - - // SSL configuration for this AlloyDB cluster. - SslConfig ssl_config = 18 [deprecated = true]; - - // 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. - EncryptionConfig encryption_config = 19 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The encryption information for the cluster. - EncryptionInfo encryption_info = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Continuous backup configuration for this cluster. - ContinuousBackupConfig continuous_backup_config = 27 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Continuous backup properties for this cluster. - ContinuousBackupInfo continuous_backup_info = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cross Region replication config specific to SECONDARY cluster. - SecondaryConfig secondary_config = 22; - - // Output only. Cross Region replication config specific to PRIMARY cluster. - PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The configuration for Private Service Connect (PSC) for the - // cluster. - PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maintenance update policy determines when to allow or deny - // updates. - MaintenanceUpdatePolicy maintenance_update_policy = 32 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The maintenance schedule for the cluster, generated for a - // specific rollout if a maintenance window is set. - MaintenanceSchedule maintenance_schedule = 37 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Subscription type of the cluster. - SubscriptionType subscription_type = 38 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Metadata for free trial clusters - TrialMetadata trial_metadata = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Input only. Immutable. Tag keys/values directly bound to this - // resource. For example: - // ``` - // "123/environment": "production", - // "123/costCenter": "marketing" - // ``` - map tags = 41 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Configuration for Dataplex integration. - DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; -} - -// An Instance is a computing unit that an end customer can connect to. -// It's the main unit of computing resources in AlloyDB. -message Instance { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" - plural: "instances" - singular: "instance" - style: DECLARATIVE_FRIENDLY - }; - - // MachineConfig describes the configuration of a machine. - message MachineConfig { - // The number of CPU's in the VM instance. - int32 cpu_count = 1; - - // 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. - string machine_type = 4; - } - - // 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. - message Node { - // Output only. The Compute Engine zone of the VM e.g. "us-central1-b". - string zone_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the VM e.g. - // "test-read-0601-407e52be-ms3l". - string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The private IP address of the VM e.g. "10.57.0.34". - string ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // QueryInsights Instance specific configuration. - message QueryInsightsInstanceConfig { - // Record application tags for an instance. - // This flag is turned "on" by default. - optional bool record_application_tags = 2; - - // Record client address for an instance. Client address is PII information. - // This flag is turned "on" by default. - optional bool record_client_address = 3; - - // Query string length. The default value is 1024. - // Any integer between 256 and 4500 is considered valid. - uint32 query_string_length = 4; - - // 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. - optional uint32 query_plans_per_minute = 5; - } - - // Observability Instance specific configuration. - message ObservabilityInstanceConfig { - // Observability feature status for an instance. - // This flag is turned "off" by default. - optional bool enabled = 1; - - // Preserve comments in query string for an instance. - // This flag is turned "off" by default. - optional bool preserve_comments = 2; - - // 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. - optional bool track_wait_events = 3; - - // 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. - optional bool track_wait_event_types = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Query string length. The default value is 10k. - optional int32 max_query_string_length = 5; - - // Record application tags for an instance. - // This flag is turned "off" by default. - optional bool record_application_tags = 6; - - // 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. - optional int32 query_plans_per_minute = 7; - - // Track actively running queries on the instance. - // If not set, this flag is "off" by default. - optional bool track_active_queries = 8; - } - - // Configuration for a read pool instance. - message ReadPoolConfig { - // Read capacity, i.e. number of nodes in a read pool instance. - int32 node_count = 1; - } - - // Client connection configuration - message ClientConnectionConfig { - // Optional. Configuration to enforce connectors only (ex: AuthProxy) - // connections to the database. - bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. SSL configuration option for this instance. - SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for setting up a PSC interface to enable outbound - // connectivity. - message PscInterfaceConfig { - // 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. - string network_attachment_resource = 1; - } - - // Configuration for setting up PSC service automation. Consumer projects in - // the configs will be allowlisted automatically for the instance. - message PscAutoConnectionConfig { - // The consumer project to which the PSC service automation endpoint will - // be created. - string consumer_project = 1; - - // 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. - string consumer_network = 2; - - // Output only. The IP address of the PSC service automation endpoint. - string ip_address = 3 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - string status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string consumer_network_status = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // PscInstanceConfig contains PSC related configuration at an - // instance level. - message PscInstanceConfig { - // 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/` - string service_attachment_link = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "compute.googleapis.com/ServiceAttachment" - } - ]; - - // Optional. List of consumer projects that are allowed to create - // PSC endpoints to service-attachments to this instance. - repeated string allowed_consumer_projects = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The DNS name of the instance for PSC connectivity. - // Name convention: ...alloydb-psc.goog - string psc_dns_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - repeated PscInterfaceConfig psc_interface_configs = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configurations for setting up PSC service automation. - repeated PscAutoConnectionConfig psc_auto_connections = 9 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Metadata related to instance-level network configuration. - message InstanceNetworkConfig { - // AuthorizedNetwork contains metadata for an authorized network. - message AuthorizedNetwork { - // CIDR range for one authorzied network of the instance. - string cidr_range = 1 [(google.api.field_info).format = IPV4]; - } - - // Optional. A list of external network authorized to access this instance. - repeated AuthorizedNetwork authorized_external_networks = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enabling public ip for the instance. - bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enabling an outbound public IP address to support a database - // server sending requests out into the internet. - bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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}`. - string network = 4 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // 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])?. - string allocated_ip_range_override = 5 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for Managed Connection Pool (MCP). - message ConnectionPoolConfig { - // Optional. Whether to enable Managed Connection Pool (MCP). - bool enabled = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Connection Pool flags, as a list of "key": "value" pairs. - map flags = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The number of running poolers per instance. - int32 pooler_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Instance State - enum 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; - } - - // Type of an Instance - enum 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; - } - - // 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). - enum AvailabilityType { - // This is an unknown Availability type. - AVAILABILITY_TYPE_UNSPECIFIED = 0; - - // Zonal available instance. - ZONAL = 1; - - // Regional (or Highly) available instance. - REGIONAL = 2; - } - - // Specifies whether an instance needs to spin up. - enum ActivationPolicy { - // The policy is not specified. - ACTIVATION_POLICY_UNSPECIFIED = 0; - - // The instance is running. - ALWAYS = 1; - - // The instance is not running. - NEVER = 2; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Instance. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Update time stamp - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 7; - - // Output only. The current serving state of the instance. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The type of the instance. Specified at creation time. - InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; - - // Configurations for the machines that host the underlying - // database engine. - MachineConfig machine_config = 10; - - // 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). - AvailabilityType availability_type = 11; - - // 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. - string gce_zone = 12; - - // 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. - map database_flags = 13; - - // Output only. This is set for the read-write VM of the PRIMARY instance - // only. - Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of available read-only VMs in this instance, including - // the standby for a PRIMARY instance. - repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configuration for query insights. - QueryInsightsInstanceConfig query_insights_config = 21; - - // Configuration for observability. - ObservabilityInstanceConfig observability_config = 26; - - // Read pool instance configuration. - // This is required if the value of instanceType is READ_POOL. - ReadPoolConfig read_pool_config = 14; - - // Output only. The IP address for the Instance. - // This is the connection endpoint for an end-user application. - string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string public_ip_address = 27 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 17; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 18; - - // Optional. Client connection specific configurations - ClientConnectionConfig client_connection_config = 23 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The configuration for Private Service Connect (PSC) for the - // instance. - PscInstanceConfig psc_instance_config = 28 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Instance-level network configuration. - InstanceNetworkConfig network_config = 29 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. All outbound public IP addresses configured for the instance. - repeated string outbound_public_ip_addresses = 34 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - ActivationPolicy activation_policy = 35 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration for Managed Connection Pool (MCP). - ConnectionPoolConfig connection_pool_config = 37 - [(google.api.field_behavior) = OPTIONAL]; -} - -// ConnectionInfo singleton resource. -// https://google.aip.dev/156 -message ConnectionInfo { - option (google.api.resource) = { - type: "alloydb.googleapis.com/ConnectionInfo" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" - plural: "connectionInfos" - singular: "connectionInfo" - }; - - // The name of the ConnectionInfo singleton resource, e.g.: - // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - // This field currently has no semantic meaning. - string name = 1; - - // 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. - string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string public_ip_address = 5 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. The unique ID of the Instance. - string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message describing Backup object -message Backup { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Backup" - pattern: "projects/{project}/locations/{location}/backups/{backup}" - plural: "backups" - singular: "backup" - style: DECLARATIVE_FRIENDLY - }; - - // 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) - message QuantityBasedExpiry { - // 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). - int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The length of the quantity-based queue, specified by the - // backup's retention policy. - int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Backup State - enum 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; - } - - // Backup Type - enum 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; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Backup. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the resource finished being created. - google.protobuf.Timestamp create_completion_time = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 6; - - // Output only. The current state of the backup. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The backup type, which suggests the trigger for the backup. - Type type = 8; - - // User-provided description of the backup. - string description = 9; - - // Output only. The system-generated UID of the cluster which was used to - // create this resource. - string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The full resource name of the backup source cluster - // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - string cluster_name = 10 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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. - bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - EncryptionConfig encryption_config = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 14; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 16; - - // Output only. The size of the backup in bytes. - int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp expiry_time = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - QuantityBasedExpiry expiry_quantity = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - DatabaseVersion database_version = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Input only. Immutable. Tag keys/values directly bound to this - // resource. For example: - // ``` - // "123/environment": "production", - // "123/costCenter": "marketing" - // ``` - map tags = 25 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// 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. -message SupportedDatabaseFlag { - option (google.api.resource) = { - type: "alloydb.googleapis.com/SupportedDatabaseFlag" - pattern: "projects/{project}/locations/{location}/flags/{flag}" - plural: "supportedDatabaseFlags" - singular: "supportedDatabaseFlag" - }; - - // Restrictions on STRING type values - message StringRestrictions { - // The list of allowed values, if bounded. This field will be empty - // if there is a unbounded number of allowed values. - repeated string allowed_values = 1; - } - - // Restrictions on INTEGER type values. - message IntegerRestrictions { - // The minimum value that can be specified, if applicable. - google.protobuf.Int64Value min_value = 1; - - // The maximum value that can be specified, if applicable. - google.protobuf.Int64Value max_value = 2; - } - - // 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". - enum 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; - } - - // The scope of the flag. - enum 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; - } - - // The restrictions on the flag value per type. - oneof restrictions { - // Restriction on STRING type value. - StringRestrictions string_restrictions = 7; - - // Restriction on INTEGER type value. - IntegerRestrictions integer_restrictions = 8; - } - - // The recommended value for the flag by type, if applicable. - oneof recommended_value { - // The recommended value for a STRING flag. - string recommended_string_value = 10; - - // The recommended value for an INTEGER flag. - google.protobuf.Int64Value recommended_integer_value = 11; - } - - // 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. - string name = 1; - - // The name of the database flag, e.g. "max_allowed_packets". - // The is a possibly key for the Instance.database_flags map field. - string flag_name = 2; - - ValueType value_type = 3; - - // Whether the database flag accepts multiple values. If true, - // a comma-separated list of stringified values may be specified. - bool accepts_multiple_values = 4; - - // Major database engine versions for which this flag is supported. - repeated DatabaseVersion supported_db_versions = 5; - - // 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). - bool requires_db_restart = 6; - - // The scope of the flag. - Scope scope = 9; -} - -// Message describing User object. -message User { - option (google.api.resource) = { - type: "alloydb.googleapis.com/User" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" - plural: "users" - singular: "user" - style: DECLARATIVE_FRIENDLY - }; - - // Enum that details the user type. - enum 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; - } - - // Output only. Name of the resource in the form of - // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. Password for the user. - string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; - - // Optional. List of database roles this user has. - // The database role strings are subject to the PostgreSQL naming conventions. - repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Type of this user. - UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Input only. If the user already exists and it has additional roles, keep - // them granted. - bool keep_extra_roles = 6 [(google.api.field_behavior) = INPUT_ONLY]; -} - -// Message describing Database object. -message Database { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Database" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}" - plural: "databases" - singular: "database" - style: DECLARATIVE_FRIENDLY - }; - - // Identifier. Name of the resource in the form of - // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. Immutable. Charset for the database. - // This field can contain any PostgreSQL supported charset name. - // Example values include "UTF8", "SQL_ASCII", etc. - string charset = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Immutable. lc_collate for the database. - // String sort order. - // Example values include "C", "POSIX", etc. - string collation = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Immutable. lc_ctype for the database. - // Character classification (What is a letter? The upper-case equivalent?). - // Example values include "C", "POSIX", etc. - string character_type = 4 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Input only. Immutable. Template of the database to be used for creating a - // new database. - string database_template = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Whether the database is a template database. - optional bool is_template_database = 7 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto deleted file mode 100644 index 140ec0fc059..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto +++ /dev/null @@ -1,2234 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1/data_model.proto"; -import "google/cloud/alloydb/v1/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1"; -option go_package = "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceProto"; -option java_package = "com.google.cloud.alloydb.v1"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1"; -option ruby_package = "Google::Cloud::AlloyDB::V1"; - -// Service describing handlers for resources -service AlloyDBAdmin { - option (google.api.default_host) = "alloydb.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists Clusters in a given project and location. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/clusters" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Cluster in a given project and location. - rpc CreateCluster(CreateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Cluster. - rpc UpdateCluster(UpdateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{cluster.name=projects/*/locations/*/clusters/*}" - body: "cluster" - }; - option (google.api.method_signature) = "cluster,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Exports data from the cluster. - // Imperative only. - rpc ExportCluster(ExportClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:export" - body: "*" - }; - option (google.api.method_signature) = - "name,gcs_destination,database,csv_export_options,sql_export_options"; - option (google.longrunning.operation_info) = { - response_type: "ExportClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Imports data to the cluster. - // Imperative only. - rpc ImportCluster(ImportClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,gcs_uri,database,user"; - option (google.longrunning.operation_info) = { - response_type: "ImportClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Upgrades a single Cluster. - // Imperative only. - rpc UpgradeCluster(UpgradeClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/locations/*/clusters/*}:upgrade" - body: "*" - }; - option (google.api.method_signature) = "name,version"; - option (google.longrunning.operation_info) = { - response_type: "UpgradeClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Cluster. - rpc DeleteCluster(DeleteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Promotes a SECONDARY cluster. This turns down replication - // from the PRIMARY cluster and promotes a secondary cluster - // into its own standalone cluster. - // Imperative only. - rpc PromoteCluster(PromoteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:promote" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc SwitchoverCluster(SwitchoverClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:switchover" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc RestoreCluster(RestoreClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters:restore" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Creates a cluster of type SECONDARY in the given location using - // the primary cluster as the source. - rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters:createsecondary" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Lists Instances in a given project and location. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Instance in a given project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Creates a new SECONDARY Instance in a given project and location. - rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc BatchCreateInstances(BatchCreateInstancesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" - body: "requests" - }; - option (google.longrunning.operation_info) = { - response_type: "BatchCreateInstancesResponse" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "instance,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Forces a Failover for a highly available instance. - // Failover promotes the HA standby instance as the new primary. - // Imperative only. - rpc FailoverInstance(FailoverInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Injects fault in an instance. - // Imperative only. - rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" - body: "*" - }; - option (google.api.method_signature) = "fault_type,name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Restart an Instance in a cluster. - // Imperative only. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Executes a SQL statement in a database inside an AlloyDB instance. - rpc ExecuteSql(ExecuteSqlRequest) returns (ExecuteSqlResponse) { - option (google.api.http) = { - post: "/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql" - body: "*" - }; - option (google.api.method_signature) = - "instance,database,user,sql_statement,password"; - } - - // Lists Backups in a given project and location. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Backup. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Backup in a given project and location. - rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/backups" - body: "backup" - }; - option (google.api.method_signature) = "parent,backup,backup_id"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Backup. - rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{backup.name=projects/*/locations/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Backup. - rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Lists SupportedDatabaseFlags for a given project and location. - rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) - returns (ListSupportedDatabaseFlagsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags" - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - rpc GenerateClientCertificate(GenerateClientCertificateRequest) - returns (GenerateClientCertificateResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Get instance metadata used for a connection. - rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Users in a given project and location. - rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/users" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single User. - rpc GetUser(GetUserRequest) returns (User) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new User in a given project, location, and cluster. - rpc CreateUser(CreateUserRequest) returns (User) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/users" - body: "user" - }; - option (google.api.method_signature) = "parent,user,user_id"; - } - - // Updates the parameters of a single User. - rpc UpdateUser(UpdateUserRequest) returns (User) { - option (google.api.http) = { - patch: "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}" - body: "user" - }; - option (google.api.method_signature) = "user,update_mask"; - } - - // Deletes a single User. - rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Databases in a given project and location. - rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/databases" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Message for requesting list of Clusters -message ListClustersRequest { - // 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/- - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Clusters -message ListClustersResponse { - // The list of Cluster - repeated Cluster clusters = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Cluster -message GetClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // Optional. The view of the cluster to return. Returns all default fields if - // not set. - ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -message CreateSecondaryClusterRequest { - // Required. The location of the new cluster. For the required - // format, see the comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object (the secondary cluster). - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Configuration of the requesting object (the secondary cluster). - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating a Cluster -message CreateClusterRequest { - // Required. The location of the new cluster. For the required format, see the - // comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a Cluster -message UpdateClusterRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Destination for Export. Export will be done to cloud storage. -message GcsDestination { - // 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`. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Export cluster request. -message ExportClusterRequest { - // Options for exporting data in CSV format. - message CsvExportOptions { - // Required. The SELECT query used to extract the data. - string select_query = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string field_delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string quote_character = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string escape_character = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Options for exporting data in SQL format. - message SqlExportOptions { - // Optional. Tables to export from. - repeated string tables = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, only export the schema. - optional bool schema_only = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, output commands to DROP all the dumped database - // objects prior to outputting the commands for creating them. - optional bool clean_target_objects = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, use DROP ... IF EXISTS commands to check for the - // object's existence before dropping it in clean_target_objects mode. - optional bool if_exist_target_objects = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Oneof field to support other destinations in future. - oneof destination { - // Required. Option to export data to cloud storage. - GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required field to specify export file type and options. - oneof export_options { - // Options for exporting data in CSV format. Required field to be set for - // CSV file type. - CsvExportOptions csv_export_options = 4; - - // Options for exporting data in SQL format. Required field to be set for - // SQL file type. - SqlExportOptions sql_export_options = 5; - } - - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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. - string database = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response of export cluster rpc. -message ExportClusterResponse { - // Oneof field to support other destinations in future. - oneof destination { - // Required. Option to export data to cloud storage. - GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Import cluster request. -message ImportClusterRequest { - // Options for importing data in SQL format. - message SqlImportOptions {} - - // Options for importing data in CSV format. - message CsvImportOptions { - // Required. The database table to import CSV file into. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The columns to which CSV data is imported. If not specified, - // all columns of the database table are loaded with CSV data. - repeated string columns = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string field_delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string quote_character = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string escape_character = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // oneof field to support various import formats like SQL and CSV. - oneof import_options { - // Options for importing data in SQL format. - SqlImportOptions sql_import_options = 4; - - // Options for importing data in CSV format. - CsvImportOptions csv_import_options = 7; - } - - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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`. - string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string database = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string user = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response of import rpc. -message ImportClusterResponse { - // Required. Size of the object downloaded from Google Cloud Storage in bytes. - int64 bytes_downloaded = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Upgrades a cluster. -message UpgradeClusterRequest { - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // Required. The version the cluster is going to be upgraded to. - DatabaseVersion version = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// UpgradeClusterResponse contains the response for upgrade cluster operation. -message UpgradeClusterResponse { - // Stage information for different stages in the upgrade process. - message StageInfo { - // The stage. - Stage stage = 1; - - // Status of the stage. - Status status = 2; - - // 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. - string logs_url = 3; - } - - // Details regarding the upgrade of instances associated with a cluster. - message InstanceUpgradeDetails { - // Normalized name of the instance. - string name = 1; - - // Upgrade status of the instance. - Status upgrade_status = 2; - - // Instance type. - Instance.InstanceType instance_type = 3; - } - - // Upgrade details of a cluster. This cluster can be primary or secondary. - message ClusterUpgradeDetails { - // Normalized name of the cluster - string name = 1; - - // Upgrade status of the cluster. - Status upgrade_status = 2; - - // Cluster type which can either be primary or secondary. - Cluster.ClusterType cluster_type = 3; - - // 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. - DatabaseVersion database_version = 4; - - // Array containing stage info associated with this cluster. - repeated StageInfo stage_info = 5; - - // Upgrade details of the instances directly associated with this cluster. - repeated InstanceUpgradeDetails instance_upgrade_details = 6; - } - - // Status of upgrade operation. - enum 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; - } - - // Stage in the upgrade. - enum 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; - } - - // Status of upgrade operation. - Status status = 1; - - // A user friendly message summarising the upgrade operation details and the - // next steps for the user if there is any. - string message = 2; - - // Array of upgrade details for the current cluster and all the secondary - // clusters associated with this cluster. - repeated ClusterUpgradeDetails cluster_upgrade_details = 3; -} - -// Message for deleting a Cluster -message DeleteClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to cascade delete child instances for given cluster. - bool force = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for switching over to a cluster -message SwitchoverClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for promoting a Cluster -message PromoteClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for restoring a Cluster from a backup or another cluster at a given -// point in time. -// NEXT_ID: 11 -message RestoreClusterRequest { - // Required. - // The source to import from. - oneof source { - // Backup source. - BackupSource backup_source = 4; - - // ContinuousBackup source. Continuous backup needs to be enabled in the - // source cluster for this operation to succeed. - ContinuousBackupSource continuous_backup_source = 8; - } - - // Required. The name of the parent resource. For the required format, see the - // comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for requesting list of Instances -message ListInstancesRequest { - // 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/- - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Instances -message ListInstancesResponse { - // The list of Instance - repeated Instance instances = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Instance -message GetInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // The view of the instance to return. - InstanceView view = 2; -} - -// Message for creating a Instance -message CreateInstanceRequest { - // Required. The name of the parent resource. For the required format, see the - // comment on the Instance.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. ID of the requesting object. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating a Secondary Instance -message CreateSecondaryInstanceRequest { - // Required. The name of the parent resource. For the required format, see the - // comment on the Instance.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. ID of the requesting object. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// See usage below for notes. -message CreateInstanceRequests { - // Required. Primary and read replica instances to be created. This list - // should not be empty. - repeated CreateInstanceRequest create_instance_requests = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// Message for creating a batch of instances under the specified cluster. -message BatchCreateInstancesRequest { - // Required. The name of the parent resource. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. Resources being created. - CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating batches of instances in a cluster. -message BatchCreateInstancesResponse { - // Created instances. - repeated Instance instances = 1; -} - -// Message for metadata that is specific to BatchCreateInstances API. -// NEXT_ID: 3 -message BatchCreateInstancesMetadata { - // 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. - repeated string instance_targets = 1; - - // 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. - map instance_statuses = 2; -} - -// 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. -message BatchCreateInstanceStatus { - // State contains all valid instance states for the BatchCreateInstances - // operation. This is mainly used for status reporting through the LRO - // metadata. - enum 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; - } - - // 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. - State state = 1; - - // DEPRECATED - Use the error field instead. - // Error, if any error occurred and is available, during instance creation. - string error_msg = 2; - - // The RPC status of the instance creation operation. This field will be - // present if an error happened during the instance creation. - google.rpc.Status error = 4; - - Instance.InstanceType type = 3; -} - -// Message for updating a Instance -message UpdateInstanceRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a Instance -message DeleteInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for triggering failover on an Instance -message FailoverInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for triggering fault injection on an instance -message InjectFaultRequest { - // FaultType contains all valid types of faults that can be injected to an - // instance. - enum FaultType { - // The fault type is unknown. - FAULT_TYPE_UNSPECIFIED = 0; - - // Stop the VM - STOP_VM = 1; - } - - // Required. The type of fault to be injected in an instance. - FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -message RestartInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - // restart upon. Applicable only to read instances. - repeated string node_ids = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for ExecuteSql rpc. -message ExecuteSqlRequest { - // Oneof field to support other credential mechanisms in future like - // SecretManager etc. - oneof user_credential { - // Optional. The database native user’s password. - string password = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The instance where the SQL will be executed. For the required - // format, see the comment on the Instance.name field. - string instance = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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. - string database = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string user = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. SQL statement to execute on database. Any valid statement is - // permitted, including DDL, DML, DQL statements. - string sql_statement = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If set, validates the sql statement by performing - // syntax and semantic validation and doesn't execute the query. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Execute a SQL statement response. -message ExecuteSqlResponse { - // SqlResult represents the results for the execution of sql statements. - repeated SqlResult sql_results = 1; - - // Any additional metadata information regarding the execution of the sql - // statement. - ExecuteSqlMetadata metadata = 3; -} - -// Any additional metadata information regarding the execution of the SQL -message ExecuteSqlMetadata { - // Status contains all valid Status a SQL execution can end up in. - enum 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; - } - - // 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." - string message = 1; - - // Set to true if SQL returned a result set larger than the acceptable - // response size limits and the result was truncated. - bool partial_result = 2; - - // The time duration taken to execute the sql statement. - google.protobuf.Duration sql_statement_execution_duration = 3; - - // Status of SQL execution. - Status status = 4; -} - -// Message for requesting list of Backups -message ListBackupsRequest { - // Required. Parent value for ListBackupsRequest - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Backup" - } - ]; - - // Requested page size. Server may return fewer items than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Filtering results - string filter = 4; - - // Hint for how to order the results - string order_by = 5; -} - -// Message for response to listing Backups -message ListBackupsResponse { - // The list of Backup - repeated Backup backups = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Backup -message GetBackupRequest { - // Required. Name of the resource - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; -} - -// Message for creating a Backup -message CreateBackupRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Backup" - } - ]; - - // Required. ID of the requesting object. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a Backup -message UpdateBackupRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a Backup -message DeleteBackupRequest { - // Required. Name of the resource. For the required format, see the comment on - // the Backup.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for listing the information about the supported Database flags. -message ListSupportedDatabaseFlagsRequest { - // 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. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" - } - ]; - - // Requested page size. Server may return fewer items than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. The scope for which supported flags are requested. If not - // specified, default is DATABASE. - SupportedDatabaseFlag.Scope scope = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing SupportedDatabaseFlags. -message ListSupportedDatabaseFlagsResponse { - // The list of SupportedDatabaseFlags. - repeated SupportedDatabaseFlag supported_database_flags = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; -} - -// Message for requests to generate a client certificate signed by the Cluster -// CA. -message GenerateClientCertificateRequest { - // Required. The name of the parent resource. The required format is: - // * projects/{project}/locations/{location}/clusters/{cluster} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - google.protobuf.Duration cert_duration = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The public key from the client. - string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message returned by a GenerateClientCertificate operation. -message GenerateClientCertificateResponse { - // 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. - repeated string pem_certificate_chain = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The pem-encoded cluster ca X.509 certificate. - string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for GetConnectionInfo. -message GetConnectionInfoRequest { - // Required. The name of the parent resource. The required format is: - // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Request specific metadata, if any. - oneof request_specific { - // Output only. BatchCreateInstances related metadata. - BatchCreateInstancesMetadata batch_create_instances_metadata = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. UpgradeClusterStatus related metadata. - UpgradeClusterStatus upgrade_cluster_status = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message for current status of the Major Version Upgrade operation. -message UpgradeClusterStatus { - // Status of an upgrade stage. - message StageStatus { - // Timing information for the stage execution. - message StageSchedule { - // When the stage is expected to start. Set only if the stage has not - // started yet. - google.protobuf.Timestamp estimated_start_time = 1; - - // Actual start time of the stage. Set only if the stage has started. - google.protobuf.Timestamp actual_start_time = 2; - - // When the stage is expected to end. Set only if the stage has not - // completed yet. - google.protobuf.Timestamp estimated_end_time = 3; - - // Actual end time of the stage. Set only if the stage has completed. - google.protobuf.Timestamp actual_end_time = 4; - } - - // Stage specific status information, if any. - oneof stage_specific_status { - // Read pool instances upgrade metadata. - ReadPoolInstancesUpgradeStageStatus read_pool_instances_upgrade = 11; - } - - // Upgrade stage. - UpgradeClusterResponse.Stage stage = 1; - - // State of this stage. - UpgradeClusterResponse.Status state = 2; - - // Output only. Timing information for the stage execution. - StageSchedule schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Read pool instances upgrade specific status. - message ReadPoolInstancesUpgradeStageStatus { - // Upgrade stats for read pool instances. - message Stats { - // Number of read pool instances for which upgrade has not started. - int32 not_started = 1; - - // Number of read pool instances undergoing upgrade. - int32 ongoing = 2; - - // Number of read pool instances successfully upgraded. - int32 success = 3; - - // Number of read pool instances which failed to upgrade. - int32 failed = 4; - } - - // Read pool instances upgrade statistics. - Stats upgrade_stats = 1; - } - - // Cluster Major Version Upgrade state. - UpgradeClusterResponse.Status state = 1; - - // Whether the operation is cancellable. - bool cancellable = 2; - - // Source database major version. - DatabaseVersion source_version = 3; - - // Target database major version. - DatabaseVersion target_version = 4; - - // Status of all upgrade stages. - repeated StageStatus stages = 5; -} - -// Message for requesting list of Users -message ListUsersRequest { - // Required. Parent value for ListUsersRequest - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/User" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Users -message ListUsersResponse { - // The list of User - repeated User users = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a User -message GetUserRequest { - // Required. The name of the resource. For the required format, see the - // comment on the User.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } - ]; -} - -// Message for creating a User -message CreateUserRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/User" - } - ]; - - // Required. ID of the requesting object. - string user_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - User user = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a User -message UpdateUserRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - User user = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Allow missing fields in the update mask. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a User -message DeleteUserRequest { - // Required. The name of the resource. For the required format, see the - // comment on the User.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for ListDatabases request. -message ListDatabasesRequest { - // Required. Parent value for ListDatabasesRequest. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Database" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - // This field is currently not supported, its value will be ignored if passed. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for ListDatabases response. -message ListDatabasesResponse { - // The list of databases. - repeated Database databases = 1; - - // A token identifying the next page of results the server should return. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto deleted file mode 100644 index 551b6721e15..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1alpha; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; -option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "CsqlResourcesProto"; -option java_package = "com.google.cloud.alloydb.v1alpha"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; -option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; - -// The source CloudSQL backup resource. -message CloudSQLBackupRunSource { - // The project ID of the source CloudSQL instance. This should be the same as - // the AlloyDB cluster's project. - string project = 1; - - // Required. The CloudSQL instance ID. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The CloudSQL backup run ID. - int64 backup_run_id = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto deleted file mode 100644 index 640b1ebe6d1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_service.proto +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1alpha; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1alpha/csql_resources.proto"; -import "google/cloud/alloydb/v1alpha/resources.proto"; -import "google/cloud/alloydb/v1alpha/service.proto"; -import "google/longrunning/operations.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; -option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "CSQLServiceProto"; -option java_package = "com.google.cloud.alloydb.v1alpha"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; -option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; - -// Service for interactions with CloudSQL. -service AlloyDBCSQLAdmin { - option (google.api.default_host) = "alloydb.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Restores an AlloyDB cluster from a CloudSQL resource. - rpc RestoreFromCloudSQL(RestoreFromCloudSQLRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL" - body: "*" - }; - option (google.api.method_signature) = "parent,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } -} - -// Message for registering Restoring from CloudSQL resource. -message RestoreFromCloudSQLRequest { - // The source CloudSQL resource to restore from. - oneof source { - // Cluster created from CloudSQL backup run. - CloudSQLBackupRunSource cloudsql_backup_run_source = 101; - } - - // Required. The location of the new cluster. For the required format, see the - // comment on Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto deleted file mode 100644 index 6333cf834cd..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1alpha; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; -option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "DataModelProto"; -option java_package = "com.google.cloud.alloydb.v1alpha"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; -option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; - -// SqlResult represents the result for the execution of a sql statement. -message SqlResult { - // List of columns included in the result. This also includes the data type - // of the column. - repeated SqlResultColumn columns = 1; - - // Rows returned by the SQL statement. - repeated SqlResultRow rows = 2; -} - -// Contains the name and datatype of a column in a SQL Result. -message SqlResultColumn { - // Name of the column. - string name = 1; - - // Datatype of the column as reported by the postgres driver. - // Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - // "INT", and "BIGINT". - string type = 2; -} - -// A single row from a sql result. -message SqlResultRow { - // List of values in a row of sql result. - repeated SqlResultValue values = 1; -} - -// A single value in a row from a sql result. -message SqlResultValue { - // The cell value represented in string format. - // Timestamps are converted to string using RFC3339Nano format. - optional string value = 1; - - // Set to true if cell value is null. - optional bool null_value = 2; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto deleted file mode 100644 index 9da438c4389..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1alpha; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; -option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "GeminiProto"; -option java_package = "com.google.cloud.alloydb.v1alpha"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; -option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; - -// Enum representing the type of GCA entitlement assigned to a resource. -enum GCAEntitlementType { - // No GCA entitlement is assigned. - GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0; - - // The resource is entitled to the GCA Standard Tier. - GCA_STANDARD = 1; -} - -// Deprecated and unused. This message will be removed in the near future. -message GeminiClusterConfig { - // Output only. Deprecated and unused. This field will be removed in the near - // future. - bool entitled = 1 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Deprecated and unused. This message will be removed in the near future. -message GeminiInstanceConfig { - // Output only. Deprecated and unused. This field will be removed in the near - // future. - bool entitled = 1 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Instance level configuration parameters related to the Gemini Cloud Assist -// product. -message GCAInstanceConfig { - // Output only. Represents the GCA entitlement state of the instance. - GCAEntitlementType gca_entitlement = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto deleted file mode 100644 index d6cb76972f3..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto +++ /dev/null @@ -1,1795 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1alpha/csql_resources.proto"; -import "google/cloud/alloydb/v1alpha/gemini.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/type/dayofweek.proto"; -import "google/type/timeofday.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; -option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.cloud.alloydb.v1alpha"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; -option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/Network" - pattern: "projects/{project}/global/networks/{network}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/ServiceAttachment" - pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" -}; - -// View on Instance. Pass this enum to rpcs that returns an Instance message to -// control which subsets of fields to get. -enum 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; -} - -// View on Cluster. Pass this enum to rpcs that returns a cluster message to -// control which subsets of fields to get. -enum 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; -} - -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // 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; -} - -// Subscription_type added to distinguish between Standard and Trial -// subscriptions. By default, a subscription type is considered STANDARD unless -// explicitly specified. -enum 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; -} - -// The username/password for a database user. Used for specifying initial -// users at cluster creation time. -message UserPassword { - // The database username. - string user = 1; - - // The initial password for the user. - string password = 2; -} - -// Subset of the source instance configuration that is available when reading -// the cluster resource. -message MigrationSource { - // Denote the type of migration source that created this cluster. - enum MigrationSourceType { - // Migration source is unknown. - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - - // DMS source means the cluster was created via DMS migration job. - DMS = 1; - } - - // Output only. The host and port of the on-premises instance in host:port - // format - string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Place holder for the external source identifier(e.g DMS job - // name) that created the cluster. - string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Type of migration source. - MigrationSourceType source_type = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// EncryptionConfig describes the encryption config of a cluster or a backup -// that is encrypted with a CMEK (customer-managed encryption key). -message EncryptionConfig { - // 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] - string kms_key_name = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; -} - -// EncryptionInfo describes the encryption information of a cluster or a backup. -message EncryptionInfo { - // Possible encryption types. - enum 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; - } - - // Output only. Type of encryption. - Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cloud KMS key versions that are being used to protect the - // database or the backup. - repeated string kms_key_versions = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// SSL configuration. -message SslConfig { - // SSL mode options. - enum 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 [deprecated = true]; - - // SSL connections are required. CA verification not enforced. - // Clients may use locally self-signed certificates (default psql client - // behavior). - SSL_MODE_REQUIRE = 2 [deprecated = true]; - - // 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 [deprecated = true]; - - // SSL connections are optional. CA verification not enforced. - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - - // SSL connections are required. CA verification not enforced. - ENCRYPTED_ONLY = 5; - } - - // Certificate Authority (CA) source for SSL/TLS certificates. - enum 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; - } - - // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - // supported currently, and is the default value. - CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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. -message AutomatedBackupPolicy { - // 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. - message WeeklySchedule { - // 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. - repeated google.type.TimeOfDay start_times = 1; - - // 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. - repeated google.type.DayOfWeek days_of_week = 2; - } - - // A time based retention policy specifies that all backups within a certain - // time period should be retained. - message TimeBasedRetention { - // The retention period. - google.protobuf.Duration retention_period = 1; - } - - // A quantity based policy specifies that a certain number of the most recent - // successful backups should be retained. - message QuantityBasedRetention { - // The number of backups to retain. - int32 count = 1; - } - - // The schedule for this automated backup policy. - // - // A schedule specifies times at which to start a backup. If a backup - // window is also provided, the backup is guaranteed to be started and - // completed within the start time plus the backup window. If the backup is - // not completed within the backup window it is marked as failed. - // - // If not set, the schedule defaults to a weekly schedule with one backup - // per day and a start time chosen arbitrarily. - oneof schedule { - // Weekly schedule for the Backup. - WeeklySchedule weekly_schedule = 2; - } - - // The retention policy for automated backups. - // - // The retention policy for a backup is fixed at the time the backup is - // created. Changes to this field only apply to new backups taken with the - // policy; the retentions of existing backups remain unchanged. - // - // If no retention policy is set, a default of 14 days is used. - oneof retention { - // Time-based Backup retention policy. - TimeBasedRetention time_based_retention = 4; - - // Quantity-based Backup retention policy to retain recent backups. - QuantityBasedRetention quantity_based_retention = 5; - } - - // Whether automated automated backups are enabled. If not set, defaults to - // true. - optional bool enabled = 1; - - // 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. - google.protobuf.Duration backup_window = 3; - - // 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. - EncryptionConfig encryption_config = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string location = 6; - - // Labels to apply to backups created using this configuration. - map labels = 7; -} - -// ContinuousBackupConfig describes the continuous backups recovery -// configurations of a cluster. -message ContinuousBackupConfig { - // Whether ContinuousBackup is enabled. - optional bool enabled = 1; - - // 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. - int32 recovery_window_days = 4; - - // 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. - EncryptionConfig encryption_config = 3; -} - -// ContinuousBackupInfo describes the continuous backup properties of a -// cluster. -message ContinuousBackupInfo { - // Output only. The encryption information for the WALs and backups required - // for ContinuousBackup. - EncryptionInfo encryption_info = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When ContinuousBackup was most recently enabled. Set to null - // if ContinuousBackup is not enabled. - google.protobuf.Timestamp enabled_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Days of the week on which a continuous backup is taken. - repeated google.type.DayOfWeek schedule = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp earliest_restorable_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message describing a BackupSource. -message BackupSource { - // 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. - string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The name of the backup resource with the format: - // * projects/{project}/locations/{region}/backups/{backup_id} - string backup_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; -} - -// Message describing a ContinuousBackupSource. -message ContinuousBackupSource { - // 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. - string cluster = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The point in time to restore to. - google.protobuf.Timestamp point_in_time = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// MaintenanceUpdatePolicy defines the policy for system updates. -message MaintenanceUpdatePolicy { - // MaintenanceWindow specifies a preferred day and time for maintenance. - message MaintenanceWindow { - // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. - google.type.DayOfWeek day = 1; - - // Preferred time to start the maintenance operation on the specified day. - // Maintenance will start within 1 hour of this time. - google.type.TimeOfDay start_time = 2; - } - - // 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. - message DenyMaintenancePeriod { - // 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 - google.type.Date start_date = 1; - - // 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 - google.type.Date end_date = 2; - - // 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 - google.type.TimeOfDay time = 3; - } - - // Preferred windows to perform maintenance. Currently limited to 1. - repeated MaintenanceWindow maintenance_windows = 1; - - // Periods to deny maintenance. Currently limited to 1. - repeated DenyMaintenancePeriod deny_maintenance_periods = 2; -} - -// 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. -message MaintenanceSchedule { - // Output only. The scheduled start time for the maintenance. - google.protobuf.Timestamp start_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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. -message Cluster { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Cluster" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}" - plural: "clusters" - singular: "cluster" - style: DECLARATIVE_FRIENDLY - }; - - // Metadata related to network configuration. - message NetworkConfig { - // 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. - string network = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // 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. - string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration information for the secondary cluster. This should be set - // if and only if the cluster is of type SECONDARY. - message SecondaryConfig { - // The name of the primary cluster name with the format: - // * projects/{project}/locations/{region}/clusters/{cluster_id} - string primary_cluster_name = 1 [(google.api.resource_reference) = { - type: "alloydb.googleapis.com/Cluster" - }]; - } - - // 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. - message PrimaryConfig { - // Output only. Names of the clusters that are replicating from this - // cluster. - repeated string secondary_cluster_names = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Cluster" - } - ]; - } - - // PscConfig contains PSC related configuration at a cluster level. - message PscConfig { - // Optional. Create an instance that allows connections from Private Service - // Connect endpoints to the instance. - bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The project number that needs to be allowlisted on the - // network attachment to enable outbound connectivity. - int64 service_owned_project_number = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Contains information and all metadata related to TRIAL clusters. - message TrialMetadata { - // start time of the trial cluster. - google.protobuf.Timestamp start_time = 1; - - // End time of the trial cluster. - google.protobuf.Timestamp end_time = 2; - - // Upgrade time of trial cluster to Standard cluster. - google.protobuf.Timestamp upgrade_time = 3; - - // grace end time of the cluster. - google.protobuf.Timestamp grace_end_time = 4; - } - - // Configuration for Dataplex integration. - message DataplexConfig { - // Dataplex is enabled by default for resources such as clusters and - // instances. This flag controls the integration of AlloyDB PG - // resources (like databases, schemas, and tables) with Dataplex." - bool enabled = 1; - } - - // Cluster State - enum 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; - } - - // Type of Cluster - enum 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; - } - - // In case of an imported cluster, this field contains information about the - // source this cluster was imported from. - oneof source { - // Output only. Cluster created from backup. - BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster created via DMS migration. - MigrationSource migration_source = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster created from CloudSQL snapshot. - CloudSQLBackupRunSource cloudsql_backup_run_source = 42 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Cluster. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Update time stamp - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 7; - - // Output only. The current serving state of the cluster. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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` - ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; - - NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string network = 10 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } - ]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 11; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 12; - - // 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. - bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. Initial user to setup during cluster creation. Required. - // If used in `RestoreCluster` this is ignored. - UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; - - // 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. - AutomatedBackupPolicy automated_backup_policy = 17; - - // SSL configuration for this AlloyDB cluster. - SslConfig ssl_config = 18 [deprecated = true]; - - // 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. - EncryptionConfig encryption_config = 19 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The encryption information for the cluster. - EncryptionInfo encryption_info = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Continuous backup configuration for this cluster. - ContinuousBackupConfig continuous_backup_config = 27 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Continuous backup properties for this cluster. - ContinuousBackupInfo continuous_backup_info = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cross Region replication config specific to SECONDARY cluster. - SecondaryConfig secondary_config = 22; - - // Output only. Cross Region replication config specific to PRIMARY cluster. - PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The configuration for Private Service Connect (PSC) for the - // cluster. - PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maintenance update policy determines when to allow or deny - // updates. - MaintenanceUpdatePolicy maintenance_update_policy = 32 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The maintenance schedule for the cluster, generated for a - // specific rollout if a maintenance window is set. - MaintenanceSchedule maintenance_schedule = 37 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Deprecated and unused. This field will be removed in the near - // future. - GeminiClusterConfig gemini_config = 36 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. Subscription type of the cluster. - SubscriptionType subscription_type = 38 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Metadata for free trial clusters - TrialMetadata trial_metadata = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Input only. Immutable. Tag keys/values directly bound to this - // resource. For example: - // ``` - // "123/environment": "production", - // "123/costCenter": "marketing" - // ``` - map tags = 41 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OPTIONAL - ]; - - // 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. - string service_account_email = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Configuration for Dataplex integration. - DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; -} - -// An Instance is a computing unit that an end customer can connect to. -// It's the main unit of computing resources in AlloyDB. -message Instance { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" - plural: "instances" - singular: "instance" - style: DECLARATIVE_FRIENDLY - }; - - // MachineConfig describes the configuration of a machine. - message MachineConfig { - // The number of CPU's in the VM instance. - int32 cpu_count = 1; - - // 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. - string machine_type = 4; - } - - // 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. - message Node { - // Output only. The Compute Engine zone of the VM e.g. "us-central1-b". - string zone_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the VM e.g. - // "test-read-0601-407e52be-ms3l". - string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The private IP address of the VM e.g. "10.57.0.34". - string ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // QueryInsights Instance specific configuration. - message QueryInsightsInstanceConfig { - // Record application tags for an instance. - // This flag is turned "on" by default. - optional bool record_application_tags = 2; - - // Record client address for an instance. Client address is PII information. - // This flag is turned "on" by default. - optional bool record_client_address = 3; - - // Query string length. The default value is 1024. - // Any integer between 256 and 4500 is considered valid. - uint32 query_string_length = 4; - - // 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. - optional uint32 query_plans_per_minute = 5; - } - - // Observability Instance specific configuration. - message ObservabilityInstanceConfig { - // Observability feature status for an instance. - // This flag is turned "off" by default. - optional bool enabled = 1; - - // Preserve comments in query string for an instance. - // This flag is turned "off" by default. - optional bool preserve_comments = 2; - - // 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. - optional bool track_wait_events = 3; - - // 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. - optional bool track_wait_event_types = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Query string length. The default value is 10k. - optional int32 max_query_string_length = 5; - - // Record application tags for an instance. - // This flag is turned "off" by default. - optional bool record_application_tags = 6; - - // 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. - optional int32 query_plans_per_minute = 7; - - // Track actively running queries on the instance. - // If not set, this flag is "off" by default. - optional bool track_active_queries = 8; - - // Track client address for an instance. - // If not set, default value is "off". - optional bool track_client_address = 9; - - // Whether assistive experiences are enabled for this AlloyDB instance. - optional bool assistive_experiences_enabled = 10; - } - - // Configuration for a read pool instance. - message ReadPoolConfig { - // Read capacity, i.e. number of nodes in a read pool instance. - int32 node_count = 1; - } - - // Policy to be used while updating the instance. - message UpdatePolicy { - // Specifies the available modes of update. - enum 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; - } - - // Mode for updating the instance. - Mode mode = 1; - } - - // Client connection configuration - message ClientConnectionConfig { - // Optional. Configuration to enforce connectors only (ex: AuthProxy) - // connections to the database. - bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. SSL configuration option for this instance. - SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for setting up a PSC interface to enable outbound - // connectivity. - message PscInterfaceConfig { - // 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. - string network_attachment_resource = 1; - } - - // Configuration for setting up PSC service automation. Consumer projects in - // the configs will be allowlisted automatically for the instance. - message PscAutoConnectionConfig { - // The consumer project to which the PSC service automation endpoint will - // be created. - string consumer_project = 1; - - // 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. - string consumer_network = 2; - - // Output only. The IP address of the PSC service automation endpoint. - string ip_address = 3 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - string status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string consumer_network_status = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // PscInstanceConfig contains PSC related configuration at an - // instance level. - message PscInstanceConfig { - // 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/` - string service_attachment_link = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "compute.googleapis.com/ServiceAttachment" - } - ]; - - // Optional. List of consumer projects that are allowed to create - // PSC endpoints to service-attachments to this instance. - repeated string allowed_consumer_projects = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The DNS name of the instance for PSC connectivity. - // Name convention: ...alloydb-psc.goog - string psc_dns_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - repeated PscInterfaceConfig psc_interface_configs = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configurations for setting up PSC service automation. - repeated PscAutoConnectionConfig psc_auto_connections = 9 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Metadata related to instance-level network configuration. - message InstanceNetworkConfig { - // AuthorizedNetwork contains metadata for an authorized network. - message AuthorizedNetwork { - // CIDR range for one authorzied network of the instance. - string cidr_range = 1 [(google.api.field_info).format = IPV4]; - } - - // Optional. A list of external network authorized to access this instance. - repeated AuthorizedNetwork authorized_external_networks = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enabling public ip for the instance. - bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enabling an outbound public IP address to support a database - // server sending requests out into the internet. - bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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}`. - string network = 4 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // 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])?. - string allocated_ip_range_override = 5 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for Managed Connection Pool (MCP). - message ConnectionPoolConfig { - // Optional. Whether to enable Managed Connection Pool (MCP). - bool enabled = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Connection Pool flags, as a list of "key": "value" pairs. - map flags = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The number of running poolers per instance. - int32 pooler_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Instance State - enum 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; - } - - // Type of an Instance - enum 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; - } - - // 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). - enum AvailabilityType { - // This is an unknown Availability type. - AVAILABILITY_TYPE_UNSPECIFIED = 0; - - // Zonal available instance. - ZONAL = 1; - - // Regional (or Highly) available instance. - REGIONAL = 2; - } - - // Specifies whether an instance needs to spin up. - enum ActivationPolicy { - // The policy is not specified. - ACTIVATION_POLICY_UNSPECIFIED = 0; - - // The instance is running. - ALWAYS = 1; - - // The instance is not running. - NEVER = 2; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Instance. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Update time stamp - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 7; - - // Output only. The current serving state of the instance. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The type of the instance. Specified at creation time. - InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; - - // Configurations for the machines that host the underlying - // database engine. - MachineConfig machine_config = 10; - - // 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). - AvailabilityType availability_type = 11; - - // 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. - string gce_zone = 12; - - // 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. - map database_flags = 13; - - // Output only. This is set for the read-write VM of the PRIMARY instance - // only. - Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of available read-only VMs in this instance, including - // the standby for a PRIMARY instance. - repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configuration for query insights. - QueryInsightsInstanceConfig query_insights_config = 21; - - // Configuration for observability. - ObservabilityInstanceConfig observability_config = 26; - - // Read pool instance configuration. - // This is required if the value of instanceType is READ_POOL. - ReadPoolConfig read_pool_config = 14; - - // Output only. The IP address for the Instance. - // This is the connection endpoint for an end-user application. - string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string public_ip_address = 27 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 17; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 18; - - // 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. - UpdatePolicy update_policy = 22; - - // Optional. Client connection specific configurations - ClientConnectionConfig client_connection_config = 23 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The configuration for Private Service Connect (PSC) for the - // instance. - PscInstanceConfig psc_instance_config = 28 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Instance-level network configuration. - InstanceNetworkConfig network_config = 29 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated and unused. This field will be removed in the near - // future. - GeminiInstanceConfig gemini_config = 33 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Output only. All outbound public IP addresses configured for the instance. - repeated string outbound_public_ip_addresses = 34 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - ActivationPolicy activation_policy = 35 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration for Managed Connection Pool (MCP). - ConnectionPoolConfig connection_pool_config = 37 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Configuration parameters related to Gemini Cloud Assist. - GCAInstanceConfig gca_config = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ConnectionInfo singleton resource. -// https://google.aip.dev/156 -message ConnectionInfo { - option (google.api.resource) = { - type: "alloydb.googleapis.com/ConnectionInfo" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" - plural: "connectionInfos" - singular: "connectionInfo" - }; - - // The name of the ConnectionInfo singleton resource, e.g.: - // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - // This field currently has no semantic meaning. - string name = 1; - - // 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. - string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string public_ip_address = 5 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - repeated string pem_certificate_chain = 3 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The unique ID of the Instance. - string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The DNS name to use with PSC for the Instance. - string psc_dns_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message describing Backup object -message Backup { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Backup" - pattern: "projects/{project}/locations/{location}/backups/{backup}" - plural: "backups" - singular: "backup" - style: DECLARATIVE_FRIENDLY - }; - - // 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) - message QuantityBasedExpiry { - // 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). - int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The length of the quantity-based queue, specified by the - // backup's retention policy. - int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Backup State - enum 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; - } - - // Backup Type - enum 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; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Backup. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the resource finished being created. - google.protobuf.Timestamp create_completion_time = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 6; - - // Output only. The current state of the backup. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The backup type, which suggests the trigger for the backup. - Type type = 8; - - // User-provided description of the backup. - string description = 9; - - // Output only. The system-generated UID of the cluster which was used to - // create this resource. - string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The full resource name of the backup source cluster - // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - string cluster_name = 10 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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. - bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - EncryptionConfig encryption_config = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 14; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 16; - - // Output only. The size of the backup in bytes. - int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp expiry_time = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - QuantityBasedExpiry expiry_quantity = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - DatabaseVersion database_version = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Input only. Immutable. Tag keys/values directly bound to this - // resource. For example: - // ``` - // "123/environment": "production", - // "123/costCenter": "marketing" - // ``` - map tags = 25 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// 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. -message SupportedDatabaseFlag { - option (google.api.resource) = { - type: "alloydb.googleapis.com/SupportedDatabaseFlag" - pattern: "projects/{project}/locations/{location}/flags/{flag}" - plural: "supportedDatabaseFlags" - singular: "supportedDatabaseFlag" - }; - - // Restrictions on STRING type values - message StringRestrictions { - // The list of allowed values, if bounded. This field will be empty - // if there is a unbounded number of allowed values. - repeated string allowed_values = 1; - } - - // Restrictions on INTEGER type values. - message IntegerRestrictions { - // The minimum value that can be specified, if applicable. - google.protobuf.Int64Value min_value = 1; - - // The maximum value that can be specified, if applicable. - google.protobuf.Int64Value max_value = 2; - } - - // 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". - enum 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; - } - - // The scope of the flag. - enum 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; - } - - // The restrictions on the flag value per type. - oneof restrictions { - // Restriction on STRING type value. - StringRestrictions string_restrictions = 7; - - // Restriction on INTEGER type value. - IntegerRestrictions integer_restrictions = 8; - } - - // The recommended value for the flag by type, if applicable. - oneof recommended_value { - // The recommended value for a STRING flag. - string recommended_string_value = 10; - - // The recommended value for an INTEGER flag. - google.protobuf.Int64Value recommended_integer_value = 11; - } - - // 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. - string name = 1; - - // The name of the database flag, e.g. "max_allowed_packets". - // The is a possibly key for the Instance.database_flags map field. - string flag_name = 2; - - ValueType value_type = 3; - - // Whether the database flag accepts multiple values. If true, - // a comma-separated list of stringified values may be specified. - bool accepts_multiple_values = 4; - - // Major database engine versions for which this flag is supported. - repeated DatabaseVersion supported_db_versions = 5; - - // 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). - bool requires_db_restart = 6; - - // The scope of the flag. - Scope scope = 9; -} - -// Message describing User object. -message User { - option (google.api.resource) = { - type: "alloydb.googleapis.com/User" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" - plural: "users" - singular: "user" - style: DECLARATIVE_FRIENDLY - }; - - // Enum that details the user type. - enum 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; - } - - // Output only. Name of the resource in the form of - // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. Password for the user. - string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; - - // Optional. List of database roles this user has. - // The database role strings are subject to the PostgreSQL naming conventions. - repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Type of this user. - UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Input only. If the user already exists and it has additional roles, keep - // them granted. - bool keep_extra_roles = 6 [(google.api.field_behavior) = INPUT_ONLY]; -} - -// Message describing Database object. -message Database { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Database" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}" - plural: "databases" - singular: "database" - style: DECLARATIVE_FRIENDLY - }; - - // Identifier. Name of the resource in the form of - // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. Immutable. Charset for the database. - // This field can contain any PostgreSQL supported charset name. - // Example values include "UTF8", "SQL_ASCII", etc. - string charset = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Immutable. lc_collate for the database. - // String sort order. - // Example values include "C", "POSIX", etc. - string collation = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Immutable. lc_ctype for the database. - // Character classification (What is a letter? The upper-case equivalent?). - // Example values include "C", "POSIX", etc. - string character_type = 4 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Whether the database is a template database. - // Deprecated in favor of is_template_database. - bool is_template = 5 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Input only. Immutable. Template of the database to be used for creating a - // new database. - string database_template = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Whether the database is a template database. - optional bool is_template_database = 7 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto deleted file mode 100644 index a25497c1ec0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto +++ /dev/null @@ -1,2305 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1alpha; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1alpha/data_model.proto"; -import "google/cloud/alloydb/v1alpha/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Alpha"; -option go_package = "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceProto"; -option java_package = "com.google.cloud.alloydb.v1alpha"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1alpha"; -option ruby_package = "Google::Cloud::AlloyDB::V1alpha"; - -// Service describing handlers for resources -service AlloyDBAdmin { - option (google.api.default_host) = "alloydb.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists Clusters in a given project and location. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/clusters" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Cluster in a given project and location. - rpc CreateCluster(CreateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/clusters" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Cluster. - rpc UpdateCluster(UpdateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}" - body: "cluster" - }; - option (google.api.method_signature) = "cluster,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Exports data from the cluster. - // Imperative only. - rpc ExportCluster(ExportClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:export" - body: "*" - }; - option (google.api.method_signature) = - "name,gcs_destination,database,csv_export_options,sql_export_options"; - option (google.longrunning.operation_info) = { - response_type: "ExportClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Imports data to the cluster. - // Imperative only. - rpc ImportCluster(ImportClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,gcs_uri,database,user"; - option (google.longrunning.operation_info) = { - response_type: "ImportClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Upgrades a single Cluster. - // Imperative only. - rpc UpgradeCluster(UpgradeClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1alpha/{name=projects/*/locations/*/clusters/*}:upgrade" - body: "*" - }; - option (google.api.method_signature) = "name,version"; - option (google.longrunning.operation_info) = { - response_type: "UpgradeClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Cluster. - rpc DeleteCluster(DeleteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Promotes a SECONDARY cluster. This turns down replication - // from the PRIMARY cluster and promotes a secondary cluster - // into its own standalone cluster. - // Imperative only. - rpc PromoteCluster(PromoteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc SwitchoverCluster(SwitchoverClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*}:switchover" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc RestoreCluster(RestoreClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/clusters:restore" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Creates a cluster of type SECONDARY in the given location using - // the primary cluster as the source. - rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Lists Instances in a given project and location. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Instance in a given project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Creates a new SECONDARY Instance in a given project and location. - rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc BatchCreateInstances(BatchCreateInstancesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" - body: "requests" - }; - option (google.longrunning.operation_info) = { - response_type: "BatchCreateInstancesResponse" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "instance,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Forces a Failover for a highly available instance. - // Failover promotes the HA standby instance as the new primary. - // Imperative only. - rpc FailoverInstance(FailoverInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Injects fault in an instance. - // Imperative only. - rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" - body: "*" - }; - option (google.api.method_signature) = "fault_type,name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Restart an Instance in a cluster. - // Imperative only. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Executes a SQL statement in a database inside an AlloyDB instance. - rpc ExecuteSql(ExecuteSqlRequest) returns (ExecuteSqlResponse) { - option (google.api.http) = { - post: "/v1alpha/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql" - body: "*" - }; - option (google.api.method_signature) = - "instance,database,user,sql_statement,password"; - } - - // Lists Backups in a given project and location. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Backup. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Backup in a given project and location. - rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/backups" - body: "backup" - }; - option (google.api.method_signature) = "parent,backup,backup_id"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Backup. - rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1alpha/{backup.name=projects/*/locations/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Backup. - rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Lists SupportedDatabaseFlags for a given project and location. - rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) - returns (ListSupportedDatabaseFlagsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - rpc GenerateClientCertificate(GenerateClientCertificateRequest) - returns (GenerateClientCertificateResponse) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Get instance metadata used for a connection. - rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Users in a given project and location. - rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single User. - rpc GetUser(GetUserRequest) returns (User) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new User in a given project, location, and cluster. - rpc CreateUser(CreateUserRequest) returns (User) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" - body: "user" - }; - option (google.api.method_signature) = "parent,user,user_id"; - } - - // Updates the parameters of a single User. - rpc UpdateUser(UpdateUserRequest) returns (User) { - option (google.api.http) = { - patch: "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}" - body: "user" - }; - option (google.api.method_signature) = "user,update_mask"; - } - - // Deletes a single User. - rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Databases in a given project and location. - rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a new Database in a given project, location, and cluster. - rpc CreateDatabase(CreateDatabaseRequest) returns (Database) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases" - body: "database" - }; - option (google.api.method_signature) = "parent,database,database_id"; - } -} - -// Message for requesting list of Clusters -message ListClustersRequest { - // 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/- - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Clusters -message ListClustersResponse { - // The list of Cluster - repeated Cluster clusters = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Cluster -message GetClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // Optional. The view of the cluster to return. Returns all default fields if - // not set. - ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -message CreateSecondaryClusterRequest { - // Required. The location of the new cluster. For the required - // format, see the comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object (the secondary cluster). - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Configuration of the requesting object (the secondary cluster). - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating a Cluster -message CreateClusterRequest { - // Required. The location of the new cluster. For the required format, see the - // comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a Cluster -message UpdateClusterRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Destination for Export. Export will be done to cloud storage. -message GcsDestination { - // 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`. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Export cluster request. -message ExportClusterRequest { - // Options for exporting data in CSV format. - message CsvExportOptions { - // Required. The SELECT query used to extract the data. - string select_query = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string field_delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string quote_character = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string escape_character = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Options for exporting data in SQL format. - message SqlExportOptions { - // Optional. Tables to export from. - repeated string tables = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, only export the schema. - optional bool schema_only = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, output commands to DROP all the dumped database - // objects prior to outputting the commands for creating them. - optional bool clean_target_objects = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, use DROP ... IF EXISTS commands to check for the - // object's existence before dropping it in clean_target_objects mode. - optional bool if_exist_target_objects = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Oneof field to support other destinations in future. - oneof destination { - // Required. Option to export data to cloud storage. - GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required field to specify export file type and options. - oneof export_options { - // Options for exporting data in CSV format. Required field to be set for - // CSV file type. - CsvExportOptions csv_export_options = 4; - - // Options for exporting data in SQL format. Required field to be set for - // SQL file type. - SqlExportOptions sql_export_options = 5; - } - - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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. - string database = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response of export cluster rpc. -message ExportClusterResponse { - // Oneof field to support other destinations in future. - oneof destination { - // Required. Option to export data to cloud storage. - GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Import cluster request. -message ImportClusterRequest { - // Options for importing data in SQL format. - message SqlImportOptions {} - - // Options for importing data in CSV format. - message CsvImportOptions { - // Required. The database table to import CSV file into. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The columns to which CSV data is imported. If not specified, - // all columns of the database table are loaded with CSV data. - repeated string columns = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string field_delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string quote_character = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string escape_character = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // oneof field to support various import formats like SQL and CSV. - oneof import_options { - // Options for importing data in SQL format. - SqlImportOptions sql_import_options = 4; - - // Options for importing data in CSV format. - CsvImportOptions csv_import_options = 7; - } - - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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`. - string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string database = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string user = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response of import rpc. -message ImportClusterResponse { - // Required. Size of the object downloaded from Google Cloud Storage in bytes. - int64 bytes_downloaded = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Upgrades a cluster. -message UpgradeClusterRequest { - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // Required. The version the cluster is going to be upgraded to. - DatabaseVersion version = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// UpgradeClusterResponse contains the response for upgrade cluster operation. -message UpgradeClusterResponse { - // Stage information for different stages in the upgrade process. - message StageInfo { - // The stage. - Stage stage = 1; - - // Status of the stage. - Status status = 2; - - // 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. - string logs_url = 3; - } - - // Details regarding the upgrade of instances associated with a cluster. - message InstanceUpgradeDetails { - // Normalized name of the instance. - string name = 1; - - // Upgrade status of the instance. - Status upgrade_status = 2; - - // Instance type. - Instance.InstanceType instance_type = 3; - } - - // Upgrade details of a cluster. This cluster can be primary or secondary. - message ClusterUpgradeDetails { - // Normalized name of the cluster - string name = 1; - - // Upgrade status of the cluster. - Status upgrade_status = 2; - - // Cluster type which can either be primary or secondary. - Cluster.ClusterType cluster_type = 3; - - // 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. - DatabaseVersion database_version = 4; - - // Array containing stage info associated with this cluster. - repeated StageInfo stage_info = 5; - - // Upgrade details of the instances directly associated with this cluster. - repeated InstanceUpgradeDetails instance_upgrade_details = 6; - } - - // Status of upgrade operation. - enum 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; - } - - // Stage in the upgrade. - enum 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; - } - - // Status of upgrade operation. - Status status = 1; - - // A user friendly message summarising the upgrade operation details and the - // next steps for the user if there is any. - string message = 2; - - // Array of upgrade details for the current cluster and all the secondary - // clusters associated with this cluster. - repeated ClusterUpgradeDetails cluster_upgrade_details = 3; -} - -// Message for deleting a Cluster -message DeleteClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to cascade delete child instances for given cluster. - bool force = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for switching over to a cluster -message SwitchoverClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for promoting a Cluster -message PromoteClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for restoring a Cluster from a backup or another cluster at a given -// point in time. -// NEXT_ID: 11 -message RestoreClusterRequest { - // Required. - // The source to import from. - oneof source { - // Backup source. - BackupSource backup_source = 4; - - // ContinuousBackup source. Continuous backup needs to be enabled in the - // source cluster for this operation to succeed. - ContinuousBackupSource continuous_backup_source = 8; - } - - // Required. The name of the parent resource. For the required format, see the - // comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for requesting list of Instances -message ListInstancesRequest { - // 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/- - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Instances -message ListInstancesResponse { - // The list of Instance - repeated Instance instances = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Instance -message GetInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // The view of the instance to return. - InstanceView view = 2; -} - -// Message for creating a Instance -message CreateInstanceRequest { - // Required. The name of the parent resource. For the required format, see the - // comment on the Instance.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. ID of the requesting object. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating a Secondary Instance -message CreateSecondaryInstanceRequest { - // Required. The name of the parent resource. For the required format, see the - // comment on the Instance.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. ID of the requesting object. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// See usage below for notes. -message CreateInstanceRequests { - // Required. Primary and read replica instances to be created. This list - // should not be empty. - repeated CreateInstanceRequest create_instance_requests = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// Message for creating a batch of instances under the specified cluster. -message BatchCreateInstancesRequest { - // Required. The name of the parent resource. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. Resources being created. - CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating batches of instances in a cluster. -message BatchCreateInstancesResponse { - // Created instances. - repeated Instance instances = 1; -} - -// Message for metadata that is specific to BatchCreateInstances API. -// NEXT_ID: 3 -message BatchCreateInstancesMetadata { - // 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. - repeated string instance_targets = 1; - - // 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. - map instance_statuses = 2; -} - -// 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. -message BatchCreateInstanceStatus { - // State contains all valid instance states for the BatchCreateInstances - // operation. This is mainly used for status reporting through the LRO - // metadata. - enum 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; - } - - // 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. - State state = 1; - - // DEPRECATED - Use the error field instead. - // Error, if any error occurred and is available, during instance creation. - string error_msg = 2; - - // The RPC status of the instance creation operation. This field will be - // present if an error happened during the instance creation. - google.rpc.Status error = 4; - - Instance.InstanceType type = 3; -} - -// Message for updating a Instance -message UpdateInstanceRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a Instance -message DeleteInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for triggering failover on an Instance -message FailoverInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for triggering fault injection on an instance -message InjectFaultRequest { - // FaultType contains all valid types of faults that can be injected to an - // instance. - enum FaultType { - // The fault type is unknown. - FAULT_TYPE_UNSPECIFIED = 0; - - // Stop the VM - STOP_VM = 1; - } - - // Required. The type of fault to be injected in an instance. - FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -message RestartInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - // restart upon. Applicable only to read instances. - repeated string node_ids = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for ExecuteSql rpc. -message ExecuteSqlRequest { - // Oneof field to support other credential mechanisms in future like - // SecretManager etc. - oneof user_credential { - // Optional. The database native user’s password. - string password = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The instance where the SQL will be executed. For the required - // format, see the comment on the Instance.name field. - string instance = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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. - string database = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string user = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. SQL statement to execute on database. Any valid statement is - // permitted, including DDL, DML, DQL statements. - string sql_statement = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If set, validates the sql statement by performing - // syntax and semantic validation and doesn't execute the query. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Execute a SQL statement response. -message ExecuteSqlResponse { - // SqlResult represents the results for the execution of sql statements. - repeated SqlResult sql_results = 1; - - // Any additional metadata information regarding the execution of the sql - // statement. - ExecuteSqlMetadata metadata = 3; -} - -// Any additional metadata information regarding the execution of the SQL -message ExecuteSqlMetadata { - // Status contains all valid Status a SQL execution can end up in. - enum 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; - } - - // 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." - string message = 1; - - // Set to true if SQL returned a result set larger than the acceptable - // response size limits and the result was truncated. - bool partial_result = 2; - - // The time duration taken to execute the sql statement. - google.protobuf.Duration sql_statement_execution_duration = 3; - - // Status of SQL execution. - Status status = 4; -} - -// Message for requesting list of Backups -message ListBackupsRequest { - // Required. Parent value for ListBackupsRequest - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Backup" - } - ]; - - // Requested page size. Server may return fewer items than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Filtering results - string filter = 4; - - // Hint for how to order the results - string order_by = 5; -} - -// Message for response to listing Backups -message ListBackupsResponse { - // The list of Backup - repeated Backup backups = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Backup -message GetBackupRequest { - // Required. Name of the resource - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; -} - -// Message for creating a Backup -message CreateBackupRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Backup" - } - ]; - - // Required. ID of the requesting object. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a Backup -message UpdateBackupRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a Backup -message DeleteBackupRequest { - // Required. Name of the resource. For the required format, see the comment on - // the Backup.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for listing the information about the supported Database flags. -message ListSupportedDatabaseFlagsRequest { - // 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. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" - } - ]; - - // Requested page size. Server may return fewer items than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. The scope for which supported flags are requested. If not - // specified, default is DATABASE. - SupportedDatabaseFlag.Scope scope = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing SupportedDatabaseFlags. -message ListSupportedDatabaseFlagsResponse { - // The list of SupportedDatabaseFlags. - repeated SupportedDatabaseFlag supported_database_flags = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; -} - -// Message for requests to generate a client certificate signed by the Cluster -// CA. -message GenerateClientCertificateRequest { - // Required. The name of the parent resource. The required format is: - // * projects/{project}/locations/{location}/clusters/{cluster} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A pem-encoded X.509 certificate signing request (CSR). It is - // recommended to use public_key instead. - string pem_csr = 3 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // 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. - google.protobuf.Duration cert_duration = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The public key from the client. - string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message returned by a GenerateClientCertificate operation. -message GenerateClientCertificateResponse { - // Output only. The pem-encoded, signed X.509 certificate. - string pem_certificate = 1 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - repeated string pem_certificate_chain = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The pem-encoded cluster ca X.509 certificate. - string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for GetConnectionInfo. -message GetConnectionInfoRequest { - // Required. The name of the parent resource. The required format is: - // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Request specific metadata, if any. - oneof request_specific { - // Output only. BatchCreateInstances related metadata. - BatchCreateInstancesMetadata batch_create_instances_metadata = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. PromoteClusterStatus related metadata. - PromoteClusterStatus promote_cluster_status = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. UpgradeClusterStatus related metadata. - UpgradeClusterStatus upgrade_cluster_status = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message for current status of the database during Promote Cluster operation. -message PromoteClusterStatus { - // State contains all valid states of the database during promote cluster - // operation. This is used for status reporting through the LRO metadata. - enum 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; - } - - // 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 - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message for current status of the Major Version Upgrade operation. -message UpgradeClusterStatus { - // Status of an upgrade stage. - message StageStatus { - // Timing information for the stage execution. - message StageSchedule { - // When the stage is expected to start. Set only if the stage has not - // started yet. - google.protobuf.Timestamp estimated_start_time = 1; - - // Actual start time of the stage. Set only if the stage has started. - google.protobuf.Timestamp actual_start_time = 2; - - // When the stage is expected to end. Set only if the stage has not - // completed yet. - google.protobuf.Timestamp estimated_end_time = 3; - - // Actual end time of the stage. Set only if the stage has completed. - google.protobuf.Timestamp actual_end_time = 4; - } - - // Stage specific status information, if any. - oneof stage_specific_status { - // Read pool instances upgrade metadata. - ReadPoolInstancesUpgradeStageStatus read_pool_instances_upgrade = 11; - } - - // Upgrade stage. - UpgradeClusterResponse.Stage stage = 1; - - // State of this stage. - UpgradeClusterResponse.Status state = 2; - - // Output only. Timing information for the stage execution. - StageSchedule schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Read pool instances upgrade specific status. - message ReadPoolInstancesUpgradeStageStatus { - // Upgrade stats for read pool instances. - message Stats { - // Number of read pool instances for which upgrade has not started. - int32 not_started = 1; - - // Number of read pool instances undergoing upgrade. - int32 ongoing = 2; - - // Number of read pool instances successfully upgraded. - int32 success = 3; - - // Number of read pool instances which failed to upgrade. - int32 failed = 4; - } - - // Read pool instances upgrade statistics. - Stats upgrade_stats = 1; - } - - // Cluster Major Version Upgrade state. - UpgradeClusterResponse.Status state = 1; - - // Whether the operation is cancellable. - bool cancellable = 2; - - // Source database major version. - DatabaseVersion source_version = 3; - - // Target database major version. - DatabaseVersion target_version = 4; - - // Status of all upgrade stages. - repeated StageStatus stages = 5; -} - -// Message for requesting list of Users -message ListUsersRequest { - // Required. Parent value for ListUsersRequest - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/User" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Users -message ListUsersResponse { - // The list of User - repeated User users = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a User -message GetUserRequest { - // Required. The name of the resource. For the required format, see the - // comment on the User.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } - ]; -} - -// Message for creating a User -message CreateUserRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/User" - } - ]; - - // Required. ID of the requesting object. - string user_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - User user = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a User -message UpdateUserRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - User user = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Allow missing fields in the update mask. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a User -message DeleteUserRequest { - // Required. The name of the resource. For the required format, see the - // comment on the User.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for ListDatabases request. -message ListDatabasesRequest { - // Required. Parent value for ListDatabasesRequest. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Database" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - // This field is currently not supported, its value will be ignored if passed. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for ListDatabases response. -message ListDatabasesResponse { - // The list of databases. - repeated Database databases = 1; - - // A token identifying the next page of results the server should return. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Message for CreateDatabase request. -message CreateDatabaseRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Database" - } - ]; - - // Required. ID of the requesting object. - string database_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created. - Database database = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto deleted file mode 100644 index 220a3f97801..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1beta; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; -option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "CsqlResourcesProto"; -option java_package = "com.google.cloud.alloydb.v1beta"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; -option ruby_package = "Google::Cloud::AlloyDB::V1beta"; - -// The source CloudSQL backup resource. -message CloudSQLBackupRunSource { - // The project ID of the source CloudSQL instance. This should be the same as - // the AlloyDB cluster's project. - string project = 1; - - // Required. The CloudSQL instance ID. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The CloudSQL backup run ID. - int64 backup_run_id = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto deleted file mode 100644 index d107bcf6180..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_service.proto +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1beta/csql_resources.proto"; -import "google/cloud/alloydb/v1beta/resources.proto"; -import "google/cloud/alloydb/v1beta/service.proto"; -import "google/longrunning/operations.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; -option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "CSQLServiceProto"; -option java_package = "com.google.cloud.alloydb.v1beta"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; -option ruby_package = "Google::Cloud::AlloyDB::V1beta"; - -// Service for interactions with CloudSQL. -service AlloyDBCSQLAdmin { - option (google.api.default_host) = "alloydb.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Restores an AlloyDB cluster from a CloudSQL resource. - rpc RestoreFromCloudSQL(RestoreFromCloudSQLRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL" - body: "*" - }; - option (google.api.method_signature) = "parent,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } -} - -// Message for registering Restoring from CloudSQL resource. -message RestoreFromCloudSQLRequest { - // The source CloudSQL resource to restore from. - oneof source { - // Cluster created from CloudSQL backup run. - CloudSQLBackupRunSource cloudsql_backup_run_source = 101; - } - - // Required. The location of the new cluster. For the required format, see the - // comment on Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto deleted file mode 100644 index fbbe75a363a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1beta; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; -option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "DataModelProto"; -option java_package = "com.google.cloud.alloydb.v1beta"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; -option ruby_package = "Google::Cloud::AlloyDB::V1beta"; - -// SqlResult represents the result for the execution of a sql statement. -message SqlResult { - // List of columns included in the result. This also includes the data type - // of the column. - repeated SqlResultColumn columns = 1; - - // Rows returned by the SQL statement. - repeated SqlResultRow rows = 2; -} - -// Contains the name and datatype of a column in a SQL Result. -message SqlResultColumn { - // Name of the column. - string name = 1; - - // Datatype of the column as reported by the postgres driver. - // Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - // "INT", and "BIGINT". - string type = 2; -} - -// A single row from a sql result. -message SqlResultRow { - // List of values in a row of sql result. - repeated SqlResultValue values = 1; -} - -// A single value in a row from a sql result. -message SqlResultValue { - // The cell value represented in string format. - // Timestamps are converted to string using RFC3339Nano format. - optional string value = 1; - - // Set to true if cell value is null. - optional bool null_value = 2; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto deleted file mode 100644 index 0e0c32dd2cf..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1beta; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; -option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "GeminiProto"; -option java_package = "com.google.cloud.alloydb.v1beta"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; -option ruby_package = "Google::Cloud::AlloyDB::V1beta"; - -// Enum representing the type of GCA entitlement assigned to a resource. -enum GCAEntitlementType { - // No GCA entitlement is assigned. - GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0; - - // The resource is entitled to the GCA Standard Tier. - GCA_STANDARD = 1; -} - -// Deprecated and unused. This message will be removed in the near future. -message GeminiClusterConfig { - // Output only. Deprecated and unused. This field will be removed in the near - // future. - bool entitled = 1 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Deprecated and unused. This message will be removed in the near future. -message GeminiInstanceConfig { - // Output only. Deprecated and unused. This field will be removed in the near - // future. - bool entitled = 1 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Instance level configuration parameters related to the Gemini Cloud Assist -// product. -message GCAInstanceConfig { - // Output only. Represents the GCA entitlement state of the instance. - GCAEntitlementType gca_entitlement = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto deleted file mode 100644 index 7b3ef0259b1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto +++ /dev/null @@ -1,1786 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1beta; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1beta/csql_resources.proto"; -import "google/cloud/alloydb/v1beta/gemini.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/type/dayofweek.proto"; -import "google/type/timeofday.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; -option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.cloud.alloydb.v1beta"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; -option ruby_package = "Google::Cloud::AlloyDB::V1beta"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/Network" - pattern: "projects/{project}/global/networks/{network}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/ServiceAttachment" - pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" -}; - -// View on Instance. Pass this enum to rpcs that returns an Instance message to -// control which subsets of fields to get. -enum 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; -} - -// View on Cluster. Pass this enum to rpcs that returns a cluster message to -// control which subsets of fields to get. -enum 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; -} - -// The supported database engine versions. -enum DatabaseVersion { - // This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0; - - // DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 [deprecated = true]; - - // 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; -} - -// Subscription_type added to distinguish between Standard and Trial -// subscriptions. By default, a subscription type is considered STANDARD unless -// explicitly specified. -enum 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; -} - -// The username/password for a database user. Used for specifying initial -// users at cluster creation time. -message UserPassword { - // The database username. - string user = 1; - - // The initial password for the user. - string password = 2; -} - -// Subset of the source instance configuration that is available when reading -// the cluster resource. -message MigrationSource { - // Denote the type of migration source that created this cluster. - enum MigrationSourceType { - // Migration source is unknown. - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0; - - // DMS source means the cluster was created via DMS migration job. - DMS = 1; - } - - // Output only. The host and port of the on-premises instance in host:port - // format - string host_port = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Place holder for the external source identifier(e.g DMS job - // name) that created the cluster. - string reference_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Type of migration source. - MigrationSourceType source_type = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// EncryptionConfig describes the encryption config of a cluster or a backup -// that is encrypted with a CMEK (customer-managed encryption key). -message EncryptionConfig { - // 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] - string kms_key_name = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; -} - -// EncryptionInfo describes the encryption information of a cluster or a backup. -message EncryptionInfo { - // Possible encryption types. - enum 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; - } - - // Output only. Type of encryption. - Type encryption_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cloud KMS key versions that are being used to protect the - // database or the backup. - repeated string kms_key_versions = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// SSL configuration. -message SslConfig { - // SSL mode options. - enum 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 [deprecated = true]; - - // SSL connections are required. CA verification not enforced. - // Clients may use locally self-signed certificates (default psql client - // behavior). - SSL_MODE_REQUIRE = 2 [deprecated = true]; - - // 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 [deprecated = true]; - - // SSL connections are optional. CA verification not enforced. - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4; - - // SSL connections are required. CA verification not enforced. - ENCRYPTED_ONLY = 5; - } - - // Certificate Authority (CA) source for SSL/TLS certificates. - enum 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; - } - - // Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - SslMode ssl_mode = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - // supported currently, and is the default value. - CaSource ca_source = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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. -message AutomatedBackupPolicy { - // 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. - message WeeklySchedule { - // 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. - repeated google.type.TimeOfDay start_times = 1; - - // 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. - repeated google.type.DayOfWeek days_of_week = 2; - } - - // A time based retention policy specifies that all backups within a certain - // time period should be retained. - message TimeBasedRetention { - // The retention period. - google.protobuf.Duration retention_period = 1; - } - - // A quantity based policy specifies that a certain number of the most recent - // successful backups should be retained. - message QuantityBasedRetention { - // The number of backups to retain. - int32 count = 1; - } - - // The schedule for this automated backup policy. - // - // A schedule specifies times at which to start a backup. If a backup - // window is also provided, the backup is guaranteed to be started and - // completed within the start time plus the backup window. If the backup is - // not completed within the backup window it is marked as failed. - // - // If not set, the schedule defaults to a weekly schedule with one backup - // per day and a start time chosen arbitrarily. - oneof schedule { - // Weekly schedule for the Backup. - WeeklySchedule weekly_schedule = 2; - } - - // The retention policy for automated backups. - // - // The retention policy for a backup is fixed at the time the backup is - // created. Changes to this field only apply to new backups taken with the - // policy; the retentions of existing backups remain unchanged. - // - // If no retention policy is set, a default of 14 days is used. - oneof retention { - // Time-based Backup retention policy. - TimeBasedRetention time_based_retention = 4; - - // Quantity-based Backup retention policy to retain recent backups. - QuantityBasedRetention quantity_based_retention = 5; - } - - // Whether automated automated backups are enabled. If not set, defaults to - // true. - optional bool enabled = 1; - - // 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. - google.protobuf.Duration backup_window = 3; - - // 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. - EncryptionConfig encryption_config = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string location = 6; - - // Labels to apply to backups created using this configuration. - map labels = 7; -} - -// ContinuousBackupConfig describes the continuous backups recovery -// configurations of a cluster. -message ContinuousBackupConfig { - // Whether ContinuousBackup is enabled. - optional bool enabled = 1; - - // 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. - int32 recovery_window_days = 4; - - // 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. - EncryptionConfig encryption_config = 3; -} - -// ContinuousBackupInfo describes the continuous backup properties of a -// cluster. -message ContinuousBackupInfo { - // Output only. The encryption information for the WALs and backups required - // for ContinuousBackup. - EncryptionInfo encryption_info = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When ContinuousBackup was most recently enabled. Set to null - // if ContinuousBackup is not enabled. - google.protobuf.Timestamp enabled_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Days of the week on which a continuous backup is taken. - repeated google.type.DayOfWeek schedule = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp earliest_restorable_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message describing a BackupSource. -message BackupSource { - // 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. - string backup_uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The name of the backup resource with the format: - // * projects/{project}/locations/{region}/backups/{backup_id} - string backup_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; -} - -// Message describing a ContinuousBackupSource. -message ContinuousBackupSource { - // 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. - string cluster = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The point in time to restore to. - google.protobuf.Timestamp point_in_time = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// MaintenanceUpdatePolicy defines the policy for system updates. -message MaintenanceUpdatePolicy { - // MaintenanceWindow specifies a preferred day and time for maintenance. - message MaintenanceWindow { - // Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. - google.type.DayOfWeek day = 1; - - // Preferred time to start the maintenance operation on the specified day. - // Maintenance will start within 1 hour of this time. - google.type.TimeOfDay start_time = 2; - } - - // 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. - message DenyMaintenancePeriod { - // 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 - google.type.Date start_date = 1; - - // 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 - google.type.Date end_date = 2; - - // 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 - google.type.TimeOfDay time = 3; - } - - // Preferred windows to perform maintenance. Currently limited to 1. - repeated MaintenanceWindow maintenance_windows = 1; - - // Periods to deny maintenance. Currently limited to 1. - repeated DenyMaintenancePeriod deny_maintenance_periods = 2; -} - -// 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. -message MaintenanceSchedule { - // Output only. The scheduled start time for the maintenance. - google.protobuf.Timestamp start_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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. -message Cluster { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Cluster" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}" - plural: "clusters" - singular: "cluster" - style: DECLARATIVE_FRIENDLY - }; - - // Metadata related to network configuration. - message NetworkConfig { - // 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. - string network = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // 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. - string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration information for the secondary cluster. This should be set - // if and only if the cluster is of type SECONDARY. - message SecondaryConfig { - // The name of the primary cluster name with the format: - // * projects/{project}/locations/{region}/clusters/{cluster_id} - string primary_cluster_name = 1 [(google.api.resource_reference) = { - type: "alloydb.googleapis.com/Cluster" - }]; - } - - // 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. - message PrimaryConfig { - // Output only. Names of the clusters that are replicating from this - // cluster. - repeated string secondary_cluster_names = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Cluster" - } - ]; - } - - // PscConfig contains PSC related configuration at a cluster level. - message PscConfig { - // Optional. Create an instance that allows connections from Private Service - // Connect endpoints to the instance. - bool psc_enabled = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The project number that needs to be allowlisted on the - // network attachment to enable outbound connectivity. - int64 service_owned_project_number = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Contains information and all metadata related to TRIAL clusters. - message TrialMetadata { - // start time of the trial cluster. - google.protobuf.Timestamp start_time = 1; - - // End time of the trial cluster. - google.protobuf.Timestamp end_time = 2; - - // Upgrade time of trial cluster to Standard cluster. - google.protobuf.Timestamp upgrade_time = 3; - - // grace end time of the cluster. - google.protobuf.Timestamp grace_end_time = 4; - } - - // Configuration for Dataplex integration. - message DataplexConfig { - // Dataplex is enabled by default for resources such as clusters and - // instances. This flag controls the integration of AlloyDB PG - // resources (like databases, schemas, and tables) with Dataplex." - bool enabled = 1; - } - - // Cluster State - enum 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; - } - - // Type of Cluster - enum 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; - } - - // In case of an imported cluster, this field contains information about the - // source this cluster was imported from. - oneof source { - // Output only. Cluster created from backup. - BackupSource backup_source = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster created via DMS migration. - MigrationSource migration_source = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster created from CloudSQL snapshot. - CloudSQLBackupRunSource cloudsql_backup_run_source = 42 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Cluster. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Update time stamp - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 7; - - // Output only. The current serving state of the cluster. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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` - ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; - - NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string network = 10 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } - ]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 11; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 12; - - // 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. - bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. Initial user to setup during cluster creation. Required. - // If used in `RestoreCluster` this is ignored. - UserPassword initial_user = 14 [(google.api.field_behavior) = INPUT_ONLY]; - - // 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. - AutomatedBackupPolicy automated_backup_policy = 17; - - // SSL configuration for this AlloyDB cluster. - SslConfig ssl_config = 18 [deprecated = true]; - - // 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. - EncryptionConfig encryption_config = 19 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The encryption information for the cluster. - EncryptionInfo encryption_info = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Continuous backup configuration for this cluster. - ContinuousBackupConfig continuous_backup_config = 27 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Continuous backup properties for this cluster. - ContinuousBackupInfo continuous_backup_info = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cross Region replication config specific to SECONDARY cluster. - SecondaryConfig secondary_config = 22; - - // Output only. Cross Region replication config specific to PRIMARY cluster. - PrimaryConfig primary_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The configuration for Private Service Connect (PSC) for the - // cluster. - PscConfig psc_config = 31 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maintenance update policy determines when to allow or deny - // updates. - MaintenanceUpdatePolicy maintenance_update_policy = 32 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The maintenance schedule for the cluster, generated for a - // specific rollout if a maintenance window is set. - MaintenanceSchedule maintenance_schedule = 37 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Deprecated and unused. This field will be removed in the near - // future. - GeminiClusterConfig gemini_config = 36 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. Subscription type of the cluster. - SubscriptionType subscription_type = 38 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Metadata for free trial clusters - TrialMetadata trial_metadata = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Input only. Immutable. Tag keys/values directly bound to this - // resource. For example: - // ``` - // "123/environment": "production", - // "123/costCenter": "marketing" - // ``` - map tags = 41 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OPTIONAL - ]; - - // 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. - string service_account_email = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Configuration for Dataplex integration. - DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; -} - -// An Instance is a computing unit that an end customer can connect to. -// It's the main unit of computing resources in AlloyDB. -message Instance { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}" - plural: "instances" - singular: "instance" - style: DECLARATIVE_FRIENDLY - }; - - // MachineConfig describes the configuration of a machine. - message MachineConfig { - // The number of CPU's in the VM instance. - int32 cpu_count = 1; - - // 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. - string machine_type = 4; - } - - // 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. - message Node { - // Output only. The Compute Engine zone of the VM e.g. "us-central1-b". - string zone_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the VM e.g. - // "test-read-0601-407e52be-ms3l". - string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The private IP address of the VM e.g. "10.57.0.34". - string ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // QueryInsights Instance specific configuration. - message QueryInsightsInstanceConfig { - // Record application tags for an instance. - // This flag is turned "on" by default. - optional bool record_application_tags = 2; - - // Record client address for an instance. Client address is PII information. - // This flag is turned "on" by default. - optional bool record_client_address = 3; - - // Query string length. The default value is 1024. - // Any integer between 256 and 4500 is considered valid. - uint32 query_string_length = 4; - - // 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. - optional uint32 query_plans_per_minute = 5; - } - - // Observability Instance specific configuration. - message ObservabilityInstanceConfig { - // Observability feature status for an instance. - // This flag is turned "off" by default. - optional bool enabled = 1; - - // Preserve comments in query string for an instance. - // This flag is turned "off" by default. - optional bool preserve_comments = 2; - - // 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. - optional bool track_wait_events = 3; - - // 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. - optional bool track_wait_event_types = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Query string length. The default value is 10k. - optional int32 max_query_string_length = 5; - - // Record application tags for an instance. - // This flag is turned "off" by default. - optional bool record_application_tags = 6; - - // 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. - optional int32 query_plans_per_minute = 7; - - // Track actively running queries on the instance. - // If not set, this flag is "off" by default. - optional bool track_active_queries = 8; - - // Track client address for an instance. - // If not set, default value is "off". - optional bool track_client_address = 9; - - // Whether assistive experiences are enabled for this AlloyDB instance. - optional bool assistive_experiences_enabled = 10; - } - - // Configuration for a read pool instance. - message ReadPoolConfig { - // Read capacity, i.e. number of nodes in a read pool instance. - int32 node_count = 1; - } - - // Policy to be used while updating the instance. - message UpdatePolicy { - // Specifies the available modes of update. - enum 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; - } - - // Mode for updating the instance. - Mode mode = 1; - } - - // Client connection configuration - message ClientConnectionConfig { - // Optional. Configuration to enforce connectors only (ex: AuthProxy) - // connections to the database. - bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. SSL configuration option for this instance. - SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for setting up a PSC interface to enable outbound - // connectivity. - message PscInterfaceConfig { - // 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. - string network_attachment_resource = 1; - } - - // Configuration for setting up PSC service automation. Consumer projects in - // the configs will be allowlisted automatically for the instance. - message PscAutoConnectionConfig { - // The consumer project to which the PSC service automation endpoint will - // be created. - string consumer_project = 1; - - // 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. - string consumer_network = 2; - - // Output only. The IP address of the PSC service automation endpoint. - string ip_address = 3 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - string status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string consumer_network_status = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // PscInstanceConfig contains PSC related configuration at an - // instance level. - message PscInstanceConfig { - // 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/` - string service_attachment_link = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "compute.googleapis.com/ServiceAttachment" - } - ]; - - // Optional. List of consumer projects that are allowed to create - // PSC endpoints to service-attachments to this instance. - repeated string allowed_consumer_projects = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The DNS name of the instance for PSC connectivity. - // Name convention: ...alloydb-psc.goog - string psc_dns_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - repeated PscInterfaceConfig psc_interface_configs = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configurations for setting up PSC service automation. - repeated PscAutoConnectionConfig psc_auto_connections = 9 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Metadata related to instance-level network configuration. - message InstanceNetworkConfig { - // AuthorizedNetwork contains metadata for an authorized network. - message AuthorizedNetwork { - // CIDR range for one authorzied network of the instance. - string cidr_range = 1 [(google.api.field_info).format = IPV4]; - } - - // Optional. A list of external network authorized to access this instance. - repeated AuthorizedNetwork authorized_external_networks = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enabling public ip for the instance. - bool enable_public_ip = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enabling an outbound public IP address to support a database - // server sending requests out into the internet. - bool enable_outbound_public_ip = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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}`. - string network = 4 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // 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])?. - string allocated_ip_range_override = 5 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for Managed Connection Pool (MCP). - message ConnectionPoolConfig { - // Optional. Whether to enable Managed Connection Pool (MCP). - bool enabled = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Connection Pool flags, as a list of "key": "value" pairs. - map flags = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The number of running poolers per instance. - int32 pooler_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Instance State - enum 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; - } - - // Type of an Instance - enum 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; - } - - // 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). - enum AvailabilityType { - // This is an unknown Availability type. - AVAILABILITY_TYPE_UNSPECIFIED = 0; - - // Zonal available instance. - ZONAL = 1; - - // Regional (or Highly) available instance. - REGIONAL = 2; - } - - // Specifies whether an instance needs to spin up. - enum ActivationPolicy { - // The policy is not specified. - ACTIVATION_POLICY_UNSPECIFIED = 0; - - // The instance is running. - ALWAYS = 1; - - // The instance is not running. - NEVER = 2; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Instance. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Update time stamp - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 7; - - // Output only. The current serving state of the instance. - State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The type of the instance. Specified at creation time. - InstanceType instance_type = 9 [(google.api.field_behavior) = REQUIRED]; - - // Configurations for the machines that host the underlying - // database engine. - MachineConfig machine_config = 10; - - // 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). - AvailabilityType availability_type = 11; - - // 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. - string gce_zone = 12; - - // 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. - map database_flags = 13; - - // Output only. This is set for the read-write VM of the PRIMARY instance - // only. - Node writable_node = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of available read-only VMs in this instance, including - // the standby for a PRIMARY instance. - repeated Node nodes = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configuration for query insights. - QueryInsightsInstanceConfig query_insights_config = 21; - - // Configuration for observability. - ObservabilityInstanceConfig observability_config = 26; - - // Read pool instance configuration. - // This is required if the value of instanceType is READ_POOL. - ReadPoolConfig read_pool_config = 14; - - // Output only. The IP address for the Instance. - // This is the connection endpoint for an end-user application. - string ip_address = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string public_ip_address = 27 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 17; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 18; - - // 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. - UpdatePolicy update_policy = 22; - - // Optional. Client connection specific configurations - ClientConnectionConfig client_connection_config = 23 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The configuration for Private Service Connect (PSC) for the - // instance. - PscInstanceConfig psc_instance_config = 28 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Instance-level network configuration. - InstanceNetworkConfig network_config = 29 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated and unused. This field will be removed in the near - // future. - GeminiInstanceConfig gemini_config = 33 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Output only. All outbound public IP addresses configured for the instance. - repeated string outbound_public_ip_addresses = 34 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - ActivationPolicy activation_policy = 35 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration for Managed Connection Pool (MCP). - ConnectionPoolConfig connection_pool_config = 37 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Configuration parameters related to Gemini Cloud Assist. - GCAInstanceConfig gca_config = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ConnectionInfo singleton resource. -// https://google.aip.dev/156 -message ConnectionInfo { - option (google.api.resource) = { - type: "alloydb.googleapis.com/ConnectionInfo" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo" - plural: "connectionInfos" - singular: "connectionInfo" - }; - - // The name of the ConnectionInfo singleton resource, e.g.: - // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo - // This field currently has no semantic meaning. - string name = 1; - - // 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. - string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - string public_ip_address = 5 [ - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // 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. - repeated string pem_certificate_chain = 3 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The unique ID of the Instance. - string instance_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The DNS name to use with PSC for the Instance. - string psc_dns_name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message describing Backup object -message Backup { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Backup" - pattern: "projects/{project}/locations/{location}/backups/{backup}" - plural: "backups" - singular: "backup" - style: DECLARATIVE_FRIENDLY - }; - - // 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) - message QuantityBasedExpiry { - // 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). - int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The length of the quantity-based queue, specified by the - // backup's retention policy. - int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Backup State - enum 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; - } - - // Backup Type - enum 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; - } - - // 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} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-settable and human-readable display name for the Backup. - string display_name = 2; - - // 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. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Create time stamp - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Delete time stamp - google.protobuf.Timestamp delete_time = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when the resource finished being created. - google.protobuf.Timestamp create_completion_time = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Labels as key value pairs - map labels = 6; - - // Output only. The current state of the backup. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The backup type, which suggests the trigger for the backup. - Type type = 8; - - // User-provided description of the backup. - string description = 9; - - // Output only. The system-generated UID of the cluster which was used to - // create this resource. - string cluster_uid = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The full resource name of the backup source cluster - // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). - string cluster_name = 10 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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. - bool reconciling = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - EncryptionConfig encryption_config = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // For Resource freshness validation (https://google.aip.dev/154) - string etag = 14; - - // Annotations to allow client tools to store small amount of arbitrary data. - // This is distinct from labels. - // https://google.aip.dev/128 - map annotations = 16; - - // Output only. The size of the backup in bytes. - int64 size_bytes = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.protobuf.Timestamp expiry_time = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - QuantityBasedExpiry expiry_quantity = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - DatabaseVersion database_version = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Input only. Immutable. Tag keys/values directly bound to this - // resource. For example: - // ``` - // "123/environment": "production", - // "123/costCenter": "marketing" - // ``` - map tags = 25 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// 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. -message SupportedDatabaseFlag { - option (google.api.resource) = { - type: "alloydb.googleapis.com/SupportedDatabaseFlag" - pattern: "projects/{project}/locations/{location}/flags/{flag}" - plural: "supportedDatabaseFlags" - singular: "supportedDatabaseFlag" - }; - - // Restrictions on STRING type values - message StringRestrictions { - // The list of allowed values, if bounded. This field will be empty - // if there is a unbounded number of allowed values. - repeated string allowed_values = 1; - } - - // Restrictions on INTEGER type values. - message IntegerRestrictions { - // The minimum value that can be specified, if applicable. - google.protobuf.Int64Value min_value = 1; - - // The maximum value that can be specified, if applicable. - google.protobuf.Int64Value max_value = 2; - } - - // 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". - enum 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; - } - - // The scope of the flag. - enum 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; - } - - // The restrictions on the flag value per type. - oneof restrictions { - // Restriction on STRING type value. - StringRestrictions string_restrictions = 7; - - // Restriction on INTEGER type value. - IntegerRestrictions integer_restrictions = 8; - } - - // The recommended value for the flag by type, if applicable. - oneof recommended_value { - // The recommended value for a STRING flag. - string recommended_string_value = 10; - - // The recommended value for an INTEGER flag. - google.protobuf.Int64Value recommended_integer_value = 11; - } - - // 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. - string name = 1; - - // The name of the database flag, e.g. "max_allowed_packets". - // The is a possibly key for the Instance.database_flags map field. - string flag_name = 2; - - ValueType value_type = 3; - - // Whether the database flag accepts multiple values. If true, - // a comma-separated list of stringified values may be specified. - bool accepts_multiple_values = 4; - - // Major database engine versions for which this flag is supported. - repeated DatabaseVersion supported_db_versions = 5; - - // 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). - bool requires_db_restart = 6; - - // The scope of the flag. - Scope scope = 9; -} - -// Message describing User object. -message User { - option (google.api.resource) = { - type: "alloydb.googleapis.com/User" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}" - plural: "users" - singular: "user" - style: DECLARATIVE_FRIENDLY - }; - - // Enum that details the user type. - enum 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; - } - - // Output only. Name of the resource in the form of - // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. Password for the user. - string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; - - // Optional. List of database roles this user has. - // The database role strings are subject to the PostgreSQL naming conventions. - repeated string database_roles = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Type of this user. - UserType user_type = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Input only. If the user already exists and it has additional roles, keep - // them granted. - bool keep_extra_roles = 6 [(google.api.field_behavior) = INPUT_ONLY]; -} - -// Message describing Database object. -message Database { - option (google.api.resource) = { - type: "alloydb.googleapis.com/Database" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}" - plural: "databases" - singular: "database" - style: DECLARATIVE_FRIENDLY - }; - - // Identifier. Name of the resource in the form of - // `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. Immutable. Charset for the database. - // This field can contain any PostgreSQL supported charset name. - // Example values include "UTF8", "SQL_ASCII", etc. - string charset = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Immutable. lc_collate for the database. - // String sort order. - // Example values include "C", "POSIX", etc. - string collation = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Immutable. lc_ctype for the database. - // Character classification (What is a letter? The upper-case equivalent?). - // Example values include "C", "POSIX", etc. - string character_type = 4 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Whether the database is a template database. - // Deprecated in favor of is_template_database. - bool is_template = 5 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Input only. Immutable. Template of the database to be used for creating a - // new database. - string database_template = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Optional. Whether the database is a template database. - optional bool is_template_database = 7 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto b/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto deleted file mode 100644 index 83dce61eb98..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto +++ /dev/null @@ -1,2305 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.alloydb.v1beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/alloydb/v1beta/data_model.proto"; -import "google/cloud/alloydb/v1beta/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.AlloyDb.V1Beta"; -option go_package = "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceProto"; -option java_package = "com.google.cloud.alloydb.v1beta"; -option php_namespace = "Google\\Cloud\\AlloyDb\\V1beta"; -option ruby_package = "Google::Cloud::AlloyDB::V1beta"; - -// Service describing handlers for resources -service AlloyDBAdmin { - option (google.api.default_host) = "alloydb.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists Clusters in a given project and location. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*}/clusters" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/locations/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Cluster in a given project and location. - rpc CreateCluster(CreateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*}/clusters" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Cluster. - rpc UpdateCluster(UpdateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}" - body: "cluster" - }; - option (google.api.method_signature) = "cluster,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Exports data from the cluster. - // Imperative only. - rpc ExportCluster(ExportClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*}:export" - body: "*" - }; - option (google.api.method_signature) = - "name,gcs_destination,database,csv_export_options,sql_export_options"; - option (google.longrunning.operation_info) = { - response_type: "ExportClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Imports data to the cluster. - // Imperative only. - rpc ImportCluster(ImportClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,gcs_uri,database,user"; - option (google.longrunning.operation_info) = { - response_type: "ImportClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Upgrades a single Cluster. - // Imperative only. - rpc UpgradeCluster(UpgradeClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade" - body: "*" - }; - option (google.api.method_signature) = "name,version"; - option (google.longrunning.operation_info) = { - response_type: "UpgradeClusterResponse" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Cluster. - rpc DeleteCluster(DeleteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta/{name=projects/*/locations/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Promotes a SECONDARY cluster. This turns down replication - // from the PRIMARY cluster and promotes a secondary cluster - // into its own standalone cluster. - // Imperative only. - rpc PromoteCluster(PromoteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*}:promote" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc SwitchoverCluster(SwitchoverClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*}:switchover" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc RestoreCluster(RestoreClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*}/clusters:restore" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Creates a cluster of type SECONDARY in the given location using - // the primary cluster as the source. - rpc CreateSecondaryCluster(CreateSecondaryClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster,cluster_id"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "OperationMetadata" - }; - } - - // Lists Instances in a given project and location. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Instance in a given project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Creates a new SECONDARY Instance in a given project and location. - rpc CreateSecondaryInstance(CreateSecondaryInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // 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. - rpc BatchCreateInstances(BatchCreateInstancesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate" - body: "requests" - }; - option (google.longrunning.operation_info) = { - response_type: "BatchCreateInstancesResponse" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "instance,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Forces a Failover for a highly available instance. - // Failover promotes the HA standby instance as the new primary. - // Imperative only. - rpc FailoverInstance(FailoverInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Injects fault in an instance. - // Imperative only. - rpc InjectFault(InjectFaultRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault" - body: "*" - }; - option (google.api.method_signature) = "fault_type,name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Restart an Instance in a cluster. - // Imperative only. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Executes a SQL statement in a database inside an AlloyDB instance. - rpc ExecuteSql(ExecuteSqlRequest) returns (ExecuteSqlResponse) { - option (google.api.http) = { - post: "/v1beta/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql" - body: "*" - }; - option (google.api.method_signature) = - "instance,database,user,sql_statement,password"; - } - - // Lists Backups in a given project and location. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single Backup. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/locations/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Backup in a given project and location. - rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*}/backups" - body: "backup" - }; - option (google.api.method_signature) = "parent,backup,backup_id"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single Backup. - rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta/{backup.name=projects/*/locations/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Backup. - rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta/{name=projects/*/locations/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Lists SupportedDatabaseFlags for a given project and location. - rpc ListSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest) - returns (ListSupportedDatabaseFlagsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" - }; - option (google.api.method_signature) = "parent"; - } - - // 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. - rpc GenerateClientCertificate(GenerateClientCertificateRequest) - returns (GenerateClientCertificateResponse) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Get instance metadata used for a connection. - rpc GetConnectionInfo(GetConnectionInfoRequest) returns (ConnectionInfo) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Users in a given project and location. - rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single User. - rpc GetUser(GetUserRequest) returns (User) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new User in a given project, location, and cluster. - rpc CreateUser(CreateUserRequest) returns (User) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" - body: "user" - }; - option (google.api.method_signature) = "parent,user,user_id"; - } - - // Updates the parameters of a single User. - rpc UpdateUser(UpdateUserRequest) returns (User) { - option (google.api.http) = { - patch: "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}" - body: "user" - }; - option (google.api.method_signature) = "user,update_mask"; - } - - // Deletes a single User. - rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Databases in a given project and location. - rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a new Database in a given project, location, and cluster. - rpc CreateDatabase(CreateDatabaseRequest) returns (Database) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases" - body: "database" - }; - option (google.api.method_signature) = "parent,database,database_id"; - } -} - -// Message for requesting list of Clusters -message ListClustersRequest { - // 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/- - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Clusters -message ListClustersResponse { - // The list of Cluster - repeated Cluster clusters = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Cluster -message GetClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // Optional. The view of the cluster to return. Returns all default fields if - // not set. - ClusterView view = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -message CreateSecondaryClusterRequest { - // Required. The location of the new cluster. For the required - // format, see the comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object (the secondary cluster). - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Configuration of the requesting object (the secondary cluster). - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating a Cluster -message CreateClusterRequest { - // Required. The location of the new cluster. For the required format, see the - // comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a Cluster -message UpdateClusterRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Destination for Export. Export will be done to cloud storage. -message GcsDestination { - // 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`. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Export cluster request. -message ExportClusterRequest { - // Options for exporting data in CSV format. - message CsvExportOptions { - // Required. The SELECT query used to extract the data. - string select_query = 1 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string field_delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string quote_character = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string escape_character = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Options for exporting data in SQL format. - message SqlExportOptions { - // Optional. Tables to export from. - repeated string tables = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, only export the schema. - optional bool schema_only = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, output commands to DROP all the dumped database - // objects prior to outputting the commands for creating them. - optional bool clean_target_objects = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true, use DROP ... IF EXISTS commands to check for the - // object's existence before dropping it in clean_target_objects mode. - optional bool if_exist_target_objects = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Oneof field to support other destinations in future. - oneof destination { - // Required. Option to export data to cloud storage. - GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required field to specify export file type and options. - oneof export_options { - // Options for exporting data in CSV format. Required field to be set for - // CSV file type. - CsvExportOptions csv_export_options = 4; - - // Options for exporting data in SQL format. Required field to be set for - // SQL file type. - SqlExportOptions sql_export_options = 5; - } - - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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. - string database = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response of export cluster rpc. -message ExportClusterResponse { - // Oneof field to support other destinations in future. - oneof destination { - // Required. Option to export data to cloud storage. - GcsDestination gcs_destination = 2 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Import cluster request. -message ImportClusterRequest { - // Options for importing data in SQL format. - message SqlImportOptions {} - - // Options for importing data in CSV format. - message CsvImportOptions { - // Required. The database table to import CSV file into. - string table = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The columns to which CSV data is imported. If not specified, - // all columns of the database table are loaded with CSV data. - repeated string columns = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string field_delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string quote_character = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string escape_character = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // oneof field to support various import formats like SQL and CSV. - oneof import_options { - // Options for importing data in SQL format. - SqlImportOptions sql_import_options = 4; - - // Options for importing data in CSV format. - CsvImportOptions csv_import_options = 7; - } - - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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`. - string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string database = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string user = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response of import rpc. -message ImportClusterResponse { - // Required. Size of the object downloaded from Google Cloud Storage in bytes. - int64 bytes_downloaded = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Upgrades a cluster. -message UpgradeClusterRequest { - // Required. The resource name of the cluster. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // Required. The version the cluster is going to be upgraded to. - DatabaseVersion version = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// UpgradeClusterResponse contains the response for upgrade cluster operation. -message UpgradeClusterResponse { - // Stage information for different stages in the upgrade process. - message StageInfo { - // The stage. - Stage stage = 1; - - // Status of the stage. - Status status = 2; - - // 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. - string logs_url = 3; - } - - // Details regarding the upgrade of instances associated with a cluster. - message InstanceUpgradeDetails { - // Normalized name of the instance. - string name = 1; - - // Upgrade status of the instance. - Status upgrade_status = 2; - - // Instance type. - Instance.InstanceType instance_type = 3; - } - - // Upgrade details of a cluster. This cluster can be primary or secondary. - message ClusterUpgradeDetails { - // Normalized name of the cluster - string name = 1; - - // Upgrade status of the cluster. - Status upgrade_status = 2; - - // Cluster type which can either be primary or secondary. - Cluster.ClusterType cluster_type = 3; - - // 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. - DatabaseVersion database_version = 4; - - // Array containing stage info associated with this cluster. - repeated StageInfo stage_info = 5; - - // Upgrade details of the instances directly associated with this cluster. - repeated InstanceUpgradeDetails instance_upgrade_details = 6; - } - - // Status of upgrade operation. - enum 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; - } - - // Stage in the upgrade. - enum 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; - } - - // Status of upgrade operation. - Status status = 1; - - // A user friendly message summarising the upgrade operation details and the - // next steps for the user if there is any. - string message = 2; - - // Array of upgrade details for the current cluster and all the secondary - // clusters associated with this cluster. - repeated ClusterUpgradeDetails cluster_upgrade_details = 3; -} - -// Message for deleting a Cluster -message DeleteClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to cascade delete child instances for given cluster. - bool force = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for switching over to a cluster -message SwitchoverClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for promoting a Cluster -message PromoteClusterRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Cluster.name field - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for restoring a Cluster from a backup or another cluster at a given -// point in time. -// NEXT_ID: 11 -message RestoreClusterRequest { - // Required. - // The source to import from. - oneof source { - // Backup source. - BackupSource backup_source = 4; - - // ContinuousBackup source. Continuous backup needs to be enabled in the - // source cluster for this operation to succeed. - ContinuousBackupSource continuous_backup_source = 8; - } - - // Required. The name of the parent resource. For the required format, see the - // comment on the Cluster.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Cluster" - } - ]; - - // Required. ID of the requesting object. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for requesting list of Instances -message ListInstancesRequest { - // 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/- - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Instances -message ListInstancesResponse { - // The list of Instance - repeated Instance instances = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Instance -message GetInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // The view of the instance to return. - InstanceView view = 2; -} - -// Message for creating a Instance -message CreateInstanceRequest { - // Required. The name of the parent resource. For the required format, see the - // comment on the Instance.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. ID of the requesting object. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating a Secondary Instance -message CreateSecondaryInstanceRequest { - // Required. The name of the parent resource. For the required format, see the - // comment on the Instance.name field. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. ID of the requesting object. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// See usage below for notes. -message CreateInstanceRequests { - // Required. Primary and read replica instances to be created. This list - // should not be empty. - repeated CreateInstanceRequest create_instance_requests = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// Message for creating a batch of instances under the specified cluster. -message BatchCreateInstancesRequest { - // Required. The name of the parent resource. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Instance" - } - ]; - - // Required. Resources being created. - CreateInstanceRequests requests = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for creating batches of instances in a cluster. -message BatchCreateInstancesResponse { - // Created instances. - repeated Instance instances = 1; -} - -// Message for metadata that is specific to BatchCreateInstances API. -// NEXT_ID: 3 -message BatchCreateInstancesMetadata { - // 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. - repeated string instance_targets = 1; - - // 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. - map instance_statuses = 2; -} - -// 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. -message BatchCreateInstanceStatus { - // State contains all valid instance states for the BatchCreateInstances - // operation. This is mainly used for status reporting through the LRO - // metadata. - enum 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; - } - - // 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. - State state = 1; - - // DEPRECATED - Use the error field instead. - // Error, if any error occurred and is available, during instance creation. - string error_msg = 2; - - // The RPC status of the instance creation operation. This field will be - // present if an error happened during the instance creation. - google.rpc.Status error = 4; - - Instance.InstanceType type = 3; -} - -// Message for updating a Instance -message UpdateInstanceRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a Instance -message DeleteInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for triggering failover on an Instance -message FailoverInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for triggering fault injection on an instance -message InjectFaultRequest { - // FaultType contains all valid types of faults that can be injected to an - // instance. - enum FaultType { - // The fault type is unknown. - FAULT_TYPE_UNSPECIFIED = 0; - - // Stop the VM - STOP_VM = 1; - } - - // Required. The type of fault to be injected in an instance. - FaultType fault_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -message RestartInstanceRequest { - // Required. The name of the resource. For the required format, see the - // comment on the Instance.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation, for example, permission - // checks and any other type of validation, but does not actually execute the - // create request. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - // restart upon. Applicable only to read instances. - repeated string node_ids = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for ExecuteSql rpc. -message ExecuteSqlRequest { - // Oneof field to support other credential mechanisms in future like - // SecretManager etc. - oneof user_credential { - // Optional. The database native user’s password. - string password = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The instance where the SQL will be executed. For the required - // format, see the comment on the Instance.name field. - string instance = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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. - string database = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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. - string user = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. SQL statement to execute on database. Any valid statement is - // permitted, including DDL, DML, DQL statements. - string sql_statement = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If set, validates the sql statement by performing - // syntax and semantic validation and doesn't execute the query. - bool validate_only = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Execute a SQL statement response. -message ExecuteSqlResponse { - // SqlResult represents the results for the execution of sql statements. - repeated SqlResult sql_results = 1; - - // Any additional metadata information regarding the execution of the sql - // statement. - ExecuteSqlMetadata metadata = 3; -} - -// Any additional metadata information regarding the execution of the SQL -message ExecuteSqlMetadata { - // Status contains all valid Status a SQL execution can end up in. - enum 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; - } - - // 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." - string message = 1; - - // Set to true if SQL returned a result set larger than the acceptable - // response size limits and the result was truncated. - bool partial_result = 2; - - // The time duration taken to execute the sql statement. - google.protobuf.Duration sql_statement_execution_duration = 3; - - // Status of SQL execution. - Status status = 4; -} - -// Message for requesting list of Backups -message ListBackupsRequest { - // Required. Parent value for ListBackupsRequest - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Backup" - } - ]; - - // Requested page size. Server may return fewer items than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Filtering results - string filter = 4; - - // Hint for how to order the results - string order_by = 5; -} - -// Message for response to listing Backups -message ListBackupsResponse { - // The list of Backup - repeated Backup backups = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a Backup -message GetBackupRequest { - // Required. Name of the resource - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; -} - -// Message for creating a Backup -message CreateBackupRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Backup" - } - ]; - - // Required. ID of the requesting object. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a Backup -message UpdateBackupRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a Backup -message DeleteBackupRequest { - // Required. Name of the resource. For the required format, see the comment on - // the Backup.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Backup" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string etag = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for listing the information about the supported Database flags. -message ListSupportedDatabaseFlagsRequest { - // 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. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/SupportedDatabaseFlag" - } - ]; - - // Requested page size. Server may return fewer items than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - string page_token = 3; - - // Optional. The scope for which supported flags are requested. If not - // specified, default is DATABASE. - SupportedDatabaseFlag.Scope scope = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing SupportedDatabaseFlags. -message ListSupportedDatabaseFlagsResponse { - // The list of SupportedDatabaseFlags. - repeated SupportedDatabaseFlag supported_database_flags = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; -} - -// Message for requests to generate a client certificate signed by the Cluster -// CA. -message GenerateClientCertificateRequest { - // Required. The name of the parent resource. The required format is: - // * projects/{project}/locations/{location}/clusters/{cluster} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/Cluster" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A pem-encoded X.509 certificate signing request (CSR). It is - // recommended to use public_key instead. - string pem_csr = 3 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // 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. - google.protobuf.Duration cert_duration = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The public key from the client. - string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message returned by a GenerateClientCertificate operation. -message GenerateClientCertificateResponse { - // Output only. The pem-encoded, signed X.509 certificate. - string pem_certificate = 1 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - repeated string pem_certificate_chain = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The pem-encoded cluster ca X.509 certificate. - string ca_cert = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for GetConnectionInfo. -message GetConnectionInfoRequest { - // Required. The name of the parent resource. The required format is: - // projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "alloydb.googleapis.com/Instance" - } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Request specific metadata, if any. - oneof request_specific { - // Output only. BatchCreateInstances related metadata. - BatchCreateInstancesMetadata batch_create_instances_metadata = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. PromoteClusterStatus related metadata. - PromoteClusterStatus promote_cluster_status = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. UpgradeClusterStatus related metadata. - UpgradeClusterStatus upgrade_cluster_status = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message for current status of the database during Promote Cluster operation. -message PromoteClusterStatus { - // State contains all valid states of the database during promote cluster - // operation. This is used for status reporting through the LRO metadata. - enum 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; - } - - // 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 - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message for current status of the Major Version Upgrade operation. -message UpgradeClusterStatus { - // Status of an upgrade stage. - message StageStatus { - // Timing information for the stage execution. - message StageSchedule { - // When the stage is expected to start. Set only if the stage has not - // started yet. - google.protobuf.Timestamp estimated_start_time = 1; - - // Actual start time of the stage. Set only if the stage has started. - google.protobuf.Timestamp actual_start_time = 2; - - // When the stage is expected to end. Set only if the stage has not - // completed yet. - google.protobuf.Timestamp estimated_end_time = 3; - - // Actual end time of the stage. Set only if the stage has completed. - google.protobuf.Timestamp actual_end_time = 4; - } - - // Stage specific status information, if any. - oneof stage_specific_status { - // Read pool instances upgrade metadata. - ReadPoolInstancesUpgradeStageStatus read_pool_instances_upgrade = 11; - } - - // Upgrade stage. - UpgradeClusterResponse.Stage stage = 1; - - // State of this stage. - UpgradeClusterResponse.Status state = 2; - - // Output only. Timing information for the stage execution. - StageSchedule schedule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Read pool instances upgrade specific status. - message ReadPoolInstancesUpgradeStageStatus { - // Upgrade stats for read pool instances. - message Stats { - // Number of read pool instances for which upgrade has not started. - int32 not_started = 1; - - // Number of read pool instances undergoing upgrade. - int32 ongoing = 2; - - // Number of read pool instances successfully upgraded. - int32 success = 3; - - // Number of read pool instances which failed to upgrade. - int32 failed = 4; - } - - // Read pool instances upgrade statistics. - Stats upgrade_stats = 1; - } - - // Cluster Major Version Upgrade state. - UpgradeClusterResponse.Status state = 1; - - // Whether the operation is cancellable. - bool cancellable = 2; - - // Source database major version. - DatabaseVersion source_version = 3; - - // Target database major version. - DatabaseVersion target_version = 4; - - // Status of all upgrade stages. - repeated StageStatus stages = 5; -} - -// Message for requesting list of Users -message ListUsersRequest { - // Required. Parent value for ListUsersRequest - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/User" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for response to listing Users -message ListUsersResponse { - // The list of User - repeated User users = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Message for getting a User -message GetUserRequest { - // Required. The name of the resource. For the required format, see the - // comment on the User.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } - ]; -} - -// Message for creating a User -message CreateUserRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/User" - } - ]; - - // Required. ID of the requesting object. - string user_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - User user = 3 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for updating a User -message UpdateUserRequest { - // 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. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The resource being updated - User user = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Allow missing fields in the update mask. - bool allow_missing = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a User -message DeleteUserRequest { - // Required. The name of the resource. For the required format, see the - // comment on the User.name field. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "alloydb.googleapis.com/User" } - ]; - - // 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). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the backend validates the request, but doesn't actually - // execute it. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for ListDatabases request. -message ListDatabasesRequest { - // Required. Parent value for ListDatabasesRequest. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Database" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - // This field is currently not supported, its value will be ignored if passed. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for ListDatabases response. -message ListDatabasesResponse { - // The list of databases. - repeated Database databases = 1; - - // A token identifying the next page of results the server should return. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Message for CreateDatabase request. -message CreateDatabaseRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "alloydb.googleapis.com/Database" - } - ]; - - // Required. ID of the requesting object. - string database_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created. - Database database = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts deleted file mode 100644 index 28c6c475c4e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/protos.d.ts +++ /dev/null @@ -1,54745 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace alloydb. */ - namespace alloydb { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a CloudSQLBackupRunSource. */ - interface ICloudSQLBackupRunSource { - - /** CloudSQLBackupRunSource project */ - project?: (string|null); - - /** CloudSQLBackupRunSource instanceId */ - instanceId?: (string|null); - - /** CloudSQLBackupRunSource backupRunId */ - backupRunId?: (number|Long|string|null); - } - - /** Represents a CloudSQLBackupRunSource. */ - class CloudSQLBackupRunSource implements ICloudSQLBackupRunSource { - - /** - * Constructs a new CloudSQLBackupRunSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICloudSQLBackupRunSource); - - /** CloudSQLBackupRunSource project. */ - public project: string; - - /** CloudSQLBackupRunSource instanceId. */ - public instanceId: string; - - /** CloudSQLBackupRunSource backupRunId. */ - public backupRunId: (number|Long|string); - - /** - * Creates a new CloudSQLBackupRunSource instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSQLBackupRunSource instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICloudSQLBackupRunSource): google.cloud.alloydb.v1.CloudSQLBackupRunSource; - - /** - * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. - * @param message CloudSQLBackupRunSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. - * @param message CloudSQLBackupRunSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CloudSQLBackupRunSource; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CloudSQLBackupRunSource; - - /** - * Verifies a CloudSQLBackupRunSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSQLBackupRunSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CloudSQLBackupRunSource; - - /** - * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. - * @param message CloudSQLBackupRunSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CloudSQLBackupRunSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSQLBackupRunSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSQLBackupRunSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AlloyDBCSQLAdmin */ - class AlloyDBCSQLAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new AlloyDBCSQLAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBCSQLAdmin; - - /** - * Calls RestoreFromCloudSQL. - * @param request RestoreFromCloudSQLRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreFromCloudSQL(request: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, callback: google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback): void; - - /** - * Calls RestoreFromCloudSQL. - * @param request RestoreFromCloudSQLRequest message or plain object - * @returns Promise - */ - public restoreFromCloudSQL(request: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest): Promise; - } - - namespace AlloyDBCSQLAdmin { - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBCSQLAdmin|restoreFromCloudSQL}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreFromCloudSQLCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a RestoreFromCloudSQLRequest. */ - interface IRestoreFromCloudSQLRequest { - - /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource */ - cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); - - /** RestoreFromCloudSQLRequest parent */ - parent?: (string|null); - - /** RestoreFromCloudSQLRequest clusterId */ - clusterId?: (string|null); - - /** RestoreFromCloudSQLRequest cluster */ - cluster?: (google.cloud.alloydb.v1.ICluster|null); - } - - /** Represents a RestoreFromCloudSQLRequest. */ - class RestoreFromCloudSQLRequest implements IRestoreFromCloudSQLRequest { - - /** - * Constructs a new RestoreFromCloudSQLRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest); - - /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource. */ - public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); - - /** RestoreFromCloudSQLRequest parent. */ - public parent: string; - - /** RestoreFromCloudSQLRequest clusterId. */ - public clusterId: string; - - /** RestoreFromCloudSQLRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** RestoreFromCloudSQLRequest source. */ - public source?: "cloudsqlBackupRunSource"; - - /** - * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreFromCloudSQLRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. - * @param message RestoreFromCloudSQLRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. - * @param message RestoreFromCloudSQLRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; - - /** - * Verifies a RestoreFromCloudSQLRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreFromCloudSQLRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.RestoreFromCloudSQLRequest; - - /** - * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. - * @param message RestoreFromCloudSQLRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.RestoreFromCloudSQLRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreFromCloudSQLRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreFromCloudSQLRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** InstanceView enum. */ - enum InstanceView { - INSTANCE_VIEW_UNSPECIFIED = 0, - INSTANCE_VIEW_BASIC = 1, - INSTANCE_VIEW_FULL = 2 - } - - /** ClusterView enum. */ - enum ClusterView { - CLUSTER_VIEW_UNSPECIFIED = 0, - CLUSTER_VIEW_BASIC = 1, - CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 - } - - /** DatabaseVersion enum. */ - enum DatabaseVersion { - DATABASE_VERSION_UNSPECIFIED = 0, - POSTGRES_13 = 1, - POSTGRES_14 = 2, - POSTGRES_15 = 3, - POSTGRES_16 = 4, - POSTGRES_17 = 5 - } - - /** SubscriptionType enum. */ - enum SubscriptionType { - SUBSCRIPTION_TYPE_UNSPECIFIED = 0, - STANDARD = 1, - TRIAL = 2 - } - - /** Properties of a UserPassword. */ - interface IUserPassword { - - /** UserPassword user */ - user?: (string|null); - - /** UserPassword password */ - password?: (string|null); - } - - /** Represents a UserPassword. */ - class UserPassword implements IUserPassword { - - /** - * Constructs a new UserPassword. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUserPassword); - - /** UserPassword user. */ - public user: string; - - /** UserPassword password. */ - public password: string; - - /** - * Creates a new UserPassword instance using the specified properties. - * @param [properties] Properties to set - * @returns UserPassword instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUserPassword): google.cloud.alloydb.v1.UserPassword; - - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UserPassword; - - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UserPassword; - - /** - * Verifies a UserPassword message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserPassword - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UserPassword; - - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @param message UserPassword - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserPassword to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserPassword - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MigrationSource. */ - interface IMigrationSource { - - /** MigrationSource hostPort */ - hostPort?: (string|null); - - /** MigrationSource referenceId */ - referenceId?: (string|null); - - /** MigrationSource sourceType */ - sourceType?: (google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|null); - } - - /** Represents a MigrationSource. */ - class MigrationSource implements IMigrationSource { - - /** - * Constructs a new MigrationSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IMigrationSource); - - /** MigrationSource hostPort. */ - public hostPort: string; - - /** MigrationSource referenceId. */ - public referenceId: string; - - /** MigrationSource sourceType. */ - public sourceType: (google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1.MigrationSource.MigrationSourceType); - - /** - * Creates a new MigrationSource instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationSource instance - */ - public static create(properties?: google.cloud.alloydb.v1.IMigrationSource): google.cloud.alloydb.v1.MigrationSource; - - /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MigrationSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MigrationSource; - - /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MigrationSource; - - /** - * Verifies a MigrationSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MigrationSource; - - /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @param message MigrationSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MigrationSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MigrationSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MigrationSource { - - /** MigrationSourceType enum. */ - enum MigrationSourceType { - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, - DMS = 1 - } - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IEncryptionConfig); - - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.IEncryptionConfig): google.cloud.alloydb.v1.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { - - /** EncryptionInfo encryptionType */ - encryptionType?: (google.cloud.alloydb.v1.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1.EncryptionInfo.Type|null); - - /** EncryptionInfo kmsKeyVersions */ - kmsKeyVersions?: (string[]|null); - } - - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { - - /** - * Constructs a new EncryptionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IEncryptionInfo); - - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.cloud.alloydb.v1.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1.EncryptionInfo.Type); - - /** EncryptionInfo kmsKeyVersions. */ - public kmsKeyVersions: string[]; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1.IEncryptionInfo): google.cloud.alloydb.v1.EncryptionInfo; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.EncryptionInfo; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.EncryptionInfo; - - /** - * Verifies an EncryptionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.EncryptionInfo; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EncryptionInfo { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } - - /** Properties of a SslConfig. */ - interface ISslConfig { - - /** SslConfig sslMode */ - sslMode?: (google.cloud.alloydb.v1.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1.SslConfig.SslMode|null); - - /** SslConfig caSource */ - caSource?: (google.cloud.alloydb.v1.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1.SslConfig.CaSource|null); - } - - /** Represents a SslConfig. */ - class SslConfig implements ISslConfig { - - /** - * Constructs a new SslConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISslConfig); - - /** SslConfig sslMode. */ - public sslMode: (google.cloud.alloydb.v1.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1.SslConfig.SslMode); - - /** SslConfig caSource. */ - public caSource: (google.cloud.alloydb.v1.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1.SslConfig.CaSource); - - /** - * Creates a new SslConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SslConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISslConfig): google.cloud.alloydb.v1.SslConfig; - - /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SslConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SslConfig; - - /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SslConfig; - - /** - * Verifies a SslConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SslConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SslConfig; - - /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @param message SslConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SslConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SslConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SslConfig { - - /** SslMode enum. */ - enum SslMode { - SSL_MODE_UNSPECIFIED = 0, - SSL_MODE_ALLOW = 1, - SSL_MODE_REQUIRE = 2, - SSL_MODE_VERIFY_CA = 3, - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, - ENCRYPTED_ONLY = 5 - } - - /** CaSource enum. */ - enum CaSource { - CA_SOURCE_UNSPECIFIED = 0, - CA_SOURCE_MANAGED = 1 - } - } - - /** Properties of an AutomatedBackupPolicy. */ - interface IAutomatedBackupPolicy { - - /** AutomatedBackupPolicy weeklySchedule */ - weeklySchedule?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention */ - timeBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention */ - quantityBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled */ - enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow */ - backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location */ - location?: (string|null); - - /** AutomatedBackupPolicy labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents an AutomatedBackupPolicy. */ - class AutomatedBackupPolicy implements IAutomatedBackupPolicy { - - /** - * Constructs a new AutomatedBackupPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IAutomatedBackupPolicy); - - /** AutomatedBackupPolicy weeklySchedule. */ - public weeklySchedule?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention. */ - public timeBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention. */ - public quantityBasedRetention?: (google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled. */ - public enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow. */ - public backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location. */ - public location: string; - - /** AutomatedBackupPolicy labels. */ - public labels: { [k: string]: string }; - - /** AutomatedBackupPolicy schedule. */ - public schedule?: "weeklySchedule"; - - /** AutomatedBackupPolicy retention. */ - public retention?: ("timeBasedRetention"|"quantityBasedRetention"); - - /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AutomatedBackupPolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1.IAutomatedBackupPolicy): google.cloud.alloydb.v1.AutomatedBackupPolicy; - - /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy; - - /** - * Verifies an AutomatedBackupPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutomatedBackupPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy; - - /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @param message AutomatedBackupPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutomatedBackupPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutomatedBackupPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutomatedBackupPolicy { - - /** Properties of a WeeklySchedule. */ - interface IWeeklySchedule { - - /** WeeklySchedule startTimes */ - startTimes?: (google.type.ITimeOfDay[]|null); - - /** WeeklySchedule daysOfWeek */ - daysOfWeek?: (google.type.DayOfWeek[]|null); - } - - /** Represents a WeeklySchedule. */ - class WeeklySchedule implements IWeeklySchedule { - - /** - * Constructs a new WeeklySchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule); - - /** WeeklySchedule startTimes. */ - public startTimes: google.type.ITimeOfDay[]; - - /** WeeklySchedule daysOfWeek. */ - public daysOfWeek: google.type.DayOfWeek[]; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns WeeklySchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Verifies a WeeklySchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeeklySchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @param message WeeklySchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeeklySchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WeeklySchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeBasedRetention. */ - interface ITimeBasedRetention { - - /** TimeBasedRetention retentionPeriod */ - retentionPeriod?: (google.protobuf.IDuration|null); - } - - /** Represents a TimeBasedRetention. */ - class TimeBasedRetention implements ITimeBasedRetention { - - /** - * Constructs a new TimeBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention); - - /** TimeBasedRetention retentionPeriod. */ - public retentionPeriod?: (google.protobuf.IDuration|null); - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Verifies a TimeBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @param message TimeBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QuantityBasedRetention. */ - interface IQuantityBasedRetention { - - /** QuantityBasedRetention count */ - count?: (number|null); - } - - /** Represents a QuantityBasedRetention. */ - class QuantityBasedRetention implements IQuantityBasedRetention { - - /** - * Constructs a new QuantityBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention); - - /** QuantityBasedRetention count. */ - public count: number; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Verifies a QuantityBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @param message QuantityBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ContinuousBackupConfig. */ - interface IContinuousBackupConfig { - - /** ContinuousBackupConfig enabled */ - enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays */ - recoveryWindowDays?: (number|null); - - /** ContinuousBackupConfig encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - } - - /** Represents a ContinuousBackupConfig. */ - class ContinuousBackupConfig implements IContinuousBackupConfig { - - /** - * Constructs a new ContinuousBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupConfig); - - /** ContinuousBackupConfig enabled. */ - public enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays. */ - public recoveryWindowDays: number; - - /** ContinuousBackupConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupConfig): google.cloud.alloydb.v1.ContinuousBackupConfig; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupConfig; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupConfig; - - /** - * Verifies a ContinuousBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupConfig; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @param message ContinuousBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContinuousBackupInfo. */ - interface IContinuousBackupInfo { - - /** ContinuousBackupInfo encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime */ - enabledTime?: (google.protobuf.ITimestamp|null); - - /** ContinuousBackupInfo schedule */ - schedule?: (google.type.DayOfWeek[]|null); - - /** ContinuousBackupInfo earliestRestorableTime */ - earliestRestorableTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ContinuousBackupInfo. */ - class ContinuousBackupInfo implements IContinuousBackupInfo { - - /** - * Constructs a new ContinuousBackupInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupInfo); - - /** ContinuousBackupInfo encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime. */ - public enabledTime?: (google.protobuf.ITimestamp|null); - - /** ContinuousBackupInfo schedule. */ - public schedule: google.type.DayOfWeek[]; - - /** ContinuousBackupInfo earliestRestorableTime. */ - public earliestRestorableTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupInfo): google.cloud.alloydb.v1.ContinuousBackupInfo; - - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupInfo; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupInfo; - - /** - * Verifies a ContinuousBackupInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupInfo; - - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @param message ContinuousBackupInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupSource. */ - interface IBackupSource { - - /** BackupSource backupUid */ - backupUid?: (string|null); - - /** BackupSource backupName */ - backupName?: (string|null); - } - - /** Represents a BackupSource. */ - class BackupSource implements IBackupSource { - - /** - * Constructs a new BackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IBackupSource); - - /** BackupSource backupUid. */ - public backupUid: string; - - /** BackupSource backupName. */ - public backupName: string; - - /** - * Creates a new BackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1.IBackupSource): google.cloud.alloydb.v1.BackupSource; - - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BackupSource; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BackupSource; - - /** - * Verifies a BackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BackupSource; - - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @param message BackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContinuousBackupSource. */ - interface IContinuousBackupSource { - - /** ContinuousBackupSource cluster */ - cluster?: (string|null); - - /** ContinuousBackupSource pointInTime */ - pointInTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ContinuousBackupSource. */ - class ContinuousBackupSource implements IContinuousBackupSource { - - /** - * Constructs a new ContinuousBackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IContinuousBackupSource); - - /** ContinuousBackupSource cluster. */ - public cluster: string; - - /** ContinuousBackupSource pointInTime. */ - public pointInTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ContinuousBackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1.IContinuousBackupSource): google.cloud.alloydb.v1.ContinuousBackupSource; - - /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ContinuousBackupSource; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ContinuousBackupSource; - - /** - * Verifies a ContinuousBackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ContinuousBackupSource; - - /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @param message ContinuousBackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MaintenanceUpdatePolicy. */ - interface IMaintenanceUpdatePolicy { - - /** MaintenanceUpdatePolicy maintenanceWindows */ - maintenanceWindows?: (google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); - - /** MaintenanceUpdatePolicy denyMaintenancePeriods */ - denyMaintenancePeriods?: (google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]|null); - } - - /** Represents a MaintenanceUpdatePolicy. */ - class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { - - /** - * Constructs a new MaintenanceUpdatePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy); - - /** MaintenanceUpdatePolicy maintenanceWindows. */ - public maintenanceWindows: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow[]; - - /** MaintenanceUpdatePolicy denyMaintenancePeriods. */ - public denyMaintenancePeriods: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]; - - /** - * Creates a new MaintenanceUpdatePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceUpdatePolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; - - /** - * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. - * @param message MaintenanceUpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. - * @param message MaintenanceUpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; - - /** - * Verifies a MaintenanceUpdatePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceUpdatePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceUpdatePolicy; - - /** - * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. - * @param message MaintenanceUpdatePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceUpdatePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceUpdatePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MaintenanceUpdatePolicy { - - /** Properties of a MaintenanceWindow. */ - interface IMaintenanceWindow { - - /** MaintenanceWindow day */ - day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); - - /** MaintenanceWindow startTime */ - startTime?: (google.type.ITimeOfDay|null); - } - - /** Represents a MaintenanceWindow. */ - class MaintenanceWindow implements IMaintenanceWindow { - - /** - * Constructs a new MaintenanceWindow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow); - - /** MaintenanceWindow day. */ - public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); - - /** MaintenanceWindow startTime. */ - public startTime?: (google.type.ITimeOfDay|null); - - /** - * Creates a new MaintenanceWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceWindow instance - */ - public static create(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Verifies a MaintenanceWindow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceWindow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @param message MaintenanceWindow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceWindow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DenyMaintenancePeriod. */ - interface IDenyMaintenancePeriod { - - /** DenyMaintenancePeriod startDate */ - startDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod endDate */ - endDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod time */ - time?: (google.type.ITimeOfDay|null); - } - - /** Represents a DenyMaintenancePeriod. */ - class DenyMaintenancePeriod implements IDenyMaintenancePeriod { - - /** - * Constructs a new DenyMaintenancePeriod. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod); - - /** DenyMaintenancePeriod startDate. */ - public startDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod endDate. */ - public endDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod time. */ - public time?: (google.type.ITimeOfDay|null); - - /** - * Creates a new DenyMaintenancePeriod instance using the specified properties. - * @param [properties] Properties to set - * @returns DenyMaintenancePeriod instance - */ - public static create(properties?: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @param message DenyMaintenancePeriod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @param message DenyMaintenancePeriod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Verifies a DenyMaintenancePeriod message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DenyMaintenancePeriod - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. - * @param message DenyMaintenancePeriod - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DenyMaintenancePeriod to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DenyMaintenancePeriod - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a MaintenanceSchedule. */ - interface IMaintenanceSchedule { - - /** MaintenanceSchedule startTime */ - startTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a MaintenanceSchedule. */ - class MaintenanceSchedule implements IMaintenanceSchedule { - - /** - * Constructs a new MaintenanceSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IMaintenanceSchedule); - - /** MaintenanceSchedule startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new MaintenanceSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceSchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1.IMaintenanceSchedule): google.cloud.alloydb.v1.MaintenanceSchedule; - - /** - * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. - * @param message MaintenanceSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. - * @param message MaintenanceSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.MaintenanceSchedule; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.MaintenanceSchedule; - - /** - * Verifies a MaintenanceSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.MaintenanceSchedule; - - /** - * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. - * @param message MaintenanceSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Cluster. */ - interface ICluster { - - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); - - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1.IMigrationSource|null); - - /** Cluster cloudsqlBackupRunSource */ - cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); - - /** Cluster name */ - name?: (string|null); - - /** Cluster displayName */ - displayName?: (string|null); - - /** Cluster uid */ - uid?: (string|null); - - /** Cluster createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels */ - labels?: ({ [k: string]: string }|null); - - /** Cluster state */ - state?: (google.cloud.alloydb.v1.Cluster.State|keyof typeof google.cloud.alloydb.v1.Cluster.State|null); - - /** Cluster clusterType */ - clusterType?: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType|null); - - /** Cluster databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); - - /** Cluster networkConfig */ - networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); - - /** Cluster network */ - network?: (string|null); - - /** Cluster etag */ - etag?: (string|null); - - /** Cluster annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Cluster reconciling */ - reconciling?: (boolean|null); - - /** Cluster initialUser */ - initialUser?: (google.cloud.alloydb.v1.IUserPassword|null); - - /** Cluster automatedBackupPolicy */ - automatedBackupPolicy?: (google.cloud.alloydb.v1.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig */ - sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); - - /** Cluster encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** Cluster encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig */ - continuousBackupConfig?: (google.cloud.alloydb.v1.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo */ - continuousBackupInfo?: (google.cloud.alloydb.v1.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig */ - secondaryConfig?: (google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig */ - primaryConfig?: (google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null); - - /** Cluster satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Cluster pscConfig */ - pscConfig?: (google.cloud.alloydb.v1.Cluster.IPscConfig|null); - - /** Cluster maintenanceUpdatePolicy */ - maintenanceUpdatePolicy?: (google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule */ - maintenanceSchedule?: (google.cloud.alloydb.v1.IMaintenanceSchedule|null); - - /** Cluster subscriptionType */ - subscriptionType?: (google.cloud.alloydb.v1.SubscriptionType|keyof typeof google.cloud.alloydb.v1.SubscriptionType|null); - - /** Cluster trialMetadata */ - trialMetadata?: (google.cloud.alloydb.v1.Cluster.ITrialMetadata|null); - - /** Cluster tags */ - tags?: ({ [k: string]: string }|null); - - /** Cluster dataplexConfig */ - dataplexConfig?: (google.cloud.alloydb.v1.Cluster.IDataplexConfig|null); - } - - /** Represents a Cluster. */ - class Cluster implements ICluster { - - /** - * Constructs a new Cluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICluster); - - /** Cluster backupSource. */ - public backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); - - /** Cluster migrationSource. */ - public migrationSource?: (google.cloud.alloydb.v1.IMigrationSource|null); - - /** Cluster cloudsqlBackupRunSource. */ - public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null); - - /** Cluster name. */ - public name: string; - - /** Cluster displayName. */ - public displayName: string; - - /** Cluster uid. */ - public uid: string; - - /** Cluster createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels. */ - public labels: { [k: string]: string }; - - /** Cluster state. */ - public state: (google.cloud.alloydb.v1.Cluster.State|keyof typeof google.cloud.alloydb.v1.Cluster.State); - - /** Cluster clusterType. */ - public clusterType: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType); - - /** Cluster databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); - - /** Cluster networkConfig. */ - public networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); - - /** Cluster network. */ - public network: string; - - /** Cluster etag. */ - public etag: string; - - /** Cluster annotations. */ - public annotations: { [k: string]: string }; - - /** Cluster reconciling. */ - public reconciling: boolean; - - /** Cluster initialUser. */ - public initialUser?: (google.cloud.alloydb.v1.IUserPassword|null); - - /** Cluster automatedBackupPolicy. */ - public automatedBackupPolicy?: (google.cloud.alloydb.v1.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); - - /** Cluster encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** Cluster encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig. */ - public continuousBackupConfig?: (google.cloud.alloydb.v1.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo. */ - public continuousBackupInfo?: (google.cloud.alloydb.v1.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig. */ - public secondaryConfig?: (google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig. */ - public primaryConfig?: (google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null); - - /** Cluster satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Cluster pscConfig. */ - public pscConfig?: (google.cloud.alloydb.v1.Cluster.IPscConfig|null); - - /** Cluster maintenanceUpdatePolicy. */ - public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule. */ - public maintenanceSchedule?: (google.cloud.alloydb.v1.IMaintenanceSchedule|null); - - /** Cluster subscriptionType. */ - public subscriptionType: (google.cloud.alloydb.v1.SubscriptionType|keyof typeof google.cloud.alloydb.v1.SubscriptionType); - - /** Cluster trialMetadata. */ - public trialMetadata?: (google.cloud.alloydb.v1.Cluster.ITrialMetadata|null); - - /** Cluster tags. */ - public tags: { [k: string]: string }; - - /** Cluster dataplexConfig. */ - public dataplexConfig?: (google.cloud.alloydb.v1.Cluster.IDataplexConfig|null); - - /** Cluster source. */ - public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); - - /** - * Creates a new Cluster instance using the specified properties. - * @param [properties] Properties to set - * @returns Cluster instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICluster): google.cloud.alloydb.v1.Cluster; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster; - - /** - * Verifies a Cluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cluster - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @param message Cluster - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cluster to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Cluster - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Cluster { - - /** Properties of a NetworkConfig. */ - interface INetworkConfig { - - /** NetworkConfig network */ - network?: (string|null); - - /** NetworkConfig allocatedIpRange */ - allocatedIpRange?: (string|null); - } - - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { - - /** - * Constructs a new NetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig); - - /** NetworkConfig network. */ - public network: string; - - /** NetworkConfig allocatedIpRange. */ - public allocatedIpRange: string; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig): google.cloud.alloydb.v1.Cluster.NetworkConfig; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.NetworkConfig; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.NetworkConfig; - - /** - * Verifies a NetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.NetworkConfig; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @param message NetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecondaryConfig. */ - interface ISecondaryConfig { - - /** SecondaryConfig primaryClusterName */ - primaryClusterName?: (string|null); - } - - /** Represents a SecondaryConfig. */ - class SecondaryConfig implements ISecondaryConfig { - - /** - * Constructs a new SecondaryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Cluster.ISecondaryConfig); - - /** SecondaryConfig primaryClusterName. */ - public primaryClusterName: string; - - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SecondaryConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Cluster.ISecondaryConfig): google.cloud.alloydb.v1.Cluster.SecondaryConfig; - - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.SecondaryConfig; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.SecondaryConfig; - - /** - * Verifies a SecondaryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecondaryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.SecondaryConfig; - - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @param message SecondaryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecondaryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecondaryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PrimaryConfig. */ - interface IPrimaryConfig { - - /** PrimaryConfig secondaryClusterNames */ - secondaryClusterNames?: (string[]|null); - } - - /** Represents a PrimaryConfig. */ - class PrimaryConfig implements IPrimaryConfig { - - /** - * Constructs a new PrimaryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Cluster.IPrimaryConfig); - - /** PrimaryConfig secondaryClusterNames. */ - public secondaryClusterNames: string[]; - - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PrimaryConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Cluster.IPrimaryConfig): google.cloud.alloydb.v1.Cluster.PrimaryConfig; - - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.PrimaryConfig; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.PrimaryConfig; - - /** - * Verifies a PrimaryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrimaryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.PrimaryConfig; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @param message PrimaryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PrimaryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PrimaryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscConfig. */ - interface IPscConfig { - - /** PscConfig pscEnabled */ - pscEnabled?: (boolean|null); - - /** PscConfig serviceOwnedProjectNumber */ - serviceOwnedProjectNumber?: (number|Long|string|null); - } - - /** Represents a PscConfig. */ - class PscConfig implements IPscConfig { - - /** - * Constructs a new PscConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Cluster.IPscConfig); - - /** PscConfig pscEnabled. */ - public pscEnabled: boolean; - - /** PscConfig serviceOwnedProjectNumber. */ - public serviceOwnedProjectNumber: (number|Long|string); - - /** - * Creates a new PscConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Cluster.IPscConfig): google.cloud.alloydb.v1.Cluster.PscConfig; - - /** - * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. - * @param message PscConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. - * @param message PscConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.PscConfig; - - /** - * Decodes a PscConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.PscConfig; - - /** - * Verifies a PscConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.PscConfig; - - /** - * Creates a plain object from a PscConfig message. Also converts values to other types if specified. - * @param message PscConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster.PscConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrialMetadata. */ - interface ITrialMetadata { - - /** TrialMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata upgradeTime */ - upgradeTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata graceEndTime */ - graceEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TrialMetadata. */ - class TrialMetadata implements ITrialMetadata { - - /** - * Constructs a new TrialMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Cluster.ITrialMetadata); - - /** TrialMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata upgradeTime. */ - public upgradeTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata graceEndTime. */ - public graceEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TrialMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns TrialMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1.Cluster.ITrialMetadata): google.cloud.alloydb.v1.Cluster.TrialMetadata; - - /** - * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. - * @param message TrialMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. - * @param message TrialMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.TrialMetadata; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.TrialMetadata; - - /** - * Verifies a TrialMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrialMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.TrialMetadata; - - /** - * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. - * @param message TrialMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster.TrialMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrialMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrialMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataplexConfig. */ - interface IDataplexConfig { - - /** DataplexConfig enabled */ - enabled?: (boolean|null); - } - - /** Represents a DataplexConfig. */ - class DataplexConfig implements IDataplexConfig { - - /** - * Constructs a new DataplexConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Cluster.IDataplexConfig); - - /** DataplexConfig enabled. */ - public enabled: boolean; - - /** - * Creates a new DataplexConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DataplexConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Cluster.IDataplexConfig): google.cloud.alloydb.v1.Cluster.DataplexConfig; - - /** - * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. - * @param message DataplexConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. - * @param message DataplexConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.DataplexConfig; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.DataplexConfig; - - /** - * Verifies a DataplexConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataplexConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.DataplexConfig; - - /** - * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. - * @param message DataplexConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataplexConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataplexConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - EMPTY = 3, - CREATING = 4, - DELETING = 5, - FAILED = 6, - BOOTSTRAPPING = 7, - MAINTENANCE = 8, - PROMOTING = 9 - } - - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - SECONDARY = 2 - } - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance displayName */ - displayName?: (string|null); - - /** Instance uid */ - uid?: (string|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance state */ - state?: (google.cloud.alloydb.v1.Instance.State|keyof typeof google.cloud.alloydb.v1.Instance.State|null); - - /** Instance instanceType */ - instanceType?: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType|null); - - /** Instance machineConfig */ - machineConfig?: (google.cloud.alloydb.v1.Instance.IMachineConfig|null); - - /** Instance availabilityType */ - availabilityType?: (google.cloud.alloydb.v1.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1.Instance.AvailabilityType|null); - - /** Instance gceZone */ - gceZone?: (string|null); - - /** Instance databaseFlags */ - databaseFlags?: ({ [k: string]: string }|null); - - /** Instance writableNode */ - writableNode?: (google.cloud.alloydb.v1.Instance.INode|null); - - /** Instance nodes */ - nodes?: (google.cloud.alloydb.v1.Instance.INode[]|null); - - /** Instance queryInsightsConfig */ - queryInsightsConfig?: (google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null); - - /** Instance observabilityConfig */ - observabilityConfig?: (google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null); - - /** Instance readPoolConfig */ - readPoolConfig?: (google.cloud.alloydb.v1.Instance.IReadPoolConfig|null); - - /** Instance ipAddress */ - ipAddress?: (string|null); - - /** Instance publicIpAddress */ - publicIpAddress?: (string|null); - - /** Instance reconciling */ - reconciling?: (boolean|null); - - /** Instance etag */ - etag?: (string|null); - - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Instance clientConnectionConfig */ - clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); - - /** Instance satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Instance pscInstanceConfig */ - pscInstanceConfig?: (google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null); - - /** Instance networkConfig */ - networkConfig?: (google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null); - - /** Instance outboundPublicIpAddresses */ - outboundPublicIpAddresses?: (string[]|null); - - /** Instance activationPolicy */ - activationPolicy?: (google.cloud.alloydb.v1.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1.Instance.ActivationPolicy|null); - - /** Instance connectionPoolConfig */ - connectionPoolConfig?: (google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance displayName. */ - public displayName: string; - - /** Instance uid. */ - public uid: string; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance state. */ - public state: (google.cloud.alloydb.v1.Instance.State|keyof typeof google.cloud.alloydb.v1.Instance.State); - - /** Instance instanceType. */ - public instanceType: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType); - - /** Instance machineConfig. */ - public machineConfig?: (google.cloud.alloydb.v1.Instance.IMachineConfig|null); - - /** Instance availabilityType. */ - public availabilityType: (google.cloud.alloydb.v1.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1.Instance.AvailabilityType); - - /** Instance gceZone. */ - public gceZone: string; - - /** Instance databaseFlags. */ - public databaseFlags: { [k: string]: string }; - - /** Instance writableNode. */ - public writableNode?: (google.cloud.alloydb.v1.Instance.INode|null); - - /** Instance nodes. */ - public nodes: google.cloud.alloydb.v1.Instance.INode[]; - - /** Instance queryInsightsConfig. */ - public queryInsightsConfig?: (google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null); - - /** Instance observabilityConfig. */ - public observabilityConfig?: (google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null); - - /** Instance readPoolConfig. */ - public readPoolConfig?: (google.cloud.alloydb.v1.Instance.IReadPoolConfig|null); - - /** Instance ipAddress. */ - public ipAddress: string; - - /** Instance publicIpAddress. */ - public publicIpAddress: string; - - /** Instance reconciling. */ - public reconciling: boolean; - - /** Instance etag. */ - public etag: string; - - /** Instance annotations. */ - public annotations: { [k: string]: string }; - - /** Instance clientConnectionConfig. */ - public clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); - - /** Instance satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Instance pscInstanceConfig. */ - public pscInstanceConfig?: (google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null); - - /** Instance networkConfig. */ - public networkConfig?: (google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null); - - /** Instance outboundPublicIpAddresses. */ - public outboundPublicIpAddresses: string[]; - - /** Instance activationPolicy. */ - public activationPolicy: (google.cloud.alloydb.v1.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1.Instance.ActivationPolicy); - - /** Instance connectionPoolConfig. */ - public connectionPoolConfig?: (google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null); - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.cloud.alloydb.v1.IInstance): google.cloud.alloydb.v1.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Instance { - - /** Properties of a MachineConfig. */ - interface IMachineConfig { - - /** MachineConfig cpuCount */ - cpuCount?: (number|null); - - /** MachineConfig machineType */ - machineType?: (string|null); - } - - /** Represents a MachineConfig. */ - class MachineConfig implements IMachineConfig { - - /** - * Constructs a new MachineConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IMachineConfig); - - /** MachineConfig cpuCount. */ - public cpuCount: number; - - /** MachineConfig machineType. */ - public machineType: string; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MachineConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IMachineConfig): google.cloud.alloydb.v1.Instance.MachineConfig; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.MachineConfig; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.MachineConfig; - - /** - * Verifies a MachineConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MachineConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.MachineConfig; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @param message MachineConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MachineConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MachineConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Node. */ - interface INode { - - /** Node zoneId */ - zoneId?: (string|null); - - /** Node id */ - id?: (string|null); - - /** Node ip */ - ip?: (string|null); - - /** Node state */ - state?: (string|null); - } - - /** Represents a Node. */ - class Node implements INode { - - /** - * Constructs a new Node. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.INode); - - /** Node zoneId. */ - public zoneId: string; - - /** Node id. */ - public id: string; - - /** Node ip. */ - public ip: string; - - /** Node state. */ - public state: string; - - /** - * Creates a new Node instance using the specified properties. - * @param [properties] Properties to set - * @returns Node instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.INode): google.cloud.alloydb.v1.Instance.Node; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Node message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.Node; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.Node; - - /** - * Verifies a Node message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Node - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.Node; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @param message Node - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Node to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Node - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryInsightsInstanceConfig. */ - interface IQueryInsightsInstanceConfig { - - /** QueryInsightsInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress */ - recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength */ - queryStringLength?: (number|null); - - /** QueryInsightsInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - } - - /** Represents a QueryInsightsInstanceConfig. */ - class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig); - - /** QueryInsightsInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress. */ - public recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength. */ - public queryStringLength: number; - - /** QueryInsightsInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryInsightsInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; - - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; - - /** - * Verifies a QueryInsightsInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInsightsInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @param message QueryInsightsInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ObservabilityInstanceConfig. */ - interface IObservabilityInstanceConfig { - - /** ObservabilityInstanceConfig enabled */ - enabled?: (boolean|null); - - /** ObservabilityInstanceConfig preserveComments */ - preserveComments?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEvents */ - trackWaitEvents?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEventTypes */ - trackWaitEventTypes?: (boolean|null); - - /** ObservabilityInstanceConfig maxQueryStringLength */ - maxQueryStringLength?: (number|null); - - /** ObservabilityInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** ObservabilityInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - - /** ObservabilityInstanceConfig trackActiveQueries */ - trackActiveQueries?: (boolean|null); - } - - /** Represents an ObservabilityInstanceConfig. */ - class ObservabilityInstanceConfig implements IObservabilityInstanceConfig { - - /** - * Constructs a new ObservabilityInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig); - - /** ObservabilityInstanceConfig enabled. */ - public enabled?: (boolean|null); - - /** ObservabilityInstanceConfig preserveComments. */ - public preserveComments?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEvents. */ - public trackWaitEvents?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEventTypes. */ - public trackWaitEventTypes?: (boolean|null); - - /** ObservabilityInstanceConfig maxQueryStringLength. */ - public maxQueryStringLength?: (number|null); - - /** ObservabilityInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** ObservabilityInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** ObservabilityInstanceConfig trackActiveQueries. */ - public trackActiveQueries?: (boolean|null); - - /** - * Creates a new ObservabilityInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ObservabilityInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; - - /** - * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @param message ObservabilityInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @param message ObservabilityInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; - - /** - * Verifies an ObservabilityInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObservabilityInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig; - - /** - * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. - * @param message ObservabilityInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObservabilityInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ObservabilityInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadPoolConfig. */ - interface IReadPoolConfig { - - /** ReadPoolConfig nodeCount */ - nodeCount?: (number|null); - } - - /** Represents a ReadPoolConfig. */ - class ReadPoolConfig implements IReadPoolConfig { - - /** - * Constructs a new ReadPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IReadPoolConfig); - - /** ReadPoolConfig nodeCount. */ - public nodeCount: number; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IReadPoolConfig): google.cloud.alloydb.v1.Instance.ReadPoolConfig; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ReadPoolConfig; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ReadPoolConfig; - - /** - * Verifies a ReadPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ReadPoolConfig; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @param message ReadPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientConnectionConfig. */ - interface IClientConnectionConfig { - - /** ClientConnectionConfig requireConnectors */ - requireConnectors?: (boolean|null); - - /** ClientConnectionConfig sslConfig */ - sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); - } - - /** Represents a ClientConnectionConfig. */ - class ClientConnectionConfig implements IClientConnectionConfig { - - /** - * Constructs a new ClientConnectionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig); - - /** ClientConnectionConfig requireConnectors. */ - public requireConnectors: boolean; - - /** ClientConnectionConfig sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); - - /** - * Creates a new ClientConnectionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientConnectionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; - - /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; - - /** - * Verifies a ClientConnectionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientConnectionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; - - /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @param message ClientConnectionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientConnectionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientConnectionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscInterfaceConfig. */ - interface IPscInterfaceConfig { - - /** PscInterfaceConfig networkAttachmentResource */ - networkAttachmentResource?: (string|null); - } - - /** Represents a PscInterfaceConfig. */ - class PscInterfaceConfig implements IPscInterfaceConfig { - - /** - * Constructs a new PscInterfaceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig); - - /** PscInterfaceConfig networkAttachmentResource. */ - public networkAttachmentResource: string; - - /** - * Creates a new PscInterfaceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscInterfaceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; - - /** - * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. - * @param message PscInterfaceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. - * @param message PscInterfaceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; - - /** - * Verifies a PscInterfaceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscInterfaceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.PscInterfaceConfig; - - /** - * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. - * @param message PscInterfaceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.PscInterfaceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscInterfaceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscInterfaceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscAutoConnectionConfig. */ - interface IPscAutoConnectionConfig { - - /** PscAutoConnectionConfig consumerProject */ - consumerProject?: (string|null); - - /** PscAutoConnectionConfig consumerNetwork */ - consumerNetwork?: (string|null); - - /** PscAutoConnectionConfig ipAddress */ - ipAddress?: (string|null); - - /** PscAutoConnectionConfig status */ - status?: (string|null); - - /** PscAutoConnectionConfig consumerNetworkStatus */ - consumerNetworkStatus?: (string|null); - } - - /** Represents a PscAutoConnectionConfig. */ - class PscAutoConnectionConfig implements IPscAutoConnectionConfig { - - /** - * Constructs a new PscAutoConnectionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig); - - /** PscAutoConnectionConfig consumerProject. */ - public consumerProject: string; - - /** PscAutoConnectionConfig consumerNetwork. */ - public consumerNetwork: string; - - /** PscAutoConnectionConfig ipAddress. */ - public ipAddress: string; - - /** PscAutoConnectionConfig status. */ - public status: string; - - /** PscAutoConnectionConfig consumerNetworkStatus. */ - public consumerNetworkStatus: string; - - /** - * Creates a new PscAutoConnectionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscAutoConnectionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; - - /** - * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @param message PscAutoConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @param message PscAutoConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; - - /** - * Verifies a PscAutoConnectionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscAutoConnectionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig; - - /** - * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. - * @param message PscAutoConnectionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscAutoConnectionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscAutoConnectionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscInstanceConfig. */ - interface IPscInstanceConfig { - - /** PscInstanceConfig serviceAttachmentLink */ - serviceAttachmentLink?: (string|null); - - /** PscInstanceConfig allowedConsumerProjects */ - allowedConsumerProjects?: (string[]|null); - - /** PscInstanceConfig pscDnsName */ - pscDnsName?: (string|null); - - /** PscInstanceConfig pscInterfaceConfigs */ - pscInterfaceConfigs?: (google.cloud.alloydb.v1.Instance.IPscInterfaceConfig[]|null); - - /** PscInstanceConfig pscAutoConnections */ - pscAutoConnections?: (google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig[]|null); - } - - /** Represents a PscInstanceConfig. */ - class PscInstanceConfig implements IPscInstanceConfig { - - /** - * Constructs a new PscInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IPscInstanceConfig); - - /** PscInstanceConfig serviceAttachmentLink. */ - public serviceAttachmentLink: string; - - /** PscInstanceConfig allowedConsumerProjects. */ - public allowedConsumerProjects: string[]; - - /** PscInstanceConfig pscDnsName. */ - public pscDnsName: string; - - /** PscInstanceConfig pscInterfaceConfigs. */ - public pscInterfaceConfigs: google.cloud.alloydb.v1.Instance.IPscInterfaceConfig[]; - - /** PscInstanceConfig pscAutoConnections. */ - public pscAutoConnections: google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig[]; - - /** - * Creates a new PscInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IPscInstanceConfig): google.cloud.alloydb.v1.Instance.PscInstanceConfig; - - /** - * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. - * @param message PscInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. - * @param message PscInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.PscInstanceConfig; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.PscInstanceConfig; - - /** - * Verifies a PscInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.PscInstanceConfig; - - /** - * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. - * @param message PscInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.PscInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceNetworkConfig. */ - interface IInstanceNetworkConfig { - - /** InstanceNetworkConfig authorizedExternalNetworks */ - authorizedExternalNetworks?: (google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]|null); - - /** InstanceNetworkConfig enablePublicIp */ - enablePublicIp?: (boolean|null); - - /** InstanceNetworkConfig enableOutboundPublicIp */ - enableOutboundPublicIp?: (boolean|null); - - /** InstanceNetworkConfig network */ - network?: (string|null); - - /** InstanceNetworkConfig allocatedIpRangeOverride */ - allocatedIpRangeOverride?: (string|null); - } - - /** Represents an InstanceNetworkConfig. */ - class InstanceNetworkConfig implements IInstanceNetworkConfig { - - /** - * Constructs a new InstanceNetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig); - - /** InstanceNetworkConfig authorizedExternalNetworks. */ - public authorizedExternalNetworks: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]; - - /** InstanceNetworkConfig enablePublicIp. */ - public enablePublicIp: boolean; - - /** InstanceNetworkConfig enableOutboundPublicIp. */ - public enableOutboundPublicIp: boolean; - - /** InstanceNetworkConfig network. */ - public network: string; - - /** InstanceNetworkConfig allocatedIpRangeOverride. */ - public allocatedIpRangeOverride: string; - - /** - * Creates a new InstanceNetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceNetworkConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; - - /** - * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. - * @param message InstanceNetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. - * @param message InstanceNetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; - - /** - * Verifies an InstanceNetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceNetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig; - - /** - * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. - * @param message InstanceNetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceNetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceNetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceNetworkConfig { - - /** Properties of an AuthorizedNetwork. */ - interface IAuthorizedNetwork { - - /** AuthorizedNetwork cidrRange */ - cidrRange?: (string|null); - } - - /** Represents an AuthorizedNetwork. */ - class AuthorizedNetwork implements IAuthorizedNetwork { - - /** - * Constructs a new AuthorizedNetwork. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork); - - /** AuthorizedNetwork cidrRange. */ - public cidrRange: string; - - /** - * Creates a new AuthorizedNetwork instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthorizedNetwork instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @param message AuthorizedNetwork message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @param message AuthorizedNetwork message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Verifies an AuthorizedNetwork message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuthorizedNetwork - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. - * @param message AuthorizedNetwork - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuthorizedNetwork to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuthorizedNetwork - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ConnectionPoolConfig. */ - interface IConnectionPoolConfig { - - /** ConnectionPoolConfig enabled */ - enabled?: (boolean|null); - - /** ConnectionPoolConfig flags */ - flags?: ({ [k: string]: string }|null); - - /** ConnectionPoolConfig poolerCount */ - poolerCount?: (number|null); - } - - /** Represents a ConnectionPoolConfig. */ - class ConnectionPoolConfig implements IConnectionPoolConfig { - - /** - * Constructs a new ConnectionPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig); - - /** ConnectionPoolConfig enabled. */ - public enabled: boolean; - - /** ConnectionPoolConfig flags. */ - public flags: { [k: string]: string }; - - /** ConnectionPoolConfig poolerCount. */ - public poolerCount: number; - - /** - * Creates a new ConnectionPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; - - /** - * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. - * @param message ConnectionPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. - * @param message ConnectionPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; - - /** - * Verifies a ConnectionPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ConnectionPoolConfig; - - /** - * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. - * @param message ConnectionPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Instance.ConnectionPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectionPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - CREATING = 3, - DELETING = 4, - MAINTENANCE = 5, - FAILED = 6, - BOOTSTRAPPING = 8, - PROMOTING = 9 - } - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - READ_POOL = 2, - SECONDARY = 3 - } - - /** AvailabilityType enum. */ - enum AvailabilityType { - AVAILABILITY_TYPE_UNSPECIFIED = 0, - ZONAL = 1, - REGIONAL = 2 - } - - /** ActivationPolicy enum. */ - enum ActivationPolicy { - ACTIVATION_POLICY_UNSPECIFIED = 0, - ALWAYS = 1, - NEVER = 2 - } - } - - /** Properties of a ConnectionInfo. */ - interface IConnectionInfo { - - /** ConnectionInfo name */ - name?: (string|null); - - /** ConnectionInfo ipAddress */ - ipAddress?: (string|null); - - /** ConnectionInfo publicIpAddress */ - publicIpAddress?: (string|null); - - /** ConnectionInfo instanceUid */ - instanceUid?: (string|null); - } - - /** Represents a ConnectionInfo. */ - class ConnectionInfo implements IConnectionInfo { - - /** - * Constructs a new ConnectionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IConnectionInfo); - - /** ConnectionInfo name. */ - public name: string; - - /** ConnectionInfo ipAddress. */ - public ipAddress: string; - - /** ConnectionInfo publicIpAddress. */ - public publicIpAddress: string; - - /** ConnectionInfo instanceUid. */ - public instanceUid: string; - - /** - * Creates a new ConnectionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1.IConnectionInfo): google.cloud.alloydb.v1.ConnectionInfo; - - /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ConnectionInfo; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ConnectionInfo; - - /** - * Verifies a ConnectionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ConnectionInfo; - - /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @param message ConnectionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup name */ - name?: (string|null); - - /** Backup displayName */ - displayName?: (string|null); - - /** Backup uid */ - uid?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup createCompletionTime */ - createCompletionTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels */ - labels?: ({ [k: string]: string }|null); - - /** Backup state */ - state?: (google.cloud.alloydb.v1.Backup.State|keyof typeof google.cloud.alloydb.v1.Backup.State|null); - - /** Backup type */ - type?: (google.cloud.alloydb.v1.Backup.Type|keyof typeof google.cloud.alloydb.v1.Backup.Type|null); - - /** Backup description */ - description?: (string|null); - - /** Backup clusterUid */ - clusterUid?: (string|null); - - /** Backup clusterName */ - clusterName?: (string|null); - - /** Backup reconciling */ - reconciling?: (boolean|null); - - /** Backup encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** Backup encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); - - /** Backup etag */ - etag?: (string|null); - - /** Backup annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); - - /** Backup expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|null); - - /** Backup expiryQuantity */ - expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); - - /** Backup satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Backup databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); - - /** Backup tags */ - tags?: ({ [k: string]: string }|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { - - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IBackup); - - /** Backup name. */ - public name: string; - - /** Backup displayName. */ - public displayName: string; - - /** Backup uid. */ - public uid: string; - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup createCompletionTime. */ - public createCompletionTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels. */ - public labels: { [k: string]: string }; - - /** Backup state. */ - public state: (google.cloud.alloydb.v1.Backup.State|keyof typeof google.cloud.alloydb.v1.Backup.State); - - /** Backup type. */ - public type: (google.cloud.alloydb.v1.Backup.Type|keyof typeof google.cloud.alloydb.v1.Backup.Type); - - /** Backup description. */ - public description: string; - - /** Backup clusterUid. */ - public clusterUid: string; - - /** Backup clusterName. */ - public clusterName: string; - - /** Backup reconciling. */ - public reconciling: boolean; - - /** Backup encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1.IEncryptionConfig|null); - - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1.IEncryptionInfo|null); - - /** Backup etag. */ - public etag: string; - - /** Backup annotations. */ - public annotations: { [k: string]: string }; - - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** Backup expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); - - /** Backup expiryQuantity. */ - public expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); - - /** Backup satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Backup databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); - - /** Backup tags. */ - public tags: { [k: string]: string }; - - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.cloud.alloydb.v1.IBackup): google.cloud.alloydb.v1.Backup; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Backup; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Backup; - - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Backup; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Backup { - - /** Properties of a QuantityBasedExpiry. */ - interface IQuantityBasedExpiry { - - /** QuantityBasedExpiry retentionCount */ - retentionCount?: (number|null); - - /** QuantityBasedExpiry totalRetentionCount */ - totalRetentionCount?: (number|null); - } - - /** Represents a QuantityBasedExpiry. */ - class QuantityBasedExpiry implements IQuantityBasedExpiry { - - /** - * Constructs a new QuantityBasedExpiry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry); - - /** QuantityBasedExpiry retentionCount. */ - public retentionCount: number; - - /** QuantityBasedExpiry totalRetentionCount. */ - public totalRetentionCount: number; - - /** - * Creates a new QuantityBasedExpiry instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedExpiry instance - */ - public static create(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; - - /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. - * @param message QuantityBasedExpiry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. - * @param message QuantityBasedExpiry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; - - /** - * Verifies a QuantityBasedExpiry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedExpiry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; - - /** - * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. - * @param message QuantityBasedExpiry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedExpiry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedExpiry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - CREATING = 2, - FAILED = 3, - DELETING = 4 - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ON_DEMAND = 1, - AUTOMATED = 2, - CONTINUOUS = 3 - } - } - - /** Properties of a SupportedDatabaseFlag. */ - interface ISupportedDatabaseFlag { - - /** SupportedDatabaseFlag stringRestrictions */ - stringRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null); - - /** SupportedDatabaseFlag integerRestrictions */ - integerRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null); - - /** SupportedDatabaseFlag recommendedStringValue */ - recommendedStringValue?: (string|null); - - /** SupportedDatabaseFlag recommendedIntegerValue */ - recommendedIntegerValue?: (google.protobuf.IInt64Value|null); - - /** SupportedDatabaseFlag name */ - name?: (string|null); - - /** SupportedDatabaseFlag flagName */ - flagName?: (string|null); - - /** SupportedDatabaseFlag valueType */ - valueType?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|null); - - /** SupportedDatabaseFlag acceptsMultipleValues */ - acceptsMultipleValues?: (boolean|null); - - /** SupportedDatabaseFlag supportedDbVersions */ - supportedDbVersions?: (google.cloud.alloydb.v1.DatabaseVersion[]|null); - - /** SupportedDatabaseFlag requiresDbRestart */ - requiresDbRestart?: (boolean|null); - - /** SupportedDatabaseFlag scope */ - scope?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null); - } - - /** Represents a SupportedDatabaseFlag. */ - class SupportedDatabaseFlag implements ISupportedDatabaseFlag { - - /** - * Constructs a new SupportedDatabaseFlag. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISupportedDatabaseFlag); - - /** SupportedDatabaseFlag stringRestrictions. */ - public stringRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null); - - /** SupportedDatabaseFlag integerRestrictions. */ - public integerRestrictions?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null); - - /** SupportedDatabaseFlag recommendedStringValue. */ - public recommendedStringValue?: (string|null); - - /** SupportedDatabaseFlag recommendedIntegerValue. */ - public recommendedIntegerValue?: (google.protobuf.IInt64Value|null); - - /** SupportedDatabaseFlag name. */ - public name: string; - - /** SupportedDatabaseFlag flagName. */ - public flagName: string; - - /** SupportedDatabaseFlag valueType. */ - public valueType: (google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType); - - /** SupportedDatabaseFlag acceptsMultipleValues. */ - public acceptsMultipleValues: boolean; - - /** SupportedDatabaseFlag supportedDbVersions. */ - public supportedDbVersions: google.cloud.alloydb.v1.DatabaseVersion[]; - - /** SupportedDatabaseFlag requiresDbRestart. */ - public requiresDbRestart: boolean; - - /** SupportedDatabaseFlag scope. */ - public scope: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope); - - /** SupportedDatabaseFlag restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); - - /** SupportedDatabaseFlag recommendedValue. */ - public recommendedValue?: ("recommendedStringValue"|"recommendedIntegerValue"); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @param [properties] Properties to set - * @returns SupportedDatabaseFlag instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISupportedDatabaseFlag): google.cloud.alloydb.v1.SupportedDatabaseFlag; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SupportedDatabaseFlag; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SupportedDatabaseFlag; - - /** - * Verifies a SupportedDatabaseFlag message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SupportedDatabaseFlag - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SupportedDatabaseFlag; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @param message SupportedDatabaseFlag - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SupportedDatabaseFlag { - - /** Properties of a StringRestrictions. */ - interface IStringRestrictions { - - /** StringRestrictions allowedValues */ - allowedValues?: (string[]|null); - } - - /** Represents a StringRestrictions. */ - class StringRestrictions implements IStringRestrictions { - - /** - * Constructs a new StringRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions); - - /** StringRestrictions allowedValues. */ - public allowedValues: string[]; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns StringRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; - - /** - * Verifies a StringRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @param message StringRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IntegerRestrictions. */ - interface IIntegerRestrictions { - - /** IntegerRestrictions minValue */ - minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue */ - maxValue?: (google.protobuf.IInt64Value|null); - } - - /** Represents an IntegerRestrictions. */ - class IntegerRestrictions implements IIntegerRestrictions { - - /** - * Constructs a new IntegerRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions); - - /** IntegerRestrictions minValue. */ - public minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue. */ - public maxValue?: (google.protobuf.IInt64Value|null); - - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns IntegerRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Verifies an IntegerRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntegerRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @param message IntegerRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntegerRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IntegerRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - FLOAT = 3, - NONE = 4 - } - - /** Scope enum. */ - enum Scope { - SCOPE_UNSPECIFIED = 0, - DATABASE = 1, - CONNECTION_POOL = 2 - } - } - - /** Properties of a User. */ - interface IUser { - - /** User name */ - name?: (string|null); - - /** User password */ - password?: (string|null); - - /** User databaseRoles */ - databaseRoles?: (string[]|null); - - /** User userType */ - userType?: (google.cloud.alloydb.v1.User.UserType|keyof typeof google.cloud.alloydb.v1.User.UserType|null); - - /** User keepExtraRoles */ - keepExtraRoles?: (boolean|null); - } - - /** Represents a User. */ - class User implements IUser { - - /** - * Constructs a new User. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUser); - - /** User name. */ - public name: string; - - /** User password. */ - public password: string; - - /** User databaseRoles. */ - public databaseRoles: string[]; - - /** User userType. */ - public userType: (google.cloud.alloydb.v1.User.UserType|keyof typeof google.cloud.alloydb.v1.User.UserType); - - /** User keepExtraRoles. */ - public keepExtraRoles: boolean; - - /** - * Creates a new User instance using the specified properties. - * @param [properties] Properties to set - * @returns User instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUser): google.cloud.alloydb.v1.User; - - /** - * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a User message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.User; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.User; - - /** - * Verifies a User message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns User - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.User; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @param message User - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this User to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for User - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace User { - - /** UserType enum. */ - enum UserType { - USER_TYPE_UNSPECIFIED = 0, - ALLOYDB_BUILT_IN = 1, - ALLOYDB_IAM_USER = 2 - } - } - - /** Properties of a Database. */ - interface IDatabase { - - /** Database name */ - name?: (string|null); - - /** Database charset */ - charset?: (string|null); - - /** Database collation */ - collation?: (string|null); - - /** Database characterType */ - characterType?: (string|null); - - /** Database databaseTemplate */ - databaseTemplate?: (string|null); - - /** Database isTemplateDatabase */ - isTemplateDatabase?: (boolean|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IDatabase); - - /** Database name. */ - public name: string; - - /** Database charset. */ - public charset: string; - - /** Database collation. */ - public collation: string; - - /** Database characterType. */ - public characterType: string; - - /** Database databaseTemplate. */ - public databaseTemplate: string; - - /** Database isTemplateDatabase. */ - public isTemplateDatabase?: (boolean|null); - - /** - * Creates a new Database instance using the specified properties. - * @param [properties] Properties to set - * @returns Database instance - */ - public static create(properties?: google.cloud.alloydb.v1.IDatabase): google.cloud.alloydb.v1.Database; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Database message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Database; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Database; - - /** - * Verifies a Database message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Database - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Database; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @param message Database - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Database to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Database - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AlloyDBAdmin */ - class AlloyDBAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new AlloyDBAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse - */ - public listClusters(request: google.cloud.alloydb.v1.IListClustersRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListClustersCallback): void; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise - */ - public listClusters(request: google.cloud.alloydb.v1.IListClustersRequest): Promise; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster - */ - public getCluster(request: google.cloud.alloydb.v1.IGetClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetClusterCallback): void; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise - */ - public getCluster(request: google.cloud.alloydb.v1.IGetClusterRequest): Promise; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCluster(request: google.cloud.alloydb.v1.ICreateClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateClusterCallback): void; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise - */ - public createCluster(request: google.cloud.alloydb.v1.ICreateClusterRequest): Promise; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCluster(request: google.cloud.alloydb.v1.IUpdateClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateClusterCallback): void; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @returns Promise - */ - public updateCluster(request: google.cloud.alloydb.v1.IUpdateClusterRequest): Promise; - - /** - * Calls ExportCluster. - * @param request ExportClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportCluster(request: google.cloud.alloydb.v1.IExportClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ExportClusterCallback): void; - - /** - * Calls ExportCluster. - * @param request ExportClusterRequest message or plain object - * @returns Promise - */ - public exportCluster(request: google.cloud.alloydb.v1.IExportClusterRequest): Promise; - - /** - * Calls ImportCluster. - * @param request ImportClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importCluster(request: google.cloud.alloydb.v1.IImportClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ImportClusterCallback): void; - - /** - * Calls ImportCluster. - * @param request ImportClusterRequest message or plain object - * @returns Promise - */ - public importCluster(request: google.cloud.alloydb.v1.IImportClusterRequest): Promise; - - /** - * Calls UpgradeCluster. - * @param request UpgradeClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public upgradeCluster(request: google.cloud.alloydb.v1.IUpgradeClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeClusterCallback): void; - - /** - * Calls UpgradeCluster. - * @param request UpgradeClusterRequest message or plain object - * @returns Promise - */ - public upgradeCluster(request: google.cloud.alloydb.v1.IUpgradeClusterRequest): Promise; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCluster(request: google.cloud.alloydb.v1.IDeleteClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteClusterCallback): void; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise - */ - public deleteCluster(request: google.cloud.alloydb.v1.IDeleteClusterRequest): Promise; - - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public promoteCluster(request: google.cloud.alloydb.v1.IPromoteClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.PromoteClusterCallback): void; - - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @returns Promise - */ - public promoteCluster(request: google.cloud.alloydb.v1.IPromoteClusterRequest): Promise; - - /** - * Calls SwitchoverCluster. - * @param request SwitchoverClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public switchoverCluster(request: google.cloud.alloydb.v1.ISwitchoverClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverClusterCallback): void; - - /** - * Calls SwitchoverCluster. - * @param request SwitchoverClusterRequest message or plain object - * @returns Promise - */ - public switchoverCluster(request: google.cloud.alloydb.v1.ISwitchoverClusterRequest): Promise; - - /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreCluster(request: google.cloud.alloydb.v1.IRestoreClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.RestoreClusterCallback): void; - - /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @returns Promise - */ - public restoreCluster(request: google.cloud.alloydb.v1.IRestoreClusterRequest): Promise; - - /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSecondaryCluster(request: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryClusterCallback): void; - - /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @returns Promise - */ - public createSecondaryCluster(request: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.cloud.alloydb.v1.IListInstancesRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.cloud.alloydb.v1.IListInstancesRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.cloud.alloydb.v1.IGetInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.cloud.alloydb.v1.IGetInstanceRequest): Promise; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstance(request: google.cloud.alloydb.v1.ICreateInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.cloud.alloydb.v1.ICreateInstanceRequest): Promise; - - /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSecondaryInstance(request: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; - - /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @returns Promise - */ - public createSecondaryInstance(request: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest): Promise; - - /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchCreateInstances(request: google.cloud.alloydb.v1.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstancesCallback): void; - - /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @returns Promise - */ - public batchCreateInstances(request: google.cloud.alloydb.v1.IBatchCreateInstancesRequest): Promise; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstance(request: google.cloud.alloydb.v1.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstanceCallback): void; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise - */ - public updateInstance(request: google.cloud.alloydb.v1.IUpdateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteInstance(request: google.cloud.alloydb.v1.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.cloud.alloydb.v1.IDeleteInstanceRequest): Promise; - - /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public failoverInstance(request: google.cloud.alloydb.v1.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstanceCallback): void; - - /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @returns Promise - */ - public failoverInstance(request: google.cloud.alloydb.v1.IFailoverInstanceRequest): Promise; - - /** - * Calls InjectFault. - * @param request InjectFaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public injectFault(request: google.cloud.alloydb.v1.IInjectFaultRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.InjectFaultCallback): void; - - /** - * Calls InjectFault. - * @param request InjectFaultRequest message or plain object - * @returns Promise - */ - public injectFault(request: google.cloud.alloydb.v1.IInjectFaultRequest): Promise; - - /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restartInstance(request: google.cloud.alloydb.v1.IRestartInstanceRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstanceCallback): void; - - /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @returns Promise - */ - public restartInstance(request: google.cloud.alloydb.v1.IRestartInstanceRequest): Promise; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteSqlResponse - */ - public executeSql(request: google.cloud.alloydb.v1.IExecuteSqlRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSqlCallback): void; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeSql(request: google.cloud.alloydb.v1.IExecuteSqlRequest): Promise; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse - */ - public listBackups(request: google.cloud.alloydb.v1.IListBackupsRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListBackupsCallback): void; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise - */ - public listBackups(request: google.cloud.alloydb.v1.IListBackupsRequest): Promise; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public getBackup(request: google.cloud.alloydb.v1.IGetBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetBackupCallback): void; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise - */ - public getBackup(request: google.cloud.alloydb.v1.IGetBackupRequest): Promise; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackup(request: google.cloud.alloydb.v1.ICreateBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackupCallback): void; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise - */ - public createBackup(request: google.cloud.alloydb.v1.ICreateBackupRequest): Promise; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackup(request: google.cloud.alloydb.v1.IUpdateBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackupCallback): void; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise - */ - public updateBackup(request: google.cloud.alloydb.v1.IUpdateBackupRequest): Promise; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackup(request: google.cloud.alloydb.v1.IDeleteBackupRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackupCallback): void; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise - */ - public deleteBackup(request: google.cloud.alloydb.v1.IDeleteBackupRequest): Promise; - - /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; - - /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @returns Promise - */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest): Promise; - - /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - */ - public generateClientCertificate(request: google.cloud.alloydb.v1.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificateCallback): void; - - /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @returns Promise - */ - public generateClientCertificate(request: google.cloud.alloydb.v1.IGenerateClientCertificateRequest): Promise; - - /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ConnectionInfo - */ - public getConnectionInfo(request: google.cloud.alloydb.v1.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfoCallback): void; - - /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @returns Promise - */ - public getConnectionInfo(request: google.cloud.alloydb.v1.IGetConnectionInfoRequest): Promise; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListUsersResponse - */ - public listUsers(request: google.cloud.alloydb.v1.IListUsersRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListUsersCallback): void; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @returns Promise - */ - public listUsers(request: google.cloud.alloydb.v1.IListUsersRequest): Promise; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public getUser(request: google.cloud.alloydb.v1.IGetUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.GetUserCallback): void; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @returns Promise - */ - public getUser(request: google.cloud.alloydb.v1.IGetUserRequest): Promise; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public createUser(request: google.cloud.alloydb.v1.ICreateUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.CreateUserCallback): void; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @returns Promise - */ - public createUser(request: google.cloud.alloydb.v1.ICreateUserRequest): Promise; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public updateUser(request: google.cloud.alloydb.v1.IUpdateUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUserCallback): void; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @returns Promise - */ - public updateUser(request: google.cloud.alloydb.v1.IUpdateUserRequest): Promise; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteUser(request: google.cloud.alloydb.v1.IDeleteUserRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUserCallback): void; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @returns Promise - */ - public deleteUser(request: google.cloud.alloydb.v1.IDeleteUserRequest): Promise; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse - */ - public listDatabases(request: google.cloud.alloydb.v1.IListDatabasesRequest, callback: google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabasesCallback): void; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @returns Promise - */ - public listDatabases(request: google.cloud.alloydb.v1.IListDatabasesRequest): Promise; - } - - namespace AlloyDBAdmin { - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse - */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListClustersResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. - * @param error Error, if any - * @param [response] Cluster - */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Cluster) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|exportCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|importCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|upgradeCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpgradeClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|promoteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|switchoverCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type SwitchoverClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Instance) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|failoverInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|injectFault}. - * @param error Error, if any - * @param [response] Operation - */ - type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|executeSql}. - * @param error Error, if any - * @param [response] ExecuteSqlResponse - */ - type ExecuteSqlCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ExecuteSqlResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse - */ - type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListBackupsResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.Backup) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @param error Error, if any - * @param [response] ListSupportedDatabaseFlagsResponse - */ - type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|generateClientCertificate}. - * @param error Error, if any - * @param [response] GenerateClientCertificateResponse - */ - type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.GenerateClientCertificateResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getConnectionInfo}. - * @param error Error, if any - * @param [response] ConnectionInfo - */ - type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ConnectionInfo) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. - * @param error Error, if any - * @param [response] ListUsersResponse - */ - type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListUsersResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. - * @param error Error, if any - * @param [response] User - */ - type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. - * @param error Error, if any - * @param [response] User - */ - type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateUser}. - * @param error Error, if any - * @param [response] User - */ - type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteUser}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listDatabases}. - * @param error Error, if any - * @param [response] ListDatabasesResponse - */ - type ListDatabasesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1.ListDatabasesResponse) => void; - } - - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { - - /** ListClustersRequest parent */ - parent?: (string|null); - - /** ListClustersRequest pageSize */ - pageSize?: (number|null); - - /** ListClustersRequest pageToken */ - pageToken?: (string|null); - - /** ListClustersRequest filter */ - filter?: (string|null); - - /** ListClustersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { - - /** - * Constructs a new ListClustersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListClustersRequest); - - /** ListClustersRequest parent. */ - public parent: string; - - /** ListClustersRequest pageSize. */ - public pageSize: number; - - /** ListClustersRequest pageToken. */ - public pageToken: string; - - /** ListClustersRequest filter. */ - public filter: string; - - /** ListClustersRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListClustersRequest): google.cloud.alloydb.v1.ListClustersRequest; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListClustersRequest; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListClustersRequest; - - /** - * Verifies a ListClustersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListClustersRequest; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { - - /** ListClustersResponse clusters */ - clusters?: (google.cloud.alloydb.v1.ICluster[]|null); - - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListClustersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { - - /** - * Constructs a new ListClustersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListClustersResponse); - - /** ListClustersResponse clusters. */ - public clusters: google.cloud.alloydb.v1.ICluster[]; - - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListClustersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListClustersResponse): google.cloud.alloydb.v1.ListClustersResponse; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListClustersResponse; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListClustersResponse; - - /** - * Verifies a ListClustersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListClustersResponse; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { - - /** GetClusterRequest name */ - name?: (string|null); - - /** GetClusterRequest view */ - view?: (google.cloud.alloydb.v1.ClusterView|keyof typeof google.cloud.alloydb.v1.ClusterView|null); - } - - /** Represents a GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { - - /** - * Constructs a new GetClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGetClusterRequest); - - /** GetClusterRequest name. */ - public name: string; - - /** GetClusterRequest view. */ - public view: (google.cloud.alloydb.v1.ClusterView|keyof typeof google.cloud.alloydb.v1.ClusterView); - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGetClusterRequest): google.cloud.alloydb.v1.GetClusterRequest; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetClusterRequest; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetClusterRequest; - - /** - * Verifies a GetClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetClusterRequest; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSecondaryClusterRequest. */ - interface ICreateSecondaryClusterRequest { - - /** CreateSecondaryClusterRequest parent */ - parent?: (string|null); - - /** CreateSecondaryClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateSecondaryClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** CreateSecondaryClusterRequest requestId */ - requestId?: (string|null); - - /** CreateSecondaryClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateSecondaryClusterRequest. */ - class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { - - /** - * Constructs a new CreateSecondaryClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest); - - /** CreateSecondaryClusterRequest parent. */ - public parent: string; - - /** CreateSecondaryClusterRequest clusterId. */ - public clusterId: string; - - /** CreateSecondaryClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** CreateSecondaryClusterRequest requestId. */ - public requestId: string; - - /** CreateSecondaryClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecondaryClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; - - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; - - /** - * Verifies a CreateSecondaryClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecondaryClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateSecondaryClusterRequest; - - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { - - /** CreateClusterRequest parent */ - parent?: (string|null); - - /** CreateClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** CreateClusterRequest requestId */ - requestId?: (string|null); - - /** CreateClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { - - /** - * Constructs a new CreateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateClusterRequest); - - /** CreateClusterRequest parent. */ - public parent: string; - - /** CreateClusterRequest clusterId. */ - public clusterId: string; - - /** CreateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** CreateClusterRequest requestId. */ - public requestId: string; - - /** CreateClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateClusterRequest): google.cloud.alloydb.v1.CreateClusterRequest; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateClusterRequest; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateClusterRequest; - - /** - * Verifies a CreateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateClusterRequest; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateClusterRequest. */ - interface IUpdateClusterRequest { - - /** UpdateClusterRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** UpdateClusterRequest requestId */ - requestId?: (string|null); - - /** UpdateClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateClusterRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateClusterRequest. */ - class UpdateClusterRequest implements IUpdateClusterRequest { - - /** - * Constructs a new UpdateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpdateClusterRequest); - - /** UpdateClusterRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** UpdateClusterRequest requestId. */ - public requestId: string; - - /** UpdateClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateClusterRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpdateClusterRequest): google.cloud.alloydb.v1.UpdateClusterRequest; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateClusterRequest; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateClusterRequest; - - /** - * Verifies an UpdateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateClusterRequest; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @param message UpdateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); - } - - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { - - /** - * Constructs a new GcsDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDestination instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGcsDestination): google.cloud.alloydb.v1.GcsDestination; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GcsDestination; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GcsDestination; - - /** - * Verifies a GcsDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GcsDestination; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDestination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportClusterRequest. */ - interface IExportClusterRequest { - - /** ExportClusterRequest gcsDestination */ - gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); - - /** ExportClusterRequest csvExportOptions */ - csvExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null); - - /** ExportClusterRequest sqlExportOptions */ - sqlExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null); - - /** ExportClusterRequest name */ - name?: (string|null); - - /** ExportClusterRequest database */ - database?: (string|null); - } - - /** Represents an ExportClusterRequest. */ - class ExportClusterRequest implements IExportClusterRequest { - - /** - * Constructs a new ExportClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IExportClusterRequest); - - /** ExportClusterRequest gcsDestination. */ - public gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); - - /** ExportClusterRequest csvExportOptions. */ - public csvExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null); - - /** ExportClusterRequest sqlExportOptions. */ - public sqlExportOptions?: (google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null); - - /** ExportClusterRequest name. */ - public name: string; - - /** ExportClusterRequest database. */ - public database: string; - - /** ExportClusterRequest destination. */ - public destination?: "gcsDestination"; - - /** ExportClusterRequest exportOptions. */ - public exportOptions?: ("csvExportOptions"|"sqlExportOptions"); - - /** - * Creates a new ExportClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IExportClusterRequest): google.cloud.alloydb.v1.ExportClusterRequest; - - /** - * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. - * @param message ExportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. - * @param message ExportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterRequest; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterRequest; - - /** - * Verifies an ExportClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterRequest; - - /** - * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. - * @param message ExportClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExportClusterRequest { - - /** Properties of a CsvExportOptions. */ - interface ICsvExportOptions { - - /** CsvExportOptions selectQuery */ - selectQuery?: (string|null); - - /** CsvExportOptions fieldDelimiter */ - fieldDelimiter?: (string|null); - - /** CsvExportOptions quoteCharacter */ - quoteCharacter?: (string|null); - - /** CsvExportOptions escapeCharacter */ - escapeCharacter?: (string|null); - } - - /** Represents a CsvExportOptions. */ - class CsvExportOptions implements ICsvExportOptions { - - /** - * Constructs a new CsvExportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions); - - /** CsvExportOptions selectQuery. */ - public selectQuery: string; - - /** CsvExportOptions fieldDelimiter. */ - public fieldDelimiter: string; - - /** CsvExportOptions quoteCharacter. */ - public quoteCharacter: string; - - /** CsvExportOptions escapeCharacter. */ - public escapeCharacter: string; - - /** - * Creates a new CsvExportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CsvExportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; - - /** - * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @param message CsvExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @param message CsvExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; - - /** - * Verifies a CsvExportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CsvExportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions; - - /** - * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. - * @param message CsvExportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CsvExportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CsvExportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlExportOptions. */ - interface ISqlExportOptions { - - /** SqlExportOptions tables */ - tables?: (string[]|null); - - /** SqlExportOptions schemaOnly */ - schemaOnly?: (boolean|null); - - /** SqlExportOptions cleanTargetObjects */ - cleanTargetObjects?: (boolean|null); - - /** SqlExportOptions ifExistTargetObjects */ - ifExistTargetObjects?: (boolean|null); - } - - /** Represents a SqlExportOptions. */ - class SqlExportOptions implements ISqlExportOptions { - - /** - * Constructs a new SqlExportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions); - - /** SqlExportOptions tables. */ - public tables: string[]; - - /** SqlExportOptions schemaOnly. */ - public schemaOnly?: (boolean|null); - - /** SqlExportOptions cleanTargetObjects. */ - public cleanTargetObjects?: (boolean|null); - - /** SqlExportOptions ifExistTargetObjects. */ - public ifExistTargetObjects?: (boolean|null); - - /** - * Creates a new SqlExportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlExportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; - - /** - * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @param message SqlExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @param message SqlExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; - - /** - * Verifies a SqlExportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlExportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions; - - /** - * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. - * @param message SqlExportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlExportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlExportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExportClusterResponse. */ - interface IExportClusterResponse { - - /** ExportClusterResponse gcsDestination */ - gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); - } - - /** Represents an ExportClusterResponse. */ - class ExportClusterResponse implements IExportClusterResponse { - - /** - * Constructs a new ExportClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IExportClusterResponse); - - /** ExportClusterResponse gcsDestination. */ - public gcsDestination?: (google.cloud.alloydb.v1.IGcsDestination|null); - - /** ExportClusterResponse destination. */ - public destination?: "gcsDestination"; - - /** - * Creates a new ExportClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IExportClusterResponse): google.cloud.alloydb.v1.ExportClusterResponse; - - /** - * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. - * @param message ExportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. - * @param message ExportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExportClusterResponse; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExportClusterResponse; - - /** - * Verifies an ExportClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExportClusterResponse; - - /** - * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. - * @param message ExportClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportClusterRequest. */ - interface IImportClusterRequest { - - /** ImportClusterRequest sqlImportOptions */ - sqlImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null); - - /** ImportClusterRequest csvImportOptions */ - csvImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null); - - /** ImportClusterRequest name */ - name?: (string|null); - - /** ImportClusterRequest gcsUri */ - gcsUri?: (string|null); - - /** ImportClusterRequest database */ - database?: (string|null); - - /** ImportClusterRequest user */ - user?: (string|null); - } - - /** Represents an ImportClusterRequest. */ - class ImportClusterRequest implements IImportClusterRequest { - - /** - * Constructs a new ImportClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IImportClusterRequest); - - /** ImportClusterRequest sqlImportOptions. */ - public sqlImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null); - - /** ImportClusterRequest csvImportOptions. */ - public csvImportOptions?: (google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null); - - /** ImportClusterRequest name. */ - public name: string; - - /** ImportClusterRequest gcsUri. */ - public gcsUri: string; - - /** ImportClusterRequest database. */ - public database: string; - - /** ImportClusterRequest user. */ - public user: string; - - /** ImportClusterRequest importOptions. */ - public importOptions?: ("sqlImportOptions"|"csvImportOptions"); - - /** - * Creates a new ImportClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IImportClusterRequest): google.cloud.alloydb.v1.ImportClusterRequest; - - /** - * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. - * @param message ImportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. - * @param message ImportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterRequest; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterRequest; - - /** - * Verifies an ImportClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterRequest; - - /** - * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. - * @param message ImportClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ImportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportClusterRequest { - - /** Properties of a SqlImportOptions. */ - interface ISqlImportOptions { - } - - /** Represents a SqlImportOptions. */ - class SqlImportOptions implements ISqlImportOptions { - - /** - * Constructs a new SqlImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions); - - /** - * Creates a new SqlImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlImportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; - - /** - * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @param message SqlImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @param message SqlImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; - - /** - * Verifies a SqlImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions; - - /** - * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. - * @param message SqlImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CsvImportOptions. */ - interface ICsvImportOptions { - - /** CsvImportOptions table */ - table?: (string|null); - - /** CsvImportOptions columns */ - columns?: (string[]|null); - - /** CsvImportOptions fieldDelimiter */ - fieldDelimiter?: (string|null); - - /** CsvImportOptions quoteCharacter */ - quoteCharacter?: (string|null); - - /** CsvImportOptions escapeCharacter */ - escapeCharacter?: (string|null); - } - - /** Represents a CsvImportOptions. */ - class CsvImportOptions implements ICsvImportOptions { - - /** - * Constructs a new CsvImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions); - - /** CsvImportOptions table. */ - public table: string; - - /** CsvImportOptions columns. */ - public columns: string[]; - - /** CsvImportOptions fieldDelimiter. */ - public fieldDelimiter: string; - - /** CsvImportOptions quoteCharacter. */ - public quoteCharacter: string; - - /** CsvImportOptions escapeCharacter. */ - public escapeCharacter: string; - - /** - * Creates a new CsvImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CsvImportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; - - /** - * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @param message CsvImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @param message CsvImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; - - /** - * Verifies a CsvImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CsvImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions; - - /** - * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. - * @param message CsvImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CsvImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CsvImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ImportClusterResponse. */ - interface IImportClusterResponse { - - /** ImportClusterResponse bytesDownloaded */ - bytesDownloaded?: (number|Long|string|null); - } - - /** Represents an ImportClusterResponse. */ - class ImportClusterResponse implements IImportClusterResponse { - - /** - * Constructs a new ImportClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IImportClusterResponse); - - /** ImportClusterResponse bytesDownloaded. */ - public bytesDownloaded: (number|Long|string); - - /** - * Creates a new ImportClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IImportClusterResponse): google.cloud.alloydb.v1.ImportClusterResponse; - - /** - * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. - * @param message ImportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. - * @param message ImportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ImportClusterResponse; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ImportClusterResponse; - - /** - * Verifies an ImportClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ImportClusterResponse; - - /** - * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. - * @param message ImportClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ImportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterRequest. */ - interface IUpgradeClusterRequest { - - /** UpgradeClusterRequest name */ - name?: (string|null); - - /** UpgradeClusterRequest version */ - version?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); - - /** UpgradeClusterRequest requestId */ - requestId?: (string|null); - - /** UpgradeClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpgradeClusterRequest etag */ - etag?: (string|null); - } - - /** Represents an UpgradeClusterRequest. */ - class UpgradeClusterRequest implements IUpgradeClusterRequest { - - /** - * Constructs a new UpgradeClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpgradeClusterRequest); - - /** UpgradeClusterRequest name. */ - public name: string; - - /** UpgradeClusterRequest version. */ - public version: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); - - /** UpgradeClusterRequest requestId. */ - public requestId: string; - - /** UpgradeClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** UpgradeClusterRequest etag. */ - public etag: string; - - /** - * Creates a new UpgradeClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpgradeClusterRequest): google.cloud.alloydb.v1.UpgradeClusterRequest; - - /** - * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. - * @param message UpgradeClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. - * @param message UpgradeClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterRequest; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterRequest; - - /** - * Verifies an UpgradeClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterRequest; - - /** - * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. - * @param message UpgradeClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterResponse. */ - interface IUpgradeClusterResponse { - - /** UpgradeClusterResponse status */ - status?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); - - /** UpgradeClusterResponse message */ - message?: (string|null); - - /** UpgradeClusterResponse clusterUpgradeDetails */ - clusterUpgradeDetails?: (google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails[]|null); - } - - /** Represents an UpgradeClusterResponse. */ - class UpgradeClusterResponse implements IUpgradeClusterResponse { - - /** - * Constructs a new UpgradeClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpgradeClusterResponse); - - /** UpgradeClusterResponse status. */ - public status: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); - - /** UpgradeClusterResponse message. */ - public message: string; - - /** UpgradeClusterResponse clusterUpgradeDetails. */ - public clusterUpgradeDetails: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails[]; - - /** - * Creates a new UpgradeClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpgradeClusterResponse): google.cloud.alloydb.v1.UpgradeClusterResponse; - - /** - * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. - * @param message UpgradeClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. - * @param message UpgradeClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse; - - /** - * Verifies an UpgradeClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse; - - /** - * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. - * @param message UpgradeClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpgradeClusterResponse { - - /** Properties of a StageInfo. */ - interface IStageInfo { - - /** StageInfo stage */ - stage?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null); - - /** StageInfo status */ - status?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); - - /** StageInfo logsUrl */ - logsUrl?: (string|null); - } - - /** Represents a StageInfo. */ - class StageInfo implements IStageInfo { - - /** - * Constructs a new StageInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo); - - /** StageInfo stage. */ - public stage: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage); - - /** StageInfo status. */ - public status: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); - - /** StageInfo logsUrl. */ - public logsUrl: string; - - /** - * Creates a new StageInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns StageInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; - - /** - * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @param message StageInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @param message StageInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; - - /** - * Decodes a StageInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; - - /** - * Verifies a StageInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo; - - /** - * Creates a plain object from a StageInfo message. Also converts values to other types if specified. - * @param message StageInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceUpgradeDetails. */ - interface IInstanceUpgradeDetails { - - /** InstanceUpgradeDetails name */ - name?: (string|null); - - /** InstanceUpgradeDetails upgradeStatus */ - upgradeStatus?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); - - /** InstanceUpgradeDetails instanceType */ - instanceType?: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType|null); - } - - /** Represents an InstanceUpgradeDetails. */ - class InstanceUpgradeDetails implements IInstanceUpgradeDetails { - - /** - * Constructs a new InstanceUpgradeDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails); - - /** InstanceUpgradeDetails name. */ - public name: string; - - /** InstanceUpgradeDetails upgradeStatus. */ - public upgradeStatus: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); - - /** InstanceUpgradeDetails instanceType. */ - public instanceType: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType); - - /** - * Creates a new InstanceUpgradeDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceUpgradeDetails instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @param message InstanceUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @param message InstanceUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Verifies an InstanceUpgradeDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceUpgradeDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. - * @param message InstanceUpgradeDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceUpgradeDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceUpgradeDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterUpgradeDetails. */ - interface IClusterUpgradeDetails { - - /** ClusterUpgradeDetails name */ - name?: (string|null); - - /** ClusterUpgradeDetails upgradeStatus */ - upgradeStatus?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); - - /** ClusterUpgradeDetails clusterType */ - clusterType?: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType|null); - - /** ClusterUpgradeDetails databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); - - /** ClusterUpgradeDetails stageInfo */ - stageInfo?: (google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo[]|null); - - /** ClusterUpgradeDetails instanceUpgradeDetails */ - instanceUpgradeDetails?: (google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails[]|null); - } - - /** Represents a ClusterUpgradeDetails. */ - class ClusterUpgradeDetails implements IClusterUpgradeDetails { - - /** - * Constructs a new ClusterUpgradeDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails); - - /** ClusterUpgradeDetails name. */ - public name: string; - - /** ClusterUpgradeDetails upgradeStatus. */ - public upgradeStatus: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); - - /** ClusterUpgradeDetails clusterType. */ - public clusterType: (google.cloud.alloydb.v1.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1.Cluster.ClusterType); - - /** ClusterUpgradeDetails databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); - - /** ClusterUpgradeDetails stageInfo. */ - public stageInfo: google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo[]; - - /** ClusterUpgradeDetails instanceUpgradeDetails. */ - public instanceUpgradeDetails: google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails[]; - - /** - * Creates a new ClusterUpgradeDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterUpgradeDetails instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @param message ClusterUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @param message ClusterUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Verifies a ClusterUpgradeDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterUpgradeDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. - * @param message ClusterUpgradeDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterUpgradeDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterUpgradeDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, - NOT_STARTED = 4, - IN_PROGRESS = 5, - SUCCESS = 1, - FAILED = 2, - PARTIAL_SUCCESS = 3, - CANCEL_IN_PROGRESS = 6, - CANCELLED = 7 - } - - /** Stage enum. */ - enum Stage { - STAGE_UNSPECIFIED = 0, - ALLOYDB_PRECHECK = 1, - PG_UPGRADE_CHECK = 2, - PREPARE_FOR_UPGRADE = 5, - PRIMARY_INSTANCE_UPGRADE = 3, - READ_POOL_INSTANCES_UPGRADE = 4, - ROLLBACK = 6, - CLEANUP = 7 - } - } - - /** Properties of a DeleteClusterRequest. */ - interface IDeleteClusterRequest { - - /** DeleteClusterRequest name */ - name?: (string|null); - - /** DeleteClusterRequest requestId */ - requestId?: (string|null); - - /** DeleteClusterRequest etag */ - etag?: (string|null); - - /** DeleteClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteClusterRequest force */ - force?: (boolean|null); - } - - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { - - /** - * Constructs a new DeleteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IDeleteClusterRequest); - - /** DeleteClusterRequest name. */ - public name: string; - - /** DeleteClusterRequest requestId. */ - public requestId: string; - - /** DeleteClusterRequest etag. */ - public etag: string; - - /** DeleteClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteClusterRequest force. */ - public force: boolean; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IDeleteClusterRequest): google.cloud.alloydb.v1.DeleteClusterRequest; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteClusterRequest; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteClusterRequest; - - /** - * Verifies a DeleteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteClusterRequest; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SwitchoverClusterRequest. */ - interface ISwitchoverClusterRequest { - - /** SwitchoverClusterRequest name */ - name?: (string|null); - - /** SwitchoverClusterRequest requestId */ - requestId?: (string|null); - - /** SwitchoverClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a SwitchoverClusterRequest. */ - class SwitchoverClusterRequest implements ISwitchoverClusterRequest { - - /** - * Constructs a new SwitchoverClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISwitchoverClusterRequest); - - /** SwitchoverClusterRequest name. */ - public name: string; - - /** SwitchoverClusterRequest requestId. */ - public requestId: string; - - /** SwitchoverClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new SwitchoverClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SwitchoverClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISwitchoverClusterRequest): google.cloud.alloydb.v1.SwitchoverClusterRequest; - - /** - * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. - * @param message SwitchoverClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. - * @param message SwitchoverClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SwitchoverClusterRequest; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SwitchoverClusterRequest; - - /** - * Verifies a SwitchoverClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SwitchoverClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SwitchoverClusterRequest; - - /** - * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. - * @param message SwitchoverClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SwitchoverClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SwitchoverClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SwitchoverClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PromoteClusterRequest. */ - interface IPromoteClusterRequest { - - /** PromoteClusterRequest name */ - name?: (string|null); - - /** PromoteClusterRequest requestId */ - requestId?: (string|null); - - /** PromoteClusterRequest etag */ - etag?: (string|null); - - /** PromoteClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a PromoteClusterRequest. */ - class PromoteClusterRequest implements IPromoteClusterRequest { - - /** - * Constructs a new PromoteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IPromoteClusterRequest); - - /** PromoteClusterRequest name. */ - public name: string; - - /** PromoteClusterRequest requestId. */ - public requestId: string; - - /** PromoteClusterRequest etag. */ - public etag: string; - - /** PromoteClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new PromoteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PromoteClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IPromoteClusterRequest): google.cloud.alloydb.v1.PromoteClusterRequest; - - /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.PromoteClusterRequest; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.PromoteClusterRequest; - - /** - * Verifies a PromoteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromoteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.PromoteClusterRequest; - - /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @param message PromoteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromoteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromoteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreClusterRequest. */ - interface IRestoreClusterRequest { - - /** RestoreClusterRequest backupSource */ - backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource */ - continuousBackupSource?: (google.cloud.alloydb.v1.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent */ - parent?: (string|null); - - /** RestoreClusterRequest clusterId */ - clusterId?: (string|null); - - /** RestoreClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** RestoreClusterRequest requestId */ - requestId?: (string|null); - - /** RestoreClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a RestoreClusterRequest. */ - class RestoreClusterRequest implements IRestoreClusterRequest { - - /** - * Constructs a new RestoreClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IRestoreClusterRequest); - - /** RestoreClusterRequest backupSource. */ - public backupSource?: (google.cloud.alloydb.v1.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource. */ - public continuousBackupSource?: (google.cloud.alloydb.v1.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent. */ - public parent: string; - - /** RestoreClusterRequest clusterId. */ - public clusterId: string; - - /** RestoreClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1.ICluster|null); - - /** RestoreClusterRequest requestId. */ - public requestId: string; - - /** RestoreClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** RestoreClusterRequest source. */ - public source?: ("backupSource"|"continuousBackupSource"); - - /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IRestoreClusterRequest): google.cloud.alloydb.v1.RestoreClusterRequest; - - /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestoreClusterRequest; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.RestoreClusterRequest; - - /** - * Verifies a RestoreClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.RestoreClusterRequest; - - /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @param message RestoreClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest filter */ - filter?: (string|null); - - /** ListInstancesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest filter. */ - public filter: string; - - /** ListInstancesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListInstancesRequest): google.cloud.alloydb.v1.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListInstancesResponse): google.cloud.alloydb.v1.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - - /** GetInstanceRequest view */ - view?: (google.cloud.alloydb.v1.InstanceView|keyof typeof google.cloud.alloydb.v1.InstanceView|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** GetInstanceRequest view. */ - public view: (google.cloud.alloydb.v1.InstanceView|keyof typeof google.cloud.alloydb.v1.InstanceView); - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGetInstanceRequest): google.cloud.alloydb.v1.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1.IInstance|null); - - /** CreateInstanceRequest requestId */ - requestId?: (string|null); - - /** CreateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1.IInstance|null); - - /** CreateInstanceRequest requestId. */ - public requestId: string; - - /** CreateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateInstanceRequest): google.cloud.alloydb.v1.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSecondaryInstanceRequest. */ - interface ICreateSecondaryInstanceRequest { - - /** CreateSecondaryInstanceRequest parent */ - parent?: (string|null); - - /** CreateSecondaryInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateSecondaryInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId */ - requestId?: (string|null); - - /** CreateSecondaryInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateSecondaryInstanceRequest. */ - class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { - - /** - * Constructs a new CreateSecondaryInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest); - - /** CreateSecondaryInstanceRequest parent. */ - public parent: string; - - /** CreateSecondaryInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateSecondaryInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId. */ - public requestId: string; - - /** CreateSecondaryInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecondaryInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; - - /** - * Verifies a CreateSecondaryInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecondaryInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateSecondaryInstanceRequest; - - /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecondaryInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecondaryInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequests. */ - interface ICreateInstanceRequests { - - /** CreateInstanceRequests createInstanceRequests */ - createInstanceRequests?: (google.cloud.alloydb.v1.ICreateInstanceRequest[]|null); - } - - /** Represents a CreateInstanceRequests. */ - class CreateInstanceRequests implements ICreateInstanceRequests { - - /** - * Constructs a new CreateInstanceRequests. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateInstanceRequests); - - /** CreateInstanceRequests createInstanceRequests. */ - public createInstanceRequests: google.cloud.alloydb.v1.ICreateInstanceRequest[]; - - /** - * Creates a new CreateInstanceRequests instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequests instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateInstanceRequests): google.cloud.alloydb.v1.CreateInstanceRequests; - - /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateInstanceRequests; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateInstanceRequests; - - /** - * Verifies a CreateInstanceRequests message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequests - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateInstanceRequests; - - /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @param message CreateInstanceRequests - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequests to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequests - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesRequest. */ - interface IBatchCreateInstancesRequest { - - /** BatchCreateInstancesRequest parent */ - parent?: (string|null); - - /** BatchCreateInstancesRequest requests */ - requests?: (google.cloud.alloydb.v1.ICreateInstanceRequests|null); - - /** BatchCreateInstancesRequest requestId */ - requestId?: (string|null); - } - - /** Represents a BatchCreateInstancesRequest. */ - class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { - - /** - * Constructs a new BatchCreateInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesRequest); - - /** BatchCreateInstancesRequest parent. */ - public parent: string; - - /** BatchCreateInstancesRequest requests. */ - public requests?: (google.cloud.alloydb.v1.ICreateInstanceRequests|null); - - /** BatchCreateInstancesRequest requestId. */ - public requestId: string; - - /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesRequest): google.cloud.alloydb.v1.BatchCreateInstancesRequest; - - /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstancesRequest; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstancesRequest; - - /** - * Verifies a BatchCreateInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstancesRequest; - - /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @param message BatchCreateInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesResponse. */ - interface IBatchCreateInstancesResponse { - - /** BatchCreateInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1.IInstance[]|null); - } - - /** Represents a BatchCreateInstancesResponse. */ - class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { - - /** - * Constructs a new BatchCreateInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesResponse); - - /** BatchCreateInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1.IInstance[]; - - /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesResponse): google.cloud.alloydb.v1.BatchCreateInstancesResponse; - - /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstancesResponse; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstancesResponse; - - /** - * Verifies a BatchCreateInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstancesResponse; - - /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @param message BatchCreateInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesMetadata. */ - interface IBatchCreateInstancesMetadata { - - /** BatchCreateInstancesMetadata instanceTargets */ - instanceTargets?: (string[]|null); - - /** BatchCreateInstancesMetadata instanceStatuses */ - instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1.IBatchCreateInstanceStatus }|null); - } - - /** Represents a BatchCreateInstancesMetadata. */ - class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { - - /** - * Constructs a new BatchCreateInstancesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata); - - /** BatchCreateInstancesMetadata instanceTargets. */ - public instanceTargets: string[]; - - /** BatchCreateInstancesMetadata instanceStatuses. */ - public instanceStatuses: { [k: string]: google.cloud.alloydb.v1.IBatchCreateInstanceStatus }; - - /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; - - /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; - - /** - * Verifies a BatchCreateInstancesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstancesMetadata; - - /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @param message BatchCreateInstancesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstanceStatus. */ - interface IBatchCreateInstanceStatus { - - /** BatchCreateInstanceStatus state */ - state?: (google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|null); - - /** BatchCreateInstanceStatus errorMsg */ - errorMsg?: (string|null); - - /** BatchCreateInstanceStatus error */ - error?: (google.rpc.IStatus|null); - - /** BatchCreateInstanceStatus type */ - type?: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType|null); - } - - /** Represents a BatchCreateInstanceStatus. */ - class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { - - /** - * Constructs a new BatchCreateInstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IBatchCreateInstanceStatus); - - /** BatchCreateInstanceStatus state. */ - public state: (google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1.BatchCreateInstanceStatus.State); - - /** BatchCreateInstanceStatus errorMsg. */ - public errorMsg: string; - - /** BatchCreateInstanceStatus error. */ - public error?: (google.rpc.IStatus|null); - - /** BatchCreateInstanceStatus type. */ - public type: (google.cloud.alloydb.v1.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1.Instance.InstanceType); - - /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstanceStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1.IBatchCreateInstanceStatus): google.cloud.alloydb.v1.BatchCreateInstanceStatus; - - /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.BatchCreateInstanceStatus; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.BatchCreateInstanceStatus; - - /** - * Verifies a BatchCreateInstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.BatchCreateInstanceStatus; - - /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @param message BatchCreateInstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchCreateInstanceStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING_CREATE = 1, - READY = 2, - CREATING = 3, - DELETING = 4, - FAILED = 5, - ROLLED_BACK = 6 - } - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1.IInstance|null); - - /** UpdateInstanceRequest requestId */ - requestId?: (string|null); - - /** UpdateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateInstanceRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { - - /** - * Constructs a new UpdateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpdateInstanceRequest); - - /** UpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1.IInstance|null); - - /** UpdateInstanceRequest requestId. */ - public requestId: string; - - /** UpdateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateInstanceRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpdateInstanceRequest): google.cloud.alloydb.v1.UpdateInstanceRequest; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateInstanceRequest; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateInstanceRequest; - - /** - * Verifies an UpdateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateInstanceRequest; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - - /** DeleteInstanceRequest requestId */ - requestId?: (string|null); - - /** DeleteInstanceRequest etag */ - etag?: (string|null); - - /** DeleteInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** DeleteInstanceRequest requestId. */ - public requestId: string; - - /** DeleteInstanceRequest etag. */ - public etag: string; - - /** DeleteInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IDeleteInstanceRequest): google.cloud.alloydb.v1.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FailoverInstanceRequest. */ - interface IFailoverInstanceRequest { - - /** FailoverInstanceRequest name */ - name?: (string|null); - - /** FailoverInstanceRequest requestId */ - requestId?: (string|null); - - /** FailoverInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a FailoverInstanceRequest. */ - class FailoverInstanceRequest implements IFailoverInstanceRequest { - - /** - * Constructs a new FailoverInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IFailoverInstanceRequest); - - /** FailoverInstanceRequest name. */ - public name: string; - - /** FailoverInstanceRequest requestId. */ - public requestId: string; - - /** FailoverInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FailoverInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IFailoverInstanceRequest): google.cloud.alloydb.v1.FailoverInstanceRequest; - - /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.FailoverInstanceRequest; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.FailoverInstanceRequest; - - /** - * Verifies a FailoverInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FailoverInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.FailoverInstanceRequest; - - /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @param message FailoverInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FailoverInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FailoverInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InjectFaultRequest. */ - interface IInjectFaultRequest { - - /** InjectFaultRequest faultType */ - faultType?: (google.cloud.alloydb.v1.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1.InjectFaultRequest.FaultType|null); - - /** InjectFaultRequest name */ - name?: (string|null); - - /** InjectFaultRequest requestId */ - requestId?: (string|null); - - /** InjectFaultRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an InjectFaultRequest. */ - class InjectFaultRequest implements IInjectFaultRequest { - - /** - * Constructs a new InjectFaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IInjectFaultRequest); - - /** InjectFaultRequest faultType. */ - public faultType: (google.cloud.alloydb.v1.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1.InjectFaultRequest.FaultType); - - /** InjectFaultRequest name. */ - public name: string; - - /** InjectFaultRequest requestId. */ - public requestId: string; - - /** InjectFaultRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new InjectFaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InjectFaultRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IInjectFaultRequest): google.cloud.alloydb.v1.InjectFaultRequest; - - /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. - * @param message InjectFaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. - * @param message InjectFaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.InjectFaultRequest; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.InjectFaultRequest; - - /** - * Verifies an InjectFaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InjectFaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.InjectFaultRequest; - - /** - * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. - * @param message InjectFaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InjectFaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InjectFaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InjectFaultRequest { - - /** FaultType enum. */ - enum FaultType { - FAULT_TYPE_UNSPECIFIED = 0, - STOP_VM = 1 - } - } - - /** Properties of a RestartInstanceRequest. */ - interface IRestartInstanceRequest { - - /** RestartInstanceRequest name */ - name?: (string|null); - - /** RestartInstanceRequest requestId */ - requestId?: (string|null); - - /** RestartInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** RestartInstanceRequest nodeIds */ - nodeIds?: (string[]|null); - } - - /** Represents a RestartInstanceRequest. */ - class RestartInstanceRequest implements IRestartInstanceRequest { - - /** - * Constructs a new RestartInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest); - - /** RestartInstanceRequest name. */ - public name: string; - - /** RestartInstanceRequest requestId. */ - public requestId: string; - - /** RestartInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** RestartInstanceRequest nodeIds. */ - public nodeIds: string[]; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestartInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IRestartInstanceRequest): google.cloud.alloydb.v1.RestartInstanceRequest; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.RestartInstanceRequest; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.RestartInstanceRequest; - - /** - * Verifies a RestartInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestartInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.RestartInstanceRequest; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @param message RestartInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestartInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlRequest. */ - interface IExecuteSqlRequest { - - /** ExecuteSqlRequest password */ - password?: (string|null); - - /** ExecuteSqlRequest instance */ - instance?: (string|null); - - /** ExecuteSqlRequest database */ - database?: (string|null); - - /** ExecuteSqlRequest user */ - user?: (string|null); - - /** ExecuteSqlRequest sqlStatement */ - sqlStatement?: (string|null); - - /** ExecuteSqlRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an ExecuteSqlRequest. */ - class ExecuteSqlRequest implements IExecuteSqlRequest { - - /** - * Constructs a new ExecuteSqlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IExecuteSqlRequest); - - /** ExecuteSqlRequest password. */ - public password?: (string|null); - - /** ExecuteSqlRequest instance. */ - public instance: string; - - /** ExecuteSqlRequest database. */ - public database: string; - - /** ExecuteSqlRequest user. */ - public user: string; - - /** ExecuteSqlRequest sqlStatement. */ - public sqlStatement: string; - - /** ExecuteSqlRequest validateOnly. */ - public validateOnly: boolean; - - /** ExecuteSqlRequest userCredential. */ - public userCredential?: "password"; - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IExecuteSqlRequest): google.cloud.alloydb.v1.ExecuteSqlRequest; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExecuteSqlRequest; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExecuteSqlRequest; - - /** - * Verifies an ExecuteSqlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExecuteSqlRequest; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @param message ExecuteSqlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlResponse. */ - interface IExecuteSqlResponse { - - /** ExecuteSqlResponse sqlResults */ - sqlResults?: (google.cloud.alloydb.v1.ISqlResult[]|null); - - /** ExecuteSqlResponse metadata */ - metadata?: (google.cloud.alloydb.v1.IExecuteSqlMetadata|null); - } - - /** Represents an ExecuteSqlResponse. */ - class ExecuteSqlResponse implements IExecuteSqlResponse { - - /** - * Constructs a new ExecuteSqlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IExecuteSqlResponse); - - /** ExecuteSqlResponse sqlResults. */ - public sqlResults: google.cloud.alloydb.v1.ISqlResult[]; - - /** ExecuteSqlResponse metadata. */ - public metadata?: (google.cloud.alloydb.v1.IExecuteSqlMetadata|null); - - /** - * Creates a new ExecuteSqlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IExecuteSqlResponse): google.cloud.alloydb.v1.ExecuteSqlResponse; - - /** - * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. - * @param message ExecuteSqlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. - * @param message ExecuteSqlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExecuteSqlResponse; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExecuteSqlResponse; - - /** - * Verifies an ExecuteSqlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExecuteSqlResponse; - - /** - * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. - * @param message ExecuteSqlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExecuteSqlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlMetadata. */ - interface IExecuteSqlMetadata { - - /** ExecuteSqlMetadata message */ - message?: (string|null); - - /** ExecuteSqlMetadata partialResult */ - partialResult?: (boolean|null); - - /** ExecuteSqlMetadata sqlStatementExecutionDuration */ - sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); - - /** ExecuteSqlMetadata status */ - status?: (google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|null); - } - - /** Represents an ExecuteSqlMetadata. */ - class ExecuteSqlMetadata implements IExecuteSqlMetadata { - - /** - * Constructs a new ExecuteSqlMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IExecuteSqlMetadata); - - /** ExecuteSqlMetadata message. */ - public message: string; - - /** ExecuteSqlMetadata partialResult. */ - public partialResult: boolean; - - /** ExecuteSqlMetadata sqlStatementExecutionDuration. */ - public sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); - - /** ExecuteSqlMetadata status. */ - public status: (google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1.ExecuteSqlMetadata.Status); - - /** - * Creates a new ExecuteSqlMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1.IExecuteSqlMetadata): google.cloud.alloydb.v1.ExecuteSqlMetadata; - - /** - * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. - * @param message ExecuteSqlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. - * @param message ExecuteSqlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ExecuteSqlMetadata; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ExecuteSqlMetadata; - - /** - * Verifies an ExecuteSqlMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ExecuteSqlMetadata; - - /** - * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. - * @param message ExecuteSqlMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ExecuteSqlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteSqlMetadata { - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, - OK = 1, - PARTIAL = 2, - ERROR = 3 - } - } - - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { - - /** - * Constructs a new ListBackupsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; - - /** ListBackupsRequest pageToken. */ - public pageToken: string; - - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListBackupsRequest): google.cloud.alloydb.v1.ListBackupsRequest; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListBackupsRequest; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListBackupsRequest; - - /** - * Verifies a ListBackupsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListBackupsRequest; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.cloud.alloydb.v1.IBackup[]|null); - - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { - - /** - * Constructs a new ListBackupsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListBackupsResponse); - - /** ListBackupsResponse backups. */ - public backups: google.cloud.alloydb.v1.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListBackupsResponse): google.cloud.alloydb.v1.ListBackupsResponse; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListBackupsResponse; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListBackupsResponse; - - /** - * Verifies a ListBackupsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListBackupsResponse; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { - - /** GetBackupRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { - - /** - * Constructs a new GetBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGetBackupRequest); - - /** GetBackupRequest name. */ - public name: string; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGetBackupRequest): google.cloud.alloydb.v1.GetBackupRequest; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetBackupRequest; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetBackupRequest; - - /** - * Verifies a GetBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetBackupRequest; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { - - /** CreateBackupRequest parent */ - parent?: (string|null); - - /** CreateBackupRequest backupId */ - backupId?: (string|null); - - /** CreateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1.IBackup|null); - - /** CreateBackupRequest requestId */ - requestId?: (string|null); - - /** CreateBackupRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { - - /** - * Constructs a new CreateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateBackupRequest); - - /** CreateBackupRequest parent. */ - public parent: string; - - /** CreateBackupRequest backupId. */ - public backupId: string; - - /** CreateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1.IBackup|null); - - /** CreateBackupRequest requestId. */ - public requestId: string; - - /** CreateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateBackupRequest): google.cloud.alloydb.v1.CreateBackupRequest; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateBackupRequest; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateBackupRequest; - - /** - * Verifies a CreateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateBackupRequest; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1.IBackup|null); - - /** UpdateBackupRequest requestId */ - requestId?: (string|null); - - /** UpdateBackupRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateBackupRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { - - /** - * Constructs a new UpdateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpdateBackupRequest); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1.IBackup|null); - - /** UpdateBackupRequest requestId. */ - public requestId: string; - - /** UpdateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateBackupRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpdateBackupRequest): google.cloud.alloydb.v1.UpdateBackupRequest; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateBackupRequest; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateBackupRequest; - - /** - * Verifies an UpdateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateBackupRequest; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { - - /** DeleteBackupRequest name */ - name?: (string|null); - - /** DeleteBackupRequest requestId */ - requestId?: (string|null); - - /** DeleteBackupRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteBackupRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { - - /** - * Constructs a new DeleteBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** DeleteBackupRequest requestId. */ - public requestId: string; - - /** DeleteBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteBackupRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IDeleteBackupRequest): google.cloud.alloydb.v1.DeleteBackupRequest; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteBackupRequest; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteBackupRequest; - - /** - * Verifies a DeleteBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteBackupRequest; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSupportedDatabaseFlagsRequest. */ - interface IListSupportedDatabaseFlagsRequest { - - /** ListSupportedDatabaseFlagsRequest parent */ - parent?: (string|null); - - /** ListSupportedDatabaseFlagsRequest pageSize */ - pageSize?: (number|null); - - /** ListSupportedDatabaseFlagsRequest pageToken */ - pageToken?: (string|null); - - /** ListSupportedDatabaseFlagsRequest scope */ - scope?: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null); - } - - /** Represents a ListSupportedDatabaseFlagsRequest. */ - class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { - - /** - * Constructs a new ListSupportedDatabaseFlagsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest); - - /** ListSupportedDatabaseFlagsRequest parent. */ - public parent: string; - - /** ListSupportedDatabaseFlagsRequest pageSize. */ - public pageSize: number; - - /** ListSupportedDatabaseFlagsRequest pageToken. */ - public pageToken: string; - - /** ListSupportedDatabaseFlagsRequest scope. */ - public scope: (google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope); - - /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; - - /** - * Verifies a ListSupportedDatabaseFlagsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSupportedDatabaseFlagsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSupportedDatabaseFlagsResponse. */ - interface IListSupportedDatabaseFlagsResponse { - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ - supportedDatabaseFlags?: (google.cloud.alloydb.v1.ISupportedDatabaseFlag[]|null); - - /** ListSupportedDatabaseFlagsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSupportedDatabaseFlagsResponse. */ - class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { - - /** - * Constructs a new ListSupportedDatabaseFlagsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse); - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ - public supportedDatabaseFlags: google.cloud.alloydb.v1.ISupportedDatabaseFlag[]; - - /** ListSupportedDatabaseFlagsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; - - /** - * Verifies a ListSupportedDatabaseFlagsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSupportedDatabaseFlagsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateClientCertificateRequest. */ - interface IGenerateClientCertificateRequest { - - /** GenerateClientCertificateRequest parent */ - parent?: (string|null); - - /** GenerateClientCertificateRequest requestId */ - requestId?: (string|null); - - /** GenerateClientCertificateRequest certDuration */ - certDuration?: (google.protobuf.IDuration|null); - - /** GenerateClientCertificateRequest publicKey */ - publicKey?: (string|null); - - /** GenerateClientCertificateRequest useMetadataExchange */ - useMetadataExchange?: (boolean|null); - } - - /** Represents a GenerateClientCertificateRequest. */ - class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { - - /** - * Constructs a new GenerateClientCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateRequest); - - /** GenerateClientCertificateRequest parent. */ - public parent: string; - - /** GenerateClientCertificateRequest requestId. */ - public requestId: string; - - /** GenerateClientCertificateRequest certDuration. */ - public certDuration?: (google.protobuf.IDuration|null); - - /** GenerateClientCertificateRequest publicKey. */ - public publicKey: string; - - /** GenerateClientCertificateRequest useMetadataExchange. */ - public useMetadataExchange: boolean; - - /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateClientCertificateRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateRequest): google.cloud.alloydb.v1.GenerateClientCertificateRequest; - - /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GenerateClientCertificateRequest; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GenerateClientCertificateRequest; - - /** - * Verifies a GenerateClientCertificateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateClientCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GenerateClientCertificateRequest; - - /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @param message GenerateClientCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateClientCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateClientCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateClientCertificateResponse. */ - interface IGenerateClientCertificateResponse { - - /** GenerateClientCertificateResponse pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** GenerateClientCertificateResponse caCert */ - caCert?: (string|null); - } - - /** Represents a GenerateClientCertificateResponse. */ - class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { - - /** - * Constructs a new GenerateClientCertificateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateResponse); - - /** GenerateClientCertificateResponse pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** GenerateClientCertificateResponse caCert. */ - public caCert: string; - - /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateClientCertificateResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGenerateClientCertificateResponse): google.cloud.alloydb.v1.GenerateClientCertificateResponse; - - /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GenerateClientCertificateResponse; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GenerateClientCertificateResponse; - - /** - * Verifies a GenerateClientCertificateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateClientCertificateResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GenerateClientCertificateResponse; - - /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @param message GenerateClientCertificateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateClientCertificateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateClientCertificateResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetConnectionInfoRequest. */ - interface IGetConnectionInfoRequest { - - /** GetConnectionInfoRequest parent */ - parent?: (string|null); - - /** GetConnectionInfoRequest requestId */ - requestId?: (string|null); - } - - /** Represents a GetConnectionInfoRequest. */ - class GetConnectionInfoRequest implements IGetConnectionInfoRequest { - - /** - * Constructs a new GetConnectionInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGetConnectionInfoRequest); - - /** GetConnectionInfoRequest parent. */ - public parent: string; - - /** GetConnectionInfoRequest requestId. */ - public requestId: string; - - /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetConnectionInfoRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGetConnectionInfoRequest): google.cloud.alloydb.v1.GetConnectionInfoRequest; - - /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetConnectionInfoRequest; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetConnectionInfoRequest; - - /** - * Verifies a GetConnectionInfoRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetConnectionInfoRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetConnectionInfoRequest; - - /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @param message GetConnectionInfoRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetConnectionInfoRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetConnectionInfoRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata batchCreateInstancesMetadata */ - batchCreateInstancesMetadata?: (google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata upgradeClusterStatus */ - upgradeClusterStatus?: (google.cloud.alloydb.v1.IUpgradeClusterStatus|null); - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IOperationMetadata); - - /** OperationMetadata batchCreateInstancesMetadata. */ - public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata upgradeClusterStatus. */ - public upgradeClusterStatus?: (google.cloud.alloydb.v1.IUpgradeClusterStatus|null); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** OperationMetadata requestSpecific. */ - public requestSpecific?: ("batchCreateInstancesMetadata"|"upgradeClusterStatus"); - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1.IOperationMetadata): google.cloud.alloydb.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterStatus. */ - interface IUpgradeClusterStatus { - - /** UpgradeClusterStatus state */ - state?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); - - /** UpgradeClusterStatus cancellable */ - cancellable?: (boolean|null); - - /** UpgradeClusterStatus sourceVersion */ - sourceVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); - - /** UpgradeClusterStatus targetVersion */ - targetVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); - - /** UpgradeClusterStatus stages */ - stages?: (google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus[]|null); - } - - /** Represents an UpgradeClusterStatus. */ - class UpgradeClusterStatus implements IUpgradeClusterStatus { - - /** - * Constructs a new UpgradeClusterStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpgradeClusterStatus); - - /** UpgradeClusterStatus state. */ - public state: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); - - /** UpgradeClusterStatus cancellable. */ - public cancellable: boolean; - - /** UpgradeClusterStatus sourceVersion. */ - public sourceVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); - - /** UpgradeClusterStatus targetVersion. */ - public targetVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); - - /** UpgradeClusterStatus stages. */ - public stages: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus[]; - - /** - * Creates a new UpgradeClusterStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpgradeClusterStatus): google.cloud.alloydb.v1.UpgradeClusterStatus; - - /** - * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. - * @param message UpgradeClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. - * @param message UpgradeClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus; - - /** - * Verifies an UpgradeClusterStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus; - - /** - * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. - * @param message UpgradeClusterStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpgradeClusterStatus { - - /** Properties of a StageStatus. */ - interface IStageStatus { - - /** StageStatus readPoolInstancesUpgrade */ - readPoolInstancesUpgrade?: (google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); - - /** StageStatus stage */ - stage?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null); - - /** StageStatus state */ - state?: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null); - - /** StageStatus schedule */ - schedule?: (google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null); - } - - /** Represents a StageStatus. */ - class StageStatus implements IStageStatus { - - /** - * Constructs a new StageStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus); - - /** StageStatus readPoolInstancesUpgrade. */ - public readPoolInstancesUpgrade?: (google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); - - /** StageStatus stage. */ - public stage: (google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Stage); - - /** StageStatus state. */ - public state: (google.cloud.alloydb.v1.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1.UpgradeClusterResponse.Status); - - /** StageStatus schedule. */ - public schedule?: (google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null); - - /** StageStatus stageSpecificStatus. */ - public stageSpecificStatus?: "readPoolInstancesUpgrade"; - - /** - * Creates a new StageStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns StageStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; - - /** - * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @param message StageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @param message StageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; - - /** - * Decodes a StageStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; - - /** - * Verifies a StageStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus; - - /** - * Creates a plain object from a StageStatus message. Also converts values to other types if specified. - * @param message StageStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StageStatus { - - /** Properties of a StageSchedule. */ - interface IStageSchedule { - - /** StageSchedule estimatedStartTime */ - estimatedStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualStartTime */ - actualStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule estimatedEndTime */ - estimatedEndTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualEndTime */ - actualEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a StageSchedule. */ - class StageSchedule implements IStageSchedule { - - /** - * Constructs a new StageSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule); - - /** StageSchedule estimatedStartTime. */ - public estimatedStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualStartTime. */ - public actualStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule estimatedEndTime. */ - public estimatedEndTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualEndTime. */ - public actualEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new StageSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns StageSchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @param message StageSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @param message StageSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Decodes a StageSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Verifies a StageSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. - * @param message StageSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReadPoolInstancesUpgradeStageStatus. */ - interface IReadPoolInstancesUpgradeStageStatus { - - /** ReadPoolInstancesUpgradeStageStatus upgradeStats */ - upgradeStats?: (google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); - } - - /** Represents a ReadPoolInstancesUpgradeStageStatus. */ - class ReadPoolInstancesUpgradeStageStatus implements IReadPoolInstancesUpgradeStageStatus { - - /** - * Constructs a new ReadPoolInstancesUpgradeStageStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus); - - /** ReadPoolInstancesUpgradeStageStatus upgradeStats. */ - public upgradeStats?: (google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); - - /** - * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolInstancesUpgradeStageStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Verifies a ReadPoolInstancesUpgradeStageStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolInstancesUpgradeStageStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. - * @param message ReadPoolInstancesUpgradeStageStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadPoolInstancesUpgradeStageStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadPoolInstancesUpgradeStageStatus { - - /** Properties of a Stats. */ - interface IStats { - - /** Stats notStarted */ - notStarted?: (number|null); - - /** Stats ongoing */ - ongoing?: (number|null); - - /** Stats success */ - success?: (number|null); - - /** Stats failed */ - failed?: (number|null); - } - - /** Represents a Stats. */ - class Stats implements IStats { - - /** - * Constructs a new Stats. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats); - - /** Stats notStarted. */ - public notStarted: number; - - /** Stats ongoing. */ - public ongoing: number; - - /** Stats success. */ - public success: number; - - /** Stats failed. */ - public failed: number; - - /** - * Creates a new Stats instance using the specified properties. - * @param [properties] Properties to set - * @returns Stats instance - */ - public static create(properties?: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Verifies a Stats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Stats - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @param message Stats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Stats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Stats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a ListUsersRequest. */ - interface IListUsersRequest { - - /** ListUsersRequest parent */ - parent?: (string|null); - - /** ListUsersRequest pageSize */ - pageSize?: (number|null); - - /** ListUsersRequest pageToken */ - pageToken?: (string|null); - - /** ListUsersRequest filter */ - filter?: (string|null); - - /** ListUsersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListUsersRequest. */ - class ListUsersRequest implements IListUsersRequest { - - /** - * Constructs a new ListUsersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListUsersRequest); - - /** ListUsersRequest parent. */ - public parent: string; - - /** ListUsersRequest pageSize. */ - public pageSize: number; - - /** ListUsersRequest pageToken. */ - public pageToken: string; - - /** ListUsersRequest filter. */ - public filter: string; - - /** ListUsersRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListUsersRequest): google.cloud.alloydb.v1.ListUsersRequest; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListUsersRequest; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListUsersRequest; - - /** - * Verifies a ListUsersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListUsersRequest; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @param message ListUsersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListUsersResponse. */ - interface IListUsersResponse { - - /** ListUsersResponse users */ - users?: (google.cloud.alloydb.v1.IUser[]|null); - - /** ListUsersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListUsersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListUsersResponse. */ - class ListUsersResponse implements IListUsersResponse { - - /** - * Constructs a new ListUsersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListUsersResponse); - - /** ListUsersResponse users. */ - public users: google.cloud.alloydb.v1.IUser[]; - - /** ListUsersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListUsersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListUsersResponse): google.cloud.alloydb.v1.ListUsersResponse; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListUsersResponse; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListUsersResponse; - - /** - * Verifies a ListUsersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListUsersResponse; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @param message ListUsersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetUserRequest. */ - interface IGetUserRequest { - - /** GetUserRequest name */ - name?: (string|null); - } - - /** Represents a GetUserRequest. */ - class GetUserRequest implements IGetUserRequest { - - /** - * Constructs a new GetUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IGetUserRequest); - - /** GetUserRequest name. */ - public name: string; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IGetUserRequest): google.cloud.alloydb.v1.GetUserRequest; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.GetUserRequest; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.GetUserRequest; - - /** - * Verifies a GetUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.GetUserRequest; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @param message GetUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateUserRequest. */ - interface ICreateUserRequest { - - /** CreateUserRequest parent */ - parent?: (string|null); - - /** CreateUserRequest userId */ - userId?: (string|null); - - /** CreateUserRequest user */ - user?: (google.cloud.alloydb.v1.IUser|null); - - /** CreateUserRequest requestId */ - requestId?: (string|null); - - /** CreateUserRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateUserRequest. */ - class CreateUserRequest implements ICreateUserRequest { - - /** - * Constructs a new CreateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ICreateUserRequest); - - /** CreateUserRequest parent. */ - public parent: string; - - /** CreateUserRequest userId. */ - public userId: string; - - /** CreateUserRequest user. */ - public user?: (google.cloud.alloydb.v1.IUser|null); - - /** CreateUserRequest requestId. */ - public requestId: string; - - /** CreateUserRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.ICreateUserRequest): google.cloud.alloydb.v1.CreateUserRequest; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.CreateUserRequest; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.CreateUserRequest; - - /** - * Verifies a CreateUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.CreateUserRequest; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @param message CreateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateUserRequest. */ - interface IUpdateUserRequest { - - /** UpdateUserRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateUserRequest user */ - user?: (google.cloud.alloydb.v1.IUser|null); - - /** UpdateUserRequest requestId */ - requestId?: (string|null); - - /** UpdateUserRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateUserRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateUserRequest. */ - class UpdateUserRequest implements IUpdateUserRequest { - - /** - * Constructs a new UpdateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IUpdateUserRequest); - - /** UpdateUserRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateUserRequest user. */ - public user?: (google.cloud.alloydb.v1.IUser|null); - - /** UpdateUserRequest requestId. */ - public requestId: string; - - /** UpdateUserRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateUserRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IUpdateUserRequest): google.cloud.alloydb.v1.UpdateUserRequest; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.UpdateUserRequest; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.UpdateUserRequest; - - /** - * Verifies an UpdateUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.UpdateUserRequest; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @param message UpdateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteUserRequest. */ - interface IDeleteUserRequest { - - /** DeleteUserRequest name */ - name?: (string|null); - - /** DeleteUserRequest requestId */ - requestId?: (string|null); - - /** DeleteUserRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteUserRequest. */ - class DeleteUserRequest implements IDeleteUserRequest { - - /** - * Constructs a new DeleteUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IDeleteUserRequest); - - /** DeleteUserRequest name. */ - public name: string; - - /** DeleteUserRequest requestId. */ - public requestId: string; - - /** DeleteUserRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IDeleteUserRequest): google.cloud.alloydb.v1.DeleteUserRequest; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.DeleteUserRequest; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.DeleteUserRequest; - - /** - * Verifies a DeleteUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.DeleteUserRequest; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @param message DeleteUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesRequest. */ - interface IListDatabasesRequest { - - /** ListDatabasesRequest parent */ - parent?: (string|null); - - /** ListDatabasesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabasesRequest pageToken */ - pageToken?: (string|null); - - /** ListDatabasesRequest filter */ - filter?: (string|null); - } - - /** Represents a ListDatabasesRequest. */ - class ListDatabasesRequest implements IListDatabasesRequest { - - /** - * Constructs a new ListDatabasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListDatabasesRequest); - - /** ListDatabasesRequest parent. */ - public parent: string; - - /** ListDatabasesRequest pageSize. */ - public pageSize: number; - - /** ListDatabasesRequest pageToken. */ - public pageToken: string; - - /** ListDatabasesRequest filter. */ - public filter: string; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListDatabasesRequest): google.cloud.alloydb.v1.ListDatabasesRequest; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListDatabasesRequest; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListDatabasesRequest; - - /** - * Verifies a ListDatabasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListDatabasesRequest; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @param message ListDatabasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesResponse. */ - interface IListDatabasesResponse { - - /** ListDatabasesResponse databases */ - databases?: (google.cloud.alloydb.v1.IDatabase[]|null); - - /** ListDatabasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabasesResponse. */ - class ListDatabasesResponse implements IListDatabasesResponse { - - /** - * Constructs a new ListDatabasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.IListDatabasesResponse); - - /** ListDatabasesResponse databases. */ - public databases: google.cloud.alloydb.v1.IDatabase[]; - - /** ListDatabasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1.IListDatabasesResponse): google.cloud.alloydb.v1.ListDatabasesResponse; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.ListDatabasesResponse; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.ListDatabasesResponse; - - /** - * Verifies a ListDatabasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.ListDatabasesResponse; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @param message ListDatabasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResult. */ - interface ISqlResult { - - /** SqlResult columns */ - columns?: (google.cloud.alloydb.v1.ISqlResultColumn[]|null); - - /** SqlResult rows */ - rows?: (google.cloud.alloydb.v1.ISqlResultRow[]|null); - } - - /** Represents a SqlResult. */ - class SqlResult implements ISqlResult { - - /** - * Constructs a new SqlResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISqlResult); - - /** SqlResult columns. */ - public columns: google.cloud.alloydb.v1.ISqlResultColumn[]; - - /** SqlResult rows. */ - public rows: google.cloud.alloydb.v1.ISqlResultRow[]; - - /** - * Creates a new SqlResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResult instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISqlResult): google.cloud.alloydb.v1.SqlResult; - - /** - * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. - * @param message SqlResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. - * @param message SqlResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResult; - - /** - * Decodes a SqlResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResult; - - /** - * Verifies a SqlResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResult; - - /** - * Creates a plain object from a SqlResult message. Also converts values to other types if specified. - * @param message SqlResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SqlResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultColumn. */ - interface ISqlResultColumn { - - /** SqlResultColumn name */ - name?: (string|null); - - /** SqlResultColumn type */ - type?: (string|null); - } - - /** Represents a SqlResultColumn. */ - class SqlResultColumn implements ISqlResultColumn { - - /** - * Constructs a new SqlResultColumn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISqlResultColumn); - - /** SqlResultColumn name. */ - public name: string; - - /** SqlResultColumn type. */ - public type: string; - - /** - * Creates a new SqlResultColumn instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultColumn instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISqlResultColumn): google.cloud.alloydb.v1.SqlResultColumn; - - /** - * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. - * @param message SqlResultColumn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. - * @param message SqlResultColumn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResultColumn; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResultColumn; - - /** - * Verifies a SqlResultColumn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultColumn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResultColumn; - - /** - * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. - * @param message SqlResultColumn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SqlResultColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultColumn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultColumn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultRow. */ - interface ISqlResultRow { - - /** SqlResultRow values */ - values?: (google.cloud.alloydb.v1.ISqlResultValue[]|null); - } - - /** Represents a SqlResultRow. */ - class SqlResultRow implements ISqlResultRow { - - /** - * Constructs a new SqlResultRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISqlResultRow); - - /** SqlResultRow values. */ - public values: google.cloud.alloydb.v1.ISqlResultValue[]; - - /** - * Creates a new SqlResultRow instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultRow instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISqlResultRow): google.cloud.alloydb.v1.SqlResultRow; - - /** - * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. - * @param message SqlResultRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. - * @param message SqlResultRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResultRow; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResultRow; - - /** - * Verifies a SqlResultRow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResultRow; - - /** - * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. - * @param message SqlResultRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SqlResultRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultRow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultValue. */ - interface ISqlResultValue { - - /** SqlResultValue value */ - value?: (string|null); - - /** SqlResultValue nullValue */ - nullValue?: (boolean|null); - } - - /** Represents a SqlResultValue. */ - class SqlResultValue implements ISqlResultValue { - - /** - * Constructs a new SqlResultValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1.ISqlResultValue); - - /** SqlResultValue value. */ - public value?: (string|null); - - /** SqlResultValue nullValue. */ - public nullValue?: (boolean|null); - - /** - * Creates a new SqlResultValue instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultValue instance - */ - public static create(properties?: google.cloud.alloydb.v1.ISqlResultValue): google.cloud.alloydb.v1.SqlResultValue; - - /** - * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. - * @param message SqlResultValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. - * @param message SqlResultValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.SqlResultValue; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.SqlResultValue; - - /** - * Verifies a SqlResultValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.SqlResultValue; - - /** - * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. - * @param message SqlResultValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1.SqlResultValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v1alpha. */ - namespace v1alpha { - - /** Properties of a CloudSQLBackupRunSource. */ - interface ICloudSQLBackupRunSource { - - /** CloudSQLBackupRunSource project */ - project?: (string|null); - - /** CloudSQLBackupRunSource instanceId */ - instanceId?: (string|null); - - /** CloudSQLBackupRunSource backupRunId */ - backupRunId?: (number|Long|string|null); - } - - /** Represents a CloudSQLBackupRunSource. */ - class CloudSQLBackupRunSource implements ICloudSQLBackupRunSource { - - /** - * Constructs a new CloudSQLBackupRunSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource); - - /** CloudSQLBackupRunSource project. */ - public project: string; - - /** CloudSQLBackupRunSource instanceId. */ - public instanceId: string; - - /** CloudSQLBackupRunSource backupRunId. */ - public backupRunId: (number|Long|string); - - /** - * Creates a new CloudSQLBackupRunSource instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSQLBackupRunSource instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; - - /** - * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. - * @param message CloudSQLBackupRunSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. - * @param message CloudSQLBackupRunSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; - - /** - * Verifies a CloudSQLBackupRunSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSQLBackupRunSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource; - - /** - * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. - * @param message CloudSQLBackupRunSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSQLBackupRunSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSQLBackupRunSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AlloyDBCSQLAdmin */ - class AlloyDBCSQLAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new AlloyDBCSQLAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBCSQLAdmin; - - /** - * Calls RestoreFromCloudSQL. - * @param request RestoreFromCloudSQLRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreFromCloudSQL(request: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback): void; - - /** - * Calls RestoreFromCloudSQL. - * @param request RestoreFromCloudSQLRequest message or plain object - * @returns Promise - */ - public restoreFromCloudSQL(request: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest): Promise; - } - - namespace AlloyDBCSQLAdmin { - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin|restoreFromCloudSQL}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreFromCloudSQLCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a RestoreFromCloudSQLRequest. */ - interface IRestoreFromCloudSQLRequest { - - /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource */ - cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); - - /** RestoreFromCloudSQLRequest parent */ - parent?: (string|null); - - /** RestoreFromCloudSQLRequest clusterId */ - clusterId?: (string|null); - - /** RestoreFromCloudSQLRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - } - - /** Represents a RestoreFromCloudSQLRequest. */ - class RestoreFromCloudSQLRequest implements IRestoreFromCloudSQLRequest { - - /** - * Constructs a new RestoreFromCloudSQLRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest); - - /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource. */ - public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); - - /** RestoreFromCloudSQLRequest parent. */ - public parent: string; - - /** RestoreFromCloudSQLRequest clusterId. */ - public clusterId: string; - - /** RestoreFromCloudSQLRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** RestoreFromCloudSQLRequest source. */ - public source?: "cloudsqlBackupRunSource"; - - /** - * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreFromCloudSQLRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. - * @param message RestoreFromCloudSQLRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. - * @param message RestoreFromCloudSQLRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; - - /** - * Verifies a RestoreFromCloudSQLRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreFromCloudSQLRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest; - - /** - * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. - * @param message RestoreFromCloudSQLRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreFromCloudSQLRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreFromCloudSQLRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** InstanceView enum. */ - enum InstanceView { - INSTANCE_VIEW_UNSPECIFIED = 0, - INSTANCE_VIEW_BASIC = 1, - INSTANCE_VIEW_FULL = 2 - } - - /** ClusterView enum. */ - enum ClusterView { - CLUSTER_VIEW_UNSPECIFIED = 0, - CLUSTER_VIEW_BASIC = 1, - CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 - } - - /** DatabaseVersion enum. */ - enum DatabaseVersion { - DATABASE_VERSION_UNSPECIFIED = 0, - POSTGRES_13 = 1, - POSTGRES_14 = 2, - POSTGRES_15 = 3, - POSTGRES_16 = 4, - POSTGRES_17 = 5, - POSTGRES_18 = 6 - } - - /** SubscriptionType enum. */ - enum SubscriptionType { - SUBSCRIPTION_TYPE_UNSPECIFIED = 0, - STANDARD = 1, - TRIAL = 2 - } - - /** Properties of a UserPassword. */ - interface IUserPassword { - - /** UserPassword user */ - user?: (string|null); - - /** UserPassword password */ - password?: (string|null); - } - - /** Represents a UserPassword. */ - class UserPassword implements IUserPassword { - - /** - * Constructs a new UserPassword. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUserPassword); - - /** UserPassword user. */ - public user: string; - - /** UserPassword password. */ - public password: string; - - /** - * Creates a new UserPassword instance using the specified properties. - * @param [properties] Properties to set - * @returns UserPassword instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUserPassword): google.cloud.alloydb.v1alpha.UserPassword; - - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UserPassword; - - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UserPassword; - - /** - * Verifies a UserPassword message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserPassword - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UserPassword; - - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @param message UserPassword - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserPassword to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserPassword - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MigrationSource. */ - interface IMigrationSource { - - /** MigrationSource hostPort */ - hostPort?: (string|null); - - /** MigrationSource referenceId */ - referenceId?: (string|null); - - /** MigrationSource sourceType */ - sourceType?: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null); - } - - /** Represents a MigrationSource. */ - class MigrationSource implements IMigrationSource { - - /** - * Constructs a new MigrationSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IMigrationSource); - - /** MigrationSource hostPort. */ - public hostPort: string; - - /** MigrationSource referenceId. */ - public referenceId: string; - - /** MigrationSource sourceType. */ - public sourceType: (google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType); - - /** - * Creates a new MigrationSource instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationSource instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IMigrationSource): google.cloud.alloydb.v1alpha.MigrationSource; - - /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MigrationSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MigrationSource; - - /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MigrationSource; - - /** - * Verifies a MigrationSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MigrationSource; - - /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @param message MigrationSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MigrationSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MigrationSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MigrationSource { - - /** MigrationSourceType enum. */ - enum MigrationSourceType { - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, - DMS = 1 - } - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig); - - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionConfig): google.cloud.alloydb.v1alpha.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { - - /** EncryptionInfo encryptionType */ - encryptionType?: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null); - - /** EncryptionInfo kmsKeyVersions */ - kmsKeyVersions?: (string[]|null); - } - - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { - - /** - * Constructs a new EncryptionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo); - - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.cloud.alloydb.v1alpha.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1alpha.EncryptionInfo.Type); - - /** EncryptionInfo kmsKeyVersions. */ - public kmsKeyVersions: string[]; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IEncryptionInfo): google.cloud.alloydb.v1alpha.EncryptionInfo; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.EncryptionInfo; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.EncryptionInfo; - - /** - * Verifies an EncryptionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.EncryptionInfo; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EncryptionInfo { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } - - /** Properties of a SslConfig. */ - interface ISslConfig { - - /** SslConfig sslMode */ - sslMode?: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode|null); - - /** SslConfig caSource */ - caSource?: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource|null); - } - - /** Represents a SslConfig. */ - class SslConfig implements ISslConfig { - - /** - * Constructs a new SslConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISslConfig); - - /** SslConfig sslMode. */ - public sslMode: (google.cloud.alloydb.v1alpha.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.SslMode); - - /** SslConfig caSource. */ - public caSource: (google.cloud.alloydb.v1alpha.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1alpha.SslConfig.CaSource); - - /** - * Creates a new SslConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SslConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISslConfig): google.cloud.alloydb.v1alpha.SslConfig; - - /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SslConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SslConfig; - - /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SslConfig; - - /** - * Verifies a SslConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SslConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SslConfig; - - /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @param message SslConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SslConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SslConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SslConfig { - - /** SslMode enum. */ - enum SslMode { - SSL_MODE_UNSPECIFIED = 0, - SSL_MODE_ALLOW = 1, - SSL_MODE_REQUIRE = 2, - SSL_MODE_VERIFY_CA = 3, - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, - ENCRYPTED_ONLY = 5 - } - - /** CaSource enum. */ - enum CaSource { - CA_SOURCE_UNSPECIFIED = 0, - CA_SOURCE_MANAGED = 1 - } - } - - /** Properties of an AutomatedBackupPolicy. */ - interface IAutomatedBackupPolicy { - - /** AutomatedBackupPolicy weeklySchedule */ - weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention */ - timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention */ - quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled */ - enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow */ - backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location */ - location?: (string|null); - - /** AutomatedBackupPolicy labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents an AutomatedBackupPolicy. */ - class AutomatedBackupPolicy implements IAutomatedBackupPolicy { - - /** - * Constructs a new AutomatedBackupPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy); - - /** AutomatedBackupPolicy weeklySchedule. */ - public weeklySchedule?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention. */ - public timeBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention. */ - public quantityBasedRetention?: (google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled. */ - public enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow. */ - public backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location. */ - public location: string; - - /** AutomatedBackupPolicy labels. */ - public labels: { [k: string]: string }; - - /** AutomatedBackupPolicy schedule. */ - public schedule?: "weeklySchedule"; - - /** AutomatedBackupPolicy retention. */ - public retention?: ("timeBasedRetention"|"quantityBasedRetention"); - - /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AutomatedBackupPolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; - - /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; - - /** - * Verifies an AutomatedBackupPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutomatedBackupPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy; - - /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @param message AutomatedBackupPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutomatedBackupPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutomatedBackupPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutomatedBackupPolicy { - - /** Properties of a WeeklySchedule. */ - interface IWeeklySchedule { - - /** WeeklySchedule startTimes */ - startTimes?: (google.type.ITimeOfDay[]|null); - - /** WeeklySchedule daysOfWeek */ - daysOfWeek?: (google.type.DayOfWeek[]|null); - } - - /** Represents a WeeklySchedule. */ - class WeeklySchedule implements IWeeklySchedule { - - /** - * Constructs a new WeeklySchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule); - - /** WeeklySchedule startTimes. */ - public startTimes: google.type.ITimeOfDay[]; - - /** WeeklySchedule daysOfWeek. */ - public daysOfWeek: google.type.DayOfWeek[]; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns WeeklySchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Verifies a WeeklySchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeeklySchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @param message WeeklySchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeeklySchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WeeklySchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeBasedRetention. */ - interface ITimeBasedRetention { - - /** TimeBasedRetention retentionPeriod */ - retentionPeriod?: (google.protobuf.IDuration|null); - } - - /** Represents a TimeBasedRetention. */ - class TimeBasedRetention implements ITimeBasedRetention { - - /** - * Constructs a new TimeBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention); - - /** TimeBasedRetention retentionPeriod. */ - public retentionPeriod?: (google.protobuf.IDuration|null); - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Verifies a TimeBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @param message TimeBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QuantityBasedRetention. */ - interface IQuantityBasedRetention { - - /** QuantityBasedRetention count */ - count?: (number|null); - } - - /** Represents a QuantityBasedRetention. */ - class QuantityBasedRetention implements IQuantityBasedRetention { - - /** - * Constructs a new QuantityBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention); - - /** QuantityBasedRetention count. */ - public count: number; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Verifies a QuantityBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @param message QuantityBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ContinuousBackupConfig. */ - interface IContinuousBackupConfig { - - /** ContinuousBackupConfig enabled */ - enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays */ - recoveryWindowDays?: (number|null); - - /** ContinuousBackupConfig encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - } - - /** Represents a ContinuousBackupConfig. */ - class ContinuousBackupConfig implements IContinuousBackupConfig { - - /** - * Constructs a new ContinuousBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig); - - /** ContinuousBackupConfig enabled. */ - public enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays. */ - public recoveryWindowDays: number; - - /** ContinuousBackupConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupConfig): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - - /** - * Verifies a ContinuousBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupConfig; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @param message ContinuousBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContinuousBackupInfo. */ - interface IContinuousBackupInfo { - - /** ContinuousBackupInfo encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime */ - enabledTime?: (google.protobuf.ITimestamp|null); - - /** ContinuousBackupInfo schedule */ - schedule?: (google.type.DayOfWeek[]|null); - - /** ContinuousBackupInfo earliestRestorableTime */ - earliestRestorableTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ContinuousBackupInfo. */ - class ContinuousBackupInfo implements IContinuousBackupInfo { - - /** - * Constructs a new ContinuousBackupInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo); - - /** ContinuousBackupInfo encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime. */ - public enabledTime?: (google.protobuf.ITimestamp|null); - - /** ContinuousBackupInfo schedule. */ - public schedule: google.type.DayOfWeek[]; - - /** ContinuousBackupInfo earliestRestorableTime. */ - public earliestRestorableTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupInfo): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; - - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; - - /** - * Verifies a ContinuousBackupInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupInfo; - - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @param message ContinuousBackupInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupSource. */ - interface IBackupSource { - - /** BackupSource backupUid */ - backupUid?: (string|null); - - /** BackupSource backupName */ - backupName?: (string|null); - } - - /** Represents a BackupSource. */ - class BackupSource implements IBackupSource { - - /** - * Constructs a new BackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBackupSource); - - /** BackupSource backupUid. */ - public backupUid: string; - - /** BackupSource backupName. */ - public backupName: string; - - /** - * Creates a new BackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBackupSource): google.cloud.alloydb.v1alpha.BackupSource; - - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BackupSource; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BackupSource; - - /** - * Verifies a BackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BackupSource; - - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @param message BackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContinuousBackupSource. */ - interface IContinuousBackupSource { - - /** ContinuousBackupSource cluster */ - cluster?: (string|null); - - /** ContinuousBackupSource pointInTime */ - pointInTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ContinuousBackupSource. */ - class ContinuousBackupSource implements IContinuousBackupSource { - - /** - * Constructs a new ContinuousBackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource); - - /** ContinuousBackupSource cluster. */ - public cluster: string; - - /** ContinuousBackupSource pointInTime. */ - public pointInTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ContinuousBackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IContinuousBackupSource): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - - /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - - /** - * Verifies a ContinuousBackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ContinuousBackupSource; - - /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @param message ContinuousBackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MaintenanceUpdatePolicy. */ - interface IMaintenanceUpdatePolicy { - - /** MaintenanceUpdatePolicy maintenanceWindows */ - maintenanceWindows?: (google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); - - /** MaintenanceUpdatePolicy denyMaintenancePeriods */ - denyMaintenancePeriods?: (google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]|null); - } - - /** Represents a MaintenanceUpdatePolicy. */ - class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { - - /** - * Constructs a new MaintenanceUpdatePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy); - - /** MaintenanceUpdatePolicy maintenanceWindows. */ - public maintenanceWindows: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow[]; - - /** MaintenanceUpdatePolicy denyMaintenancePeriods. */ - public denyMaintenancePeriods: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]; - - /** - * Creates a new MaintenanceUpdatePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceUpdatePolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; - - /** - * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. - * @param message MaintenanceUpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. - * @param message MaintenanceUpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; - - /** - * Verifies a MaintenanceUpdatePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceUpdatePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy; - - /** - * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. - * @param message MaintenanceUpdatePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceUpdatePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceUpdatePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MaintenanceUpdatePolicy { - - /** Properties of a MaintenanceWindow. */ - interface IMaintenanceWindow { - - /** MaintenanceWindow day */ - day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); - - /** MaintenanceWindow startTime */ - startTime?: (google.type.ITimeOfDay|null); - } - - /** Represents a MaintenanceWindow. */ - class MaintenanceWindow implements IMaintenanceWindow { - - /** - * Constructs a new MaintenanceWindow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow); - - /** MaintenanceWindow day. */ - public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); - - /** MaintenanceWindow startTime. */ - public startTime?: (google.type.ITimeOfDay|null); - - /** - * Creates a new MaintenanceWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceWindow instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Verifies a MaintenanceWindow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceWindow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @param message MaintenanceWindow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceWindow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DenyMaintenancePeriod. */ - interface IDenyMaintenancePeriod { - - /** DenyMaintenancePeriod startDate */ - startDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod endDate */ - endDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod time */ - time?: (google.type.ITimeOfDay|null); - } - - /** Represents a DenyMaintenancePeriod. */ - class DenyMaintenancePeriod implements IDenyMaintenancePeriod { - - /** - * Constructs a new DenyMaintenancePeriod. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod); - - /** DenyMaintenancePeriod startDate. */ - public startDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod endDate. */ - public endDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod time. */ - public time?: (google.type.ITimeOfDay|null); - - /** - * Creates a new DenyMaintenancePeriod instance using the specified properties. - * @param [properties] Properties to set - * @returns DenyMaintenancePeriod instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @param message DenyMaintenancePeriod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @param message DenyMaintenancePeriod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Verifies a DenyMaintenancePeriod message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DenyMaintenancePeriod - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. - * @param message DenyMaintenancePeriod - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DenyMaintenancePeriod to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DenyMaintenancePeriod - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a MaintenanceSchedule. */ - interface IMaintenanceSchedule { - - /** MaintenanceSchedule startTime */ - startTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a MaintenanceSchedule. */ - class MaintenanceSchedule implements IMaintenanceSchedule { - - /** - * Constructs a new MaintenanceSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IMaintenanceSchedule); - - /** MaintenanceSchedule startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new MaintenanceSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceSchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IMaintenanceSchedule): google.cloud.alloydb.v1alpha.MaintenanceSchedule; - - /** - * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. - * @param message MaintenanceSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. - * @param message MaintenanceSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.MaintenanceSchedule; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.MaintenanceSchedule; - - /** - * Verifies a MaintenanceSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.MaintenanceSchedule; - - /** - * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. - * @param message MaintenanceSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Cluster. */ - interface ICluster { - - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); - - /** Cluster cloudsqlBackupRunSource */ - cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); - - /** Cluster name */ - name?: (string|null); - - /** Cluster displayName */ - displayName?: (string|null); - - /** Cluster uid */ - uid?: (string|null); - - /** Cluster createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels */ - labels?: ({ [k: string]: string }|null); - - /** Cluster state */ - state?: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State|null); - - /** Cluster clusterType */ - clusterType?: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType|null); - - /** Cluster databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - - /** Cluster networkConfig */ - networkConfig?: (google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null); - - /** Cluster network */ - network?: (string|null); - - /** Cluster etag */ - etag?: (string|null); - - /** Cluster annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Cluster reconciling */ - reconciling?: (boolean|null); - - /** Cluster initialUser */ - initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); - - /** Cluster automatedBackupPolicy */ - automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig */ - sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - - /** Cluster encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** Cluster encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig */ - continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo */ - continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig */ - secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig */ - primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); - - /** Cluster satisfiesPzi */ - satisfiesPzi?: (boolean|null); - - /** Cluster satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Cluster pscConfig */ - pscConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null); - - /** Cluster maintenanceUpdatePolicy */ - maintenanceUpdatePolicy?: (google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule */ - maintenanceSchedule?: (google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null); - - /** Cluster geminiConfig */ - geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null); - - /** Cluster subscriptionType */ - subscriptionType?: (google.cloud.alloydb.v1alpha.SubscriptionType|keyof typeof google.cloud.alloydb.v1alpha.SubscriptionType|null); - - /** Cluster trialMetadata */ - trialMetadata?: (google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null); - - /** Cluster tags */ - tags?: ({ [k: string]: string }|null); - - /** Cluster serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** Cluster dataplexConfig */ - dataplexConfig?: (google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null); - } - - /** Represents a Cluster. */ - class Cluster implements ICluster { - - /** - * Constructs a new Cluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICluster); - - /** Cluster backupSource. */ - public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** Cluster migrationSource. */ - public migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|null); - - /** Cluster cloudsqlBackupRunSource. */ - public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null); - - /** Cluster name. */ - public name: string; - - /** Cluster displayName. */ - public displayName: string; - - /** Cluster uid. */ - public uid: string; - - /** Cluster createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels. */ - public labels: { [k: string]: string }; - - /** Cluster state. */ - public state: (google.cloud.alloydb.v1alpha.Cluster.State|keyof typeof google.cloud.alloydb.v1alpha.Cluster.State); - - /** Cluster clusterType. */ - public clusterType: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType); - - /** Cluster databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** Cluster networkConfig. */ - public networkConfig?: (google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null); - - /** Cluster network. */ - public network: string; - - /** Cluster etag. */ - public etag: string; - - /** Cluster annotations. */ - public annotations: { [k: string]: string }; - - /** Cluster reconciling. */ - public reconciling: boolean; - - /** Cluster initialUser. */ - public initialUser?: (google.cloud.alloydb.v1alpha.IUserPassword|null); - - /** Cluster automatedBackupPolicy. */ - public automatedBackupPolicy?: (google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - - /** Cluster encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** Cluster encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig. */ - public continuousBackupConfig?: (google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo. */ - public continuousBackupInfo?: (google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig. */ - public secondaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig. */ - public primaryConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null); - - /** Cluster satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** Cluster satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Cluster pscConfig. */ - public pscConfig?: (google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null); - - /** Cluster maintenanceUpdatePolicy. */ - public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule. */ - public maintenanceSchedule?: (google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null); - - /** Cluster geminiConfig. */ - public geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null); - - /** Cluster subscriptionType. */ - public subscriptionType: (google.cloud.alloydb.v1alpha.SubscriptionType|keyof typeof google.cloud.alloydb.v1alpha.SubscriptionType); - - /** Cluster trialMetadata. */ - public trialMetadata?: (google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null); - - /** Cluster tags. */ - public tags: { [k: string]: string }; - - /** Cluster serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** Cluster dataplexConfig. */ - public dataplexConfig?: (google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null); - - /** Cluster source. */ - public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); - - /** - * Creates a new Cluster instance using the specified properties. - * @param [properties] Properties to set - * @returns Cluster instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICluster): google.cloud.alloydb.v1alpha.Cluster; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster; - - /** - * Verifies a Cluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cluster - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @param message Cluster - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cluster to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Cluster - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Cluster { - - /** Properties of a NetworkConfig. */ - interface INetworkConfig { - - /** NetworkConfig network */ - network?: (string|null); - - /** NetworkConfig allocatedIpRange */ - allocatedIpRange?: (string|null); - } - - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { - - /** - * Constructs a new NetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig); - - /** NetworkConfig network. */ - public network: string; - - /** NetworkConfig allocatedIpRange. */ - public allocatedIpRange: string; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - - /** - * Verifies a NetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.NetworkConfig; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @param message NetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecondaryConfig. */ - interface ISecondaryConfig { - - /** SecondaryConfig primaryClusterName */ - primaryClusterName?: (string|null); - } - - /** Represents a SecondaryConfig. */ - class SecondaryConfig implements ISecondaryConfig { - - /** - * Constructs a new SecondaryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig); - - /** SecondaryConfig primaryClusterName. */ - public primaryClusterName: string; - - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SecondaryConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - - /** - * Verifies a SecondaryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecondaryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig; - - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @param message SecondaryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecondaryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecondaryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PrimaryConfig. */ - interface IPrimaryConfig { - - /** PrimaryConfig secondaryClusterNames */ - secondaryClusterNames?: (string[]|null); - } - - /** Represents a PrimaryConfig. */ - class PrimaryConfig implements IPrimaryConfig { - - /** - * Constructs a new PrimaryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig); - - /** PrimaryConfig secondaryClusterNames. */ - public secondaryClusterNames: string[]; - - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PrimaryConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - - /** - * Verifies a PrimaryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrimaryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @param message PrimaryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PrimaryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PrimaryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscConfig. */ - interface IPscConfig { - - /** PscConfig pscEnabled */ - pscEnabled?: (boolean|null); - - /** PscConfig serviceOwnedProjectNumber */ - serviceOwnedProjectNumber?: (number|Long|string|null); - } - - /** Represents a PscConfig. */ - class PscConfig implements IPscConfig { - - /** - * Constructs a new PscConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IPscConfig); - - /** PscConfig pscEnabled. */ - public pscEnabled: boolean; - - /** PscConfig serviceOwnedProjectNumber. */ - public serviceOwnedProjectNumber: (number|Long|string); - - /** - * Creates a new PscConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IPscConfig): google.cloud.alloydb.v1alpha.Cluster.PscConfig; - - /** - * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. - * @param message PscConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. - * @param message PscConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.PscConfig; - - /** - * Decodes a PscConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.PscConfig; - - /** - * Verifies a PscConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.PscConfig; - - /** - * Creates a plain object from a PscConfig message. Also converts values to other types if specified. - * @param message PscConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.PscConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrialMetadata. */ - interface ITrialMetadata { - - /** TrialMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata upgradeTime */ - upgradeTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata graceEndTime */ - graceEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TrialMetadata. */ - class TrialMetadata implements ITrialMetadata { - - /** - * Constructs a new TrialMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata); - - /** TrialMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata upgradeTime. */ - public upgradeTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata graceEndTime. */ - public graceEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TrialMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns TrialMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; - - /** - * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. - * @param message TrialMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. - * @param message TrialMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; - - /** - * Verifies a TrialMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrialMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.TrialMetadata; - - /** - * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. - * @param message TrialMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.TrialMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrialMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrialMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataplexConfig. */ - interface IDataplexConfig { - - /** DataplexConfig enabled */ - enabled?: (boolean|null); - } - - /** Represents a DataplexConfig. */ - class DataplexConfig implements IDataplexConfig { - - /** - * Constructs a new DataplexConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig); - - /** DataplexConfig enabled. */ - public enabled: boolean; - - /** - * Creates a new DataplexConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DataplexConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; - - /** - * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. - * @param message DataplexConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. - * @param message DataplexConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; - - /** - * Verifies a DataplexConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataplexConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; - - /** - * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. - * @param message DataplexConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataplexConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataplexConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - EMPTY = 3, - CREATING = 4, - DELETING = 5, - FAILED = 6, - BOOTSTRAPPING = 7, - MAINTENANCE = 8, - PROMOTING = 9 - } - - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - SECONDARY = 2 - } - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance displayName */ - displayName?: (string|null); - - /** Instance uid */ - uid?: (string|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance state */ - state?: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State|null); - - /** Instance instanceType */ - instanceType?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); - - /** Instance machineConfig */ - machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); - - /** Instance availabilityType */ - availabilityType?: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null); - - /** Instance gceZone */ - gceZone?: (string|null); - - /** Instance databaseFlags */ - databaseFlags?: ({ [k: string]: string }|null); - - /** Instance writableNode */ - writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); - - /** Instance nodes */ - nodes?: (google.cloud.alloydb.v1alpha.Instance.INode[]|null); - - /** Instance queryInsightsConfig */ - queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); - - /** Instance observabilityConfig */ - observabilityConfig?: (google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null); - - /** Instance readPoolConfig */ - readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); - - /** Instance ipAddress */ - ipAddress?: (string|null); - - /** Instance publicIpAddress */ - publicIpAddress?: (string|null); - - /** Instance reconciling */ - reconciling?: (boolean|null); - - /** Instance etag */ - etag?: (string|null); - - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Instance updatePolicy */ - updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); - - /** Instance clientConnectionConfig */ - clientConnectionConfig?: (google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null); - - /** Instance satisfiesPzi */ - satisfiesPzi?: (boolean|null); - - /** Instance satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Instance pscInstanceConfig */ - pscInstanceConfig?: (google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null); - - /** Instance networkConfig */ - networkConfig?: (google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null); - - /** Instance geminiConfig */ - geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null); - - /** Instance outboundPublicIpAddresses */ - outboundPublicIpAddresses?: (string[]|null); - - /** Instance activationPolicy */ - activationPolicy?: (google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|null); - - /** Instance connectionPoolConfig */ - connectionPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null); - - /** Instance gcaConfig */ - gcaConfig?: (google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance displayName. */ - public displayName: string; - - /** Instance uid. */ - public uid: string; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance state. */ - public state: (google.cloud.alloydb.v1alpha.Instance.State|keyof typeof google.cloud.alloydb.v1alpha.Instance.State); - - /** Instance instanceType. */ - public instanceType: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); - - /** Instance machineConfig. */ - public machineConfig?: (google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null); - - /** Instance availabilityType. */ - public availabilityType: (google.cloud.alloydb.v1alpha.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1alpha.Instance.AvailabilityType); - - /** Instance gceZone. */ - public gceZone: string; - - /** Instance databaseFlags. */ - public databaseFlags: { [k: string]: string }; - - /** Instance writableNode. */ - public writableNode?: (google.cloud.alloydb.v1alpha.Instance.INode|null); - - /** Instance nodes. */ - public nodes: google.cloud.alloydb.v1alpha.Instance.INode[]; - - /** Instance queryInsightsConfig. */ - public queryInsightsConfig?: (google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null); - - /** Instance observabilityConfig. */ - public observabilityConfig?: (google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null); - - /** Instance readPoolConfig. */ - public readPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null); - - /** Instance ipAddress. */ - public ipAddress: string; - - /** Instance publicIpAddress. */ - public publicIpAddress: string; - - /** Instance reconciling. */ - public reconciling: boolean; - - /** Instance etag. */ - public etag: string; - - /** Instance annotations. */ - public annotations: { [k: string]: string }; - - /** Instance updatePolicy. */ - public updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); - - /** Instance clientConnectionConfig. */ - public clientConnectionConfig?: (google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null); - - /** Instance satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** Instance satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Instance pscInstanceConfig. */ - public pscInstanceConfig?: (google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null); - - /** Instance networkConfig. */ - public networkConfig?: (google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null); - - /** Instance geminiConfig. */ - public geminiConfig?: (google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null); - - /** Instance outboundPublicIpAddresses. */ - public outboundPublicIpAddresses: string[]; - - /** Instance activationPolicy. */ - public activationPolicy: (google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1alpha.Instance.ActivationPolicy); - - /** Instance connectionPoolConfig. */ - public connectionPoolConfig?: (google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null); - - /** Instance gcaConfig. */ - public gcaConfig?: (google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null); - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IInstance): google.cloud.alloydb.v1alpha.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Instance { - - /** Properties of a MachineConfig. */ - interface IMachineConfig { - - /** MachineConfig cpuCount */ - cpuCount?: (number|null); - - /** MachineConfig machineType */ - machineType?: (string|null); - } - - /** Represents a MachineConfig. */ - class MachineConfig implements IMachineConfig { - - /** - * Constructs a new MachineConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig); - - /** MachineConfig cpuCount. */ - public cpuCount: number; - - /** MachineConfig machineType. */ - public machineType: string; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MachineConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IMachineConfig): google.cloud.alloydb.v1alpha.Instance.MachineConfig; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.MachineConfig; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.MachineConfig; - - /** - * Verifies a MachineConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MachineConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.MachineConfig; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @param message MachineConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MachineConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MachineConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Node. */ - interface INode { - - /** Node zoneId */ - zoneId?: (string|null); - - /** Node id */ - id?: (string|null); - - /** Node ip */ - ip?: (string|null); - - /** Node state */ - state?: (string|null); - } - - /** Represents a Node. */ - class Node implements INode { - - /** - * Constructs a new Node. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.INode); - - /** Node zoneId. */ - public zoneId: string; - - /** Node id. */ - public id: string; - - /** Node ip. */ - public ip: string; - - /** Node state. */ - public state: string; - - /** - * Creates a new Node instance using the specified properties. - * @param [properties] Properties to set - * @returns Node instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.INode): google.cloud.alloydb.v1alpha.Instance.Node; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Node message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.Node; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.Node; - - /** - * Verifies a Node message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Node - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.Node; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @param message Node - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Node to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Node - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryInsightsInstanceConfig. */ - interface IQueryInsightsInstanceConfig { - - /** QueryInsightsInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress */ - recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength */ - queryStringLength?: (number|null); - - /** QueryInsightsInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - } - - /** Represents a QueryInsightsInstanceConfig. */ - class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig); - - /** QueryInsightsInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress. */ - public recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength. */ - public queryStringLength: number; - - /** QueryInsightsInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryInsightsInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; - - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; - - /** - * Verifies a QueryInsightsInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInsightsInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @param message QueryInsightsInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ObservabilityInstanceConfig. */ - interface IObservabilityInstanceConfig { - - /** ObservabilityInstanceConfig enabled */ - enabled?: (boolean|null); - - /** ObservabilityInstanceConfig preserveComments */ - preserveComments?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEvents */ - trackWaitEvents?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEventTypes */ - trackWaitEventTypes?: (boolean|null); - - /** ObservabilityInstanceConfig maxQueryStringLength */ - maxQueryStringLength?: (number|null); - - /** ObservabilityInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** ObservabilityInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - - /** ObservabilityInstanceConfig trackActiveQueries */ - trackActiveQueries?: (boolean|null); - - /** ObservabilityInstanceConfig trackClientAddress */ - trackClientAddress?: (boolean|null); - - /** ObservabilityInstanceConfig assistiveExperiencesEnabled */ - assistiveExperiencesEnabled?: (boolean|null); - } - - /** Represents an ObservabilityInstanceConfig. */ - class ObservabilityInstanceConfig implements IObservabilityInstanceConfig { - - /** - * Constructs a new ObservabilityInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig); - - /** ObservabilityInstanceConfig enabled. */ - public enabled?: (boolean|null); - - /** ObservabilityInstanceConfig preserveComments. */ - public preserveComments?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEvents. */ - public trackWaitEvents?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEventTypes. */ - public trackWaitEventTypes?: (boolean|null); - - /** ObservabilityInstanceConfig maxQueryStringLength. */ - public maxQueryStringLength?: (number|null); - - /** ObservabilityInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** ObservabilityInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** ObservabilityInstanceConfig trackActiveQueries. */ - public trackActiveQueries?: (boolean|null); - - /** ObservabilityInstanceConfig trackClientAddress. */ - public trackClientAddress?: (boolean|null); - - /** ObservabilityInstanceConfig assistiveExperiencesEnabled. */ - public assistiveExperiencesEnabled?: (boolean|null); - - /** - * Creates a new ObservabilityInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ObservabilityInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; - - /** - * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @param message ObservabilityInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @param message ObservabilityInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; - - /** - * Verifies an ObservabilityInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObservabilityInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig; - - /** - * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. - * @param message ObservabilityInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObservabilityInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ObservabilityInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadPoolConfig. */ - interface IReadPoolConfig { - - /** ReadPoolConfig nodeCount */ - nodeCount?: (number|null); - } - - /** Represents a ReadPoolConfig. */ - class ReadPoolConfig implements IReadPoolConfig { - - /** - * Constructs a new ReadPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig); - - /** ReadPoolConfig nodeCount. */ - public nodeCount: number; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; - - /** - * Verifies a ReadPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @param message ReadPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdatePolicy. */ - interface IUpdatePolicy { - - /** UpdatePolicy mode */ - mode?: (google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|null); - } - - /** Represents an UpdatePolicy. */ - class UpdatePolicy implements IUpdatePolicy { - - /** - * Constructs a new UpdatePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy); - - /** UpdatePolicy mode. */ - public mode: (google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode); - - /** - * Creates a new UpdatePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdatePolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; - - /** - * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. - * @param message UpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. - * @param message UpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; - - /** - * Verifies an UpdatePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdatePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.UpdatePolicy; - - /** - * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. - * @param message UpdatePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.UpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdatePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdatePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpdatePolicy { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - DEFAULT = 1, - FORCE_APPLY = 2 - } - } - - /** Properties of a ClientConnectionConfig. */ - interface IClientConnectionConfig { - - /** ClientConnectionConfig requireConnectors */ - requireConnectors?: (boolean|null); - - /** ClientConnectionConfig sslConfig */ - sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - } - - /** Represents a ClientConnectionConfig. */ - class ClientConnectionConfig implements IClientConnectionConfig { - - /** - * Constructs a new ClientConnectionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig); - - /** ClientConnectionConfig requireConnectors. */ - public requireConnectors: boolean; - - /** ClientConnectionConfig sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); - - /** - * Creates a new ClientConnectionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientConnectionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; - - /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; - - /** - * Verifies a ClientConnectionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientConnectionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; - - /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @param message ClientConnectionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientConnectionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientConnectionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscInterfaceConfig. */ - interface IPscInterfaceConfig { - - /** PscInterfaceConfig networkAttachmentResource */ - networkAttachmentResource?: (string|null); - } - - /** Represents a PscInterfaceConfig. */ - class PscInterfaceConfig implements IPscInterfaceConfig { - - /** - * Constructs a new PscInterfaceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig); - - /** PscInterfaceConfig networkAttachmentResource. */ - public networkAttachmentResource: string; - - /** - * Creates a new PscInterfaceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscInterfaceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; - - /** - * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. - * @param message PscInterfaceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. - * @param message PscInterfaceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; - - /** - * Verifies a PscInterfaceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscInterfaceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig; - - /** - * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. - * @param message PscInterfaceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscInterfaceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscInterfaceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscAutoConnectionConfig. */ - interface IPscAutoConnectionConfig { - - /** PscAutoConnectionConfig consumerProject */ - consumerProject?: (string|null); - - /** PscAutoConnectionConfig consumerNetwork */ - consumerNetwork?: (string|null); - - /** PscAutoConnectionConfig ipAddress */ - ipAddress?: (string|null); - - /** PscAutoConnectionConfig status */ - status?: (string|null); - - /** PscAutoConnectionConfig consumerNetworkStatus */ - consumerNetworkStatus?: (string|null); - } - - /** Represents a PscAutoConnectionConfig. */ - class PscAutoConnectionConfig implements IPscAutoConnectionConfig { - - /** - * Constructs a new PscAutoConnectionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig); - - /** PscAutoConnectionConfig consumerProject. */ - public consumerProject: string; - - /** PscAutoConnectionConfig consumerNetwork. */ - public consumerNetwork: string; - - /** PscAutoConnectionConfig ipAddress. */ - public ipAddress: string; - - /** PscAutoConnectionConfig status. */ - public status: string; - - /** PscAutoConnectionConfig consumerNetworkStatus. */ - public consumerNetworkStatus: string; - - /** - * Creates a new PscAutoConnectionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscAutoConnectionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; - - /** - * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @param message PscAutoConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @param message PscAutoConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; - - /** - * Verifies a PscAutoConnectionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscAutoConnectionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig; - - /** - * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. - * @param message PscAutoConnectionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscAutoConnectionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscAutoConnectionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscInstanceConfig. */ - interface IPscInstanceConfig { - - /** PscInstanceConfig serviceAttachmentLink */ - serviceAttachmentLink?: (string|null); - - /** PscInstanceConfig allowedConsumerProjects */ - allowedConsumerProjects?: (string[]|null); - - /** PscInstanceConfig pscDnsName */ - pscDnsName?: (string|null); - - /** PscInstanceConfig pscInterfaceConfigs */ - pscInterfaceConfigs?: (google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]|null); - - /** PscInstanceConfig pscAutoConnections */ - pscAutoConnections?: (google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig[]|null); - } - - /** Represents a PscInstanceConfig. */ - class PscInstanceConfig implements IPscInstanceConfig { - - /** - * Constructs a new PscInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig); - - /** PscInstanceConfig serviceAttachmentLink. */ - public serviceAttachmentLink: string; - - /** PscInstanceConfig allowedConsumerProjects. */ - public allowedConsumerProjects: string[]; - - /** PscInstanceConfig pscDnsName. */ - public pscDnsName: string; - - /** PscInstanceConfig pscInterfaceConfigs. */ - public pscInterfaceConfigs: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]; - - /** PscInstanceConfig pscAutoConnections. */ - public pscAutoConnections: google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig[]; - - /** - * Creates a new PscInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; - - /** - * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. - * @param message PscInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. - * @param message PscInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; - - /** - * Verifies a PscInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig; - - /** - * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. - * @param message PscInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceNetworkConfig. */ - interface IInstanceNetworkConfig { - - /** InstanceNetworkConfig authorizedExternalNetworks */ - authorizedExternalNetworks?: (google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]|null); - - /** InstanceNetworkConfig enablePublicIp */ - enablePublicIp?: (boolean|null); - - /** InstanceNetworkConfig enableOutboundPublicIp */ - enableOutboundPublicIp?: (boolean|null); - - /** InstanceNetworkConfig network */ - network?: (string|null); - - /** InstanceNetworkConfig allocatedIpRangeOverride */ - allocatedIpRangeOverride?: (string|null); - } - - /** Represents an InstanceNetworkConfig. */ - class InstanceNetworkConfig implements IInstanceNetworkConfig { - - /** - * Constructs a new InstanceNetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig); - - /** InstanceNetworkConfig authorizedExternalNetworks. */ - public authorizedExternalNetworks: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]; - - /** InstanceNetworkConfig enablePublicIp. */ - public enablePublicIp: boolean; - - /** InstanceNetworkConfig enableOutboundPublicIp. */ - public enableOutboundPublicIp: boolean; - - /** InstanceNetworkConfig network. */ - public network: string; - - /** InstanceNetworkConfig allocatedIpRangeOverride. */ - public allocatedIpRangeOverride: string; - - /** - * Creates a new InstanceNetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceNetworkConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; - - /** - * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. - * @param message InstanceNetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. - * @param message InstanceNetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; - - /** - * Verifies an InstanceNetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceNetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig; - - /** - * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. - * @param message InstanceNetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceNetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceNetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceNetworkConfig { - - /** Properties of an AuthorizedNetwork. */ - interface IAuthorizedNetwork { - - /** AuthorizedNetwork cidrRange */ - cidrRange?: (string|null); - } - - /** Represents an AuthorizedNetwork. */ - class AuthorizedNetwork implements IAuthorizedNetwork { - - /** - * Constructs a new AuthorizedNetwork. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork); - - /** AuthorizedNetwork cidrRange. */ - public cidrRange: string; - - /** - * Creates a new AuthorizedNetwork instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthorizedNetwork instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @param message AuthorizedNetwork message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @param message AuthorizedNetwork message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Verifies an AuthorizedNetwork message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuthorizedNetwork - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. - * @param message AuthorizedNetwork - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuthorizedNetwork to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuthorizedNetwork - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ConnectionPoolConfig. */ - interface IConnectionPoolConfig { - - /** ConnectionPoolConfig enabled */ - enabled?: (boolean|null); - - /** ConnectionPoolConfig flags */ - flags?: ({ [k: string]: string }|null); - - /** ConnectionPoolConfig poolerCount */ - poolerCount?: (number|null); - } - - /** Represents a ConnectionPoolConfig. */ - class ConnectionPoolConfig implements IConnectionPoolConfig { - - /** - * Constructs a new ConnectionPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig); - - /** ConnectionPoolConfig enabled. */ - public enabled: boolean; - - /** ConnectionPoolConfig flags. */ - public flags: { [k: string]: string }; - - /** ConnectionPoolConfig poolerCount. */ - public poolerCount: number; - - /** - * Creates a new ConnectionPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; - - /** - * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. - * @param message ConnectionPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. - * @param message ConnectionPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; - - /** - * Verifies a ConnectionPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig; - - /** - * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. - * @param message ConnectionPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectionPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - CREATING = 3, - DELETING = 4, - MAINTENANCE = 5, - FAILED = 6, - BOOTSTRAPPING = 8, - PROMOTING = 9 - } - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - READ_POOL = 2, - SECONDARY = 3 - } - - /** AvailabilityType enum. */ - enum AvailabilityType { - AVAILABILITY_TYPE_UNSPECIFIED = 0, - ZONAL = 1, - REGIONAL = 2 - } - - /** ActivationPolicy enum. */ - enum ActivationPolicy { - ACTIVATION_POLICY_UNSPECIFIED = 0, - ALWAYS = 1, - NEVER = 2 - } - } - - /** Properties of a ConnectionInfo. */ - interface IConnectionInfo { - - /** ConnectionInfo name */ - name?: (string|null); - - /** ConnectionInfo ipAddress */ - ipAddress?: (string|null); - - /** ConnectionInfo publicIpAddress */ - publicIpAddress?: (string|null); - - /** ConnectionInfo pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** ConnectionInfo instanceUid */ - instanceUid?: (string|null); - - /** ConnectionInfo pscDnsName */ - pscDnsName?: (string|null); - } - - /** Represents a ConnectionInfo. */ - class ConnectionInfo implements IConnectionInfo { - - /** - * Constructs a new ConnectionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo); - - /** ConnectionInfo name. */ - public name: string; - - /** ConnectionInfo ipAddress. */ - public ipAddress: string; - - /** ConnectionInfo publicIpAddress. */ - public publicIpAddress: string; - - /** ConnectionInfo pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** ConnectionInfo instanceUid. */ - public instanceUid: string; - - /** ConnectionInfo pscDnsName. */ - public pscDnsName: string; - - /** - * Creates a new ConnectionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IConnectionInfo): google.cloud.alloydb.v1alpha.ConnectionInfo; - - /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ConnectionInfo; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ConnectionInfo; - - /** - * Verifies a ConnectionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ConnectionInfo; - - /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @param message ConnectionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup name */ - name?: (string|null); - - /** Backup displayName */ - displayName?: (string|null); - - /** Backup uid */ - uid?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup createCompletionTime */ - createCompletionTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels */ - labels?: ({ [k: string]: string }|null); - - /** Backup state */ - state?: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State|null); - - /** Backup type */ - type?: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type|null); - - /** Backup description */ - description?: (string|null); - - /** Backup clusterUid */ - clusterUid?: (string|null); - - /** Backup clusterName */ - clusterName?: (string|null); - - /** Backup reconciling */ - reconciling?: (boolean|null); - - /** Backup encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** Backup encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** Backup etag */ - etag?: (string|null); - - /** Backup annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); - - /** Backup expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|null); - - /** Backup expiryQuantity */ - expiryQuantity?: (google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null); - - /** Backup satisfiesPzi */ - satisfiesPzi?: (boolean|null); - - /** Backup satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Backup databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - - /** Backup tags */ - tags?: ({ [k: string]: string }|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { - - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBackup); - - /** Backup name. */ - public name: string; - - /** Backup displayName. */ - public displayName: string; - - /** Backup uid. */ - public uid: string; - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup createCompletionTime. */ - public createCompletionTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels. */ - public labels: { [k: string]: string }; - - /** Backup state. */ - public state: (google.cloud.alloydb.v1alpha.Backup.State|keyof typeof google.cloud.alloydb.v1alpha.Backup.State); - - /** Backup type. */ - public type: (google.cloud.alloydb.v1alpha.Backup.Type|keyof typeof google.cloud.alloydb.v1alpha.Backup.Type); - - /** Backup description. */ - public description: string; - - /** Backup clusterUid. */ - public clusterUid: string; - - /** Backup clusterName. */ - public clusterName: string; - - /** Backup reconciling. */ - public reconciling: boolean; - - /** Backup encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1alpha.IEncryptionConfig|null); - - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1alpha.IEncryptionInfo|null); - - /** Backup etag. */ - public etag: string; - - /** Backup annotations. */ - public annotations: { [k: string]: string }; - - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** Backup expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); - - /** Backup expiryQuantity. */ - public expiryQuantity?: (google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null); - - /** Backup satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** Backup satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Backup databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** Backup tags. */ - public tags: { [k: string]: string }; - - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBackup): google.cloud.alloydb.v1alpha.Backup; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Backup; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Backup; - - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Backup; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Backup { - - /** Properties of a QuantityBasedExpiry. */ - interface IQuantityBasedExpiry { - - /** QuantityBasedExpiry retentionCount */ - retentionCount?: (number|null); - - /** QuantityBasedExpiry totalRetentionCount */ - totalRetentionCount?: (number|null); - } - - /** Represents a QuantityBasedExpiry. */ - class QuantityBasedExpiry implements IQuantityBasedExpiry { - - /** - * Constructs a new QuantityBasedExpiry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry); - - /** QuantityBasedExpiry retentionCount. */ - public retentionCount: number; - - /** QuantityBasedExpiry totalRetentionCount. */ - public totalRetentionCount: number; - - /** - * Creates a new QuantityBasedExpiry instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedExpiry instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; - - /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. - * @param message QuantityBasedExpiry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. - * @param message QuantityBasedExpiry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; - - /** - * Verifies a QuantityBasedExpiry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedExpiry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry; - - /** - * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. - * @param message QuantityBasedExpiry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedExpiry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedExpiry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - CREATING = 2, - FAILED = 3, - DELETING = 4 - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ON_DEMAND = 1, - AUTOMATED = 2, - CONTINUOUS = 3 - } - } - - /** Properties of a SupportedDatabaseFlag. */ - interface ISupportedDatabaseFlag { - - /** SupportedDatabaseFlag stringRestrictions */ - stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); - - /** SupportedDatabaseFlag integerRestrictions */ - integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); - - /** SupportedDatabaseFlag recommendedStringValue */ - recommendedStringValue?: (string|null); - - /** SupportedDatabaseFlag recommendedIntegerValue */ - recommendedIntegerValue?: (google.protobuf.IInt64Value|null); - - /** SupportedDatabaseFlag name */ - name?: (string|null); - - /** SupportedDatabaseFlag flagName */ - flagName?: (string|null); - - /** SupportedDatabaseFlag valueType */ - valueType?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null); - - /** SupportedDatabaseFlag acceptsMultipleValues */ - acceptsMultipleValues?: (boolean|null); - - /** SupportedDatabaseFlag supportedDbVersions */ - supportedDbVersions?: (google.cloud.alloydb.v1alpha.DatabaseVersion[]|null); - - /** SupportedDatabaseFlag requiresDbRestart */ - requiresDbRestart?: (boolean|null); - - /** SupportedDatabaseFlag scope */ - scope?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null); - } - - /** Represents a SupportedDatabaseFlag. */ - class SupportedDatabaseFlag implements ISupportedDatabaseFlag { - - /** - * Constructs a new SupportedDatabaseFlag. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag); - - /** SupportedDatabaseFlag stringRestrictions. */ - public stringRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null); - - /** SupportedDatabaseFlag integerRestrictions. */ - public integerRestrictions?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null); - - /** SupportedDatabaseFlag recommendedStringValue. */ - public recommendedStringValue?: (string|null); - - /** SupportedDatabaseFlag recommendedIntegerValue. */ - public recommendedIntegerValue?: (google.protobuf.IInt64Value|null); - - /** SupportedDatabaseFlag name. */ - public name: string; - - /** SupportedDatabaseFlag flagName. */ - public flagName: string; - - /** SupportedDatabaseFlag valueType. */ - public valueType: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType); - - /** SupportedDatabaseFlag acceptsMultipleValues. */ - public acceptsMultipleValues: boolean; - - /** SupportedDatabaseFlag supportedDbVersions. */ - public supportedDbVersions: google.cloud.alloydb.v1alpha.DatabaseVersion[]; - - /** SupportedDatabaseFlag requiresDbRestart. */ - public requiresDbRestart: boolean; - - /** SupportedDatabaseFlag scope. */ - public scope: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope); - - /** SupportedDatabaseFlag restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); - - /** SupportedDatabaseFlag recommendedValue. */ - public recommendedValue?: ("recommendedStringValue"|"recommendedIntegerValue"); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @param [properties] Properties to set - * @returns SupportedDatabaseFlag instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; - - /** - * Verifies a SupportedDatabaseFlag message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SupportedDatabaseFlag - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @param message SupportedDatabaseFlag - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SupportedDatabaseFlag { - - /** Properties of a StringRestrictions. */ - interface IStringRestrictions { - - /** StringRestrictions allowedValues */ - allowedValues?: (string[]|null); - } - - /** Represents a StringRestrictions. */ - class StringRestrictions implements IStringRestrictions { - - /** - * Constructs a new StringRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions); - - /** StringRestrictions allowedValues. */ - public allowedValues: string[]; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns StringRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; - - /** - * Verifies a StringRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @param message StringRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IntegerRestrictions. */ - interface IIntegerRestrictions { - - /** IntegerRestrictions minValue */ - minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue */ - maxValue?: (google.protobuf.IInt64Value|null); - } - - /** Represents an IntegerRestrictions. */ - class IntegerRestrictions implements IIntegerRestrictions { - - /** - * Constructs a new IntegerRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions); - - /** IntegerRestrictions minValue. */ - public minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue. */ - public maxValue?: (google.protobuf.IInt64Value|null); - - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns IntegerRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Verifies an IntegerRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntegerRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @param message IntegerRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntegerRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IntegerRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - FLOAT = 3, - NONE = 4 - } - - /** Scope enum. */ - enum Scope { - SCOPE_UNSPECIFIED = 0, - DATABASE = 1, - CONNECTION_POOL = 2 - } - } - - /** Properties of a User. */ - interface IUser { - - /** User name */ - name?: (string|null); - - /** User password */ - password?: (string|null); - - /** User databaseRoles */ - databaseRoles?: (string[]|null); - - /** User userType */ - userType?: (google.cloud.alloydb.v1alpha.User.UserType|keyof typeof google.cloud.alloydb.v1alpha.User.UserType|null); - - /** User keepExtraRoles */ - keepExtraRoles?: (boolean|null); - } - - /** Represents a User. */ - class User implements IUser { - - /** - * Constructs a new User. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUser); - - /** User name. */ - public name: string; - - /** User password. */ - public password: string; - - /** User databaseRoles. */ - public databaseRoles: string[]; - - /** User userType. */ - public userType: (google.cloud.alloydb.v1alpha.User.UserType|keyof typeof google.cloud.alloydb.v1alpha.User.UserType); - - /** User keepExtraRoles. */ - public keepExtraRoles: boolean; - - /** - * Creates a new User instance using the specified properties. - * @param [properties] Properties to set - * @returns User instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUser): google.cloud.alloydb.v1alpha.User; - - /** - * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a User message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.User; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.User; - - /** - * Verifies a User message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns User - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.User; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @param message User - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this User to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for User - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace User { - - /** UserType enum. */ - enum UserType { - USER_TYPE_UNSPECIFIED = 0, - ALLOYDB_BUILT_IN = 1, - ALLOYDB_IAM_USER = 2 - } - } - - /** Properties of a Database. */ - interface IDatabase { - - /** Database name */ - name?: (string|null); - - /** Database charset */ - charset?: (string|null); - - /** Database collation */ - collation?: (string|null); - - /** Database characterType */ - characterType?: (string|null); - - /** Database isTemplate */ - isTemplate?: (boolean|null); - - /** Database databaseTemplate */ - databaseTemplate?: (string|null); - - /** Database isTemplateDatabase */ - isTemplateDatabase?: (boolean|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDatabase); - - /** Database name. */ - public name: string; - - /** Database charset. */ - public charset: string; - - /** Database collation. */ - public collation: string; - - /** Database characterType. */ - public characterType: string; - - /** Database isTemplate. */ - public isTemplate: boolean; - - /** Database databaseTemplate. */ - public databaseTemplate: string; - - /** Database isTemplateDatabase. */ - public isTemplateDatabase?: (boolean|null); - - /** - * Creates a new Database instance using the specified properties. - * @param [properties] Properties to set - * @returns Database instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDatabase): google.cloud.alloydb.v1alpha.Database; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Database message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Database; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Database; - - /** - * Verifies a Database message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Database - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Database; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @param message Database - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Database to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Database - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** GCAEntitlementType enum. */ - enum GCAEntitlementType { - GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0, - GCA_STANDARD = 1 - } - - /** Properties of a GeminiClusterConfig. */ - interface IGeminiClusterConfig { - - /** GeminiClusterConfig entitled */ - entitled?: (boolean|null); - } - - /** Represents a GeminiClusterConfig. */ - class GeminiClusterConfig implements IGeminiClusterConfig { - - /** - * Constructs a new GeminiClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGeminiClusterConfig); - - /** GeminiClusterConfig entitled. */ - public entitled: boolean; - - /** - * Creates a new GeminiClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GeminiClusterConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGeminiClusterConfig): google.cloud.alloydb.v1alpha.GeminiClusterConfig; - - /** - * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. - * @param message GeminiClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. - * @param message GeminiClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GeminiClusterConfig; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GeminiClusterConfig; - - /** - * Verifies a GeminiClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeminiClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GeminiClusterConfig; - - /** - * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. - * @param message GeminiClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GeminiClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeminiClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeminiClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GeminiInstanceConfig. */ - interface IGeminiInstanceConfig { - - /** GeminiInstanceConfig entitled */ - entitled?: (boolean|null); - } - - /** Represents a GeminiInstanceConfig. */ - class GeminiInstanceConfig implements IGeminiInstanceConfig { - - /** - * Constructs a new GeminiInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig); - - /** GeminiInstanceConfig entitled. */ - public entitled: boolean; - - /** - * Creates a new GeminiInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GeminiInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; - - /** - * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. - * @param message GeminiInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. - * @param message GeminiInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; - - /** - * Verifies a GeminiInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeminiInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GeminiInstanceConfig; - - /** - * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. - * @param message GeminiInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GeminiInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeminiInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeminiInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCAInstanceConfig. */ - interface IGCAInstanceConfig { - - /** GCAInstanceConfig gcaEntitlement */ - gcaEntitlement?: (google.cloud.alloydb.v1alpha.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1alpha.GCAEntitlementType|null); - } - - /** Represents a GCAInstanceConfig. */ - class GCAInstanceConfig implements IGCAInstanceConfig { - - /** - * Constructs a new GCAInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGCAInstanceConfig); - - /** GCAInstanceConfig gcaEntitlement. */ - public gcaEntitlement: (google.cloud.alloydb.v1alpha.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1alpha.GCAEntitlementType); - - /** - * Creates a new GCAInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GCAInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGCAInstanceConfig): google.cloud.alloydb.v1alpha.GCAInstanceConfig; - - /** - * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. - * @param message GCAInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. - * @param message GCAInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GCAInstanceConfig; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GCAInstanceConfig; - - /** - * Verifies a GCAInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCAInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GCAInstanceConfig; - - /** - * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. - * @param message GCAInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GCAInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCAInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCAInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AlloyDBAdmin */ - class AlloyDBAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new AlloyDBAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse - */ - public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback): void; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise - */ - public listClusters(request: google.cloud.alloydb.v1alpha.IListClustersRequest): Promise; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster - */ - public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback): void; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise - */ - public getCluster(request: google.cloud.alloydb.v1alpha.IGetClusterRequest): Promise; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback): void; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise - */ - public createCluster(request: google.cloud.alloydb.v1alpha.ICreateClusterRequest): Promise; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback): void; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @returns Promise - */ - public updateCluster(request: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): Promise; - - /** - * Calls ExportCluster. - * @param request ExportClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportCluster(request: google.cloud.alloydb.v1alpha.IExportClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportClusterCallback): void; - - /** - * Calls ExportCluster. - * @param request ExportClusterRequest message or plain object - * @returns Promise - */ - public exportCluster(request: google.cloud.alloydb.v1alpha.IExportClusterRequest): Promise; - - /** - * Calls ImportCluster. - * @param request ImportClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importCluster(request: google.cloud.alloydb.v1alpha.IImportClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportClusterCallback): void; - - /** - * Calls ImportCluster. - * @param request ImportClusterRequest message or plain object - * @returns Promise - */ - public importCluster(request: google.cloud.alloydb.v1alpha.IImportClusterRequest): Promise; - - /** - * Calls UpgradeCluster. - * @param request UpgradeClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public upgradeCluster(request: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeClusterCallback): void; - - /** - * Calls UpgradeCluster. - * @param request UpgradeClusterRequest message or plain object - * @returns Promise - */ - public upgradeCluster(request: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest): Promise; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback): void; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise - */ - public deleteCluster(request: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): Promise; - - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback): void; - - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @returns Promise - */ - public promoteCluster(request: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): Promise; - - /** - * Calls SwitchoverCluster. - * @param request SwitchoverClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public switchoverCluster(request: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverClusterCallback): void; - - /** - * Calls SwitchoverCluster. - * @param request SwitchoverClusterRequest message or plain object - * @returns Promise - */ - public switchoverCluster(request: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest): Promise; - - /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback): void; - - /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @returns Promise - */ - public restoreCluster(request: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): Promise; - - /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback): void; - - /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @returns Promise - */ - public createSecondaryCluster(request: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.cloud.alloydb.v1alpha.IListInstancesRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.cloud.alloydb.v1alpha.IGetInstanceRequest): Promise; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): Promise; - - /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; - - /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @returns Promise - */ - public createSecondaryInstance(request: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): Promise; - - /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback): void; - - /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @returns Promise - */ - public batchCreateInstances(request: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): Promise; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback): void; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise - */ - public updateInstance(request: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): Promise; - - /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback): void; - - /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @returns Promise - */ - public failoverInstance(request: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): Promise; - - /** - * Calls InjectFault. - * @param request InjectFaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public injectFault(request: google.cloud.alloydb.v1alpha.IInjectFaultRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFaultCallback): void; - - /** - * Calls InjectFault. - * @param request InjectFaultRequest message or plain object - * @returns Promise - */ - public injectFault(request: google.cloud.alloydb.v1alpha.IInjectFaultRequest): Promise; - - /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback): void; - - /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @returns Promise - */ - public restartInstance(request: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): Promise; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteSqlResponse - */ - public executeSql(request: google.cloud.alloydb.v1alpha.IExecuteSqlRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSqlCallback): void; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeSql(request: google.cloud.alloydb.v1alpha.IExecuteSqlRequest): Promise; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse - */ - public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback): void; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise - */ - public listBackups(request: google.cloud.alloydb.v1alpha.IListBackupsRequest): Promise; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback): void; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise - */ - public getBackup(request: google.cloud.alloydb.v1alpha.IGetBackupRequest): Promise; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback): void; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise - */ - public createBackup(request: google.cloud.alloydb.v1alpha.ICreateBackupRequest): Promise; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback): void; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise - */ - public updateBackup(request: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): Promise; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback): void; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise - */ - public deleteBackup(request: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): Promise; - - /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; - - /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @returns Promise - */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): Promise; - - /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - */ - public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback): void; - - /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @returns Promise - */ - public generateClientCertificate(request: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): Promise; - - /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ConnectionInfo - */ - public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback): void; - - /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @returns Promise - */ - public getConnectionInfo(request: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): Promise; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListUsersResponse - */ - public listUsers(request: google.cloud.alloydb.v1alpha.IListUsersRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsersCallback): void; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @returns Promise - */ - public listUsers(request: google.cloud.alloydb.v1alpha.IListUsersRequest): Promise; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public getUser(request: google.cloud.alloydb.v1alpha.IGetUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUserCallback): void; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @returns Promise - */ - public getUser(request: google.cloud.alloydb.v1alpha.IGetUserRequest): Promise; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public createUser(request: google.cloud.alloydb.v1alpha.ICreateUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUserCallback): void; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @returns Promise - */ - public createUser(request: google.cloud.alloydb.v1alpha.ICreateUserRequest): Promise; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public updateUser(request: google.cloud.alloydb.v1alpha.IUpdateUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUserCallback): void; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @returns Promise - */ - public updateUser(request: google.cloud.alloydb.v1alpha.IUpdateUserRequest): Promise; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteUser(request: google.cloud.alloydb.v1alpha.IDeleteUserRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUserCallback): void; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @returns Promise - */ - public deleteUser(request: google.cloud.alloydb.v1alpha.IDeleteUserRequest): Promise; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse - */ - public listDatabases(request: google.cloud.alloydb.v1alpha.IListDatabasesRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabasesCallback): void; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @returns Promise - */ - public listDatabases(request: google.cloud.alloydb.v1alpha.IListDatabasesRequest): Promise; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Database - */ - public createDatabase(request: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, callback: google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabaseCallback): void; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @returns Promise - */ - public createDatabase(request: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest): Promise; - } - - namespace AlloyDBAdmin { - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse - */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListClustersResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. - * @param error Error, if any - * @param [response] Cluster - */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Cluster) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|exportCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|importCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|upgradeCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpgradeClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|switchoverCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type SwitchoverClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Instance) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|injectFault}. - * @param error Error, if any - * @param [response] Operation - */ - type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|executeSql}. - * @param error Error, if any - * @param [response] ExecuteSqlResponse - */ - type ExecuteSqlCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ExecuteSqlResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse - */ - type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListBackupsResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Backup) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @param error Error, if any - * @param [response] ListSupportedDatabaseFlagsResponse - */ - type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. - * @param error Error, if any - * @param [response] GenerateClientCertificateResponse - */ - type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. - * @param error Error, if any - * @param [response] ConnectionInfo - */ - type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ConnectionInfo) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listUsers}. - * @param error Error, if any - * @param [response] ListUsersResponse - */ - type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListUsersResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getUser}. - * @param error Error, if any - * @param [response] User - */ - type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createUser}. - * @param error Error, if any - * @param [response] User - */ - type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateUser}. - * @param error Error, if any - * @param [response] User - */ - type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteUser}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listDatabases}. - * @param error Error, if any - * @param [response] ListDatabasesResponse - */ - type ListDatabasesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.ListDatabasesResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createDatabase}. - * @param error Error, if any - * @param [response] Database - */ - type CreateDatabaseCallback = (error: (Error|null), response?: google.cloud.alloydb.v1alpha.Database) => void; - } - - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { - - /** ListClustersRequest parent */ - parent?: (string|null); - - /** ListClustersRequest pageSize */ - pageSize?: (number|null); - - /** ListClustersRequest pageToken */ - pageToken?: (string|null); - - /** ListClustersRequest filter */ - filter?: (string|null); - - /** ListClustersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { - - /** - * Constructs a new ListClustersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest); - - /** ListClustersRequest parent. */ - public parent: string; - - /** ListClustersRequest pageSize. */ - public pageSize: number; - - /** ListClustersRequest pageToken. */ - public pageToken: string; - - /** ListClustersRequest filter. */ - public filter: string; - - /** ListClustersRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersRequest): google.cloud.alloydb.v1alpha.ListClustersRequest; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersRequest; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersRequest; - - /** - * Verifies a ListClustersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersRequest; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { - - /** ListClustersResponse clusters */ - clusters?: (google.cloud.alloydb.v1alpha.ICluster[]|null); - - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListClustersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { - - /** - * Constructs a new ListClustersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse); - - /** ListClustersResponse clusters. */ - public clusters: google.cloud.alloydb.v1alpha.ICluster[]; - - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListClustersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListClustersResponse): google.cloud.alloydb.v1alpha.ListClustersResponse; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListClustersResponse; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListClustersResponse; - - /** - * Verifies a ListClustersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListClustersResponse; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { - - /** GetClusterRequest name */ - name?: (string|null); - - /** GetClusterRequest view */ - view?: (google.cloud.alloydb.v1alpha.ClusterView|keyof typeof google.cloud.alloydb.v1alpha.ClusterView|null); - } - - /** Represents a GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { - - /** - * Constructs a new GetClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest); - - /** GetClusterRequest name. */ - public name: string; - - /** GetClusterRequest view. */ - public view: (google.cloud.alloydb.v1alpha.ClusterView|keyof typeof google.cloud.alloydb.v1alpha.ClusterView); - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetClusterRequest): google.cloud.alloydb.v1alpha.GetClusterRequest; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetClusterRequest; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetClusterRequest; - - /** - * Verifies a GetClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetClusterRequest; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSecondaryClusterRequest. */ - interface ICreateSecondaryClusterRequest { - - /** CreateSecondaryClusterRequest parent */ - parent?: (string|null); - - /** CreateSecondaryClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateSecondaryClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** CreateSecondaryClusterRequest requestId */ - requestId?: (string|null); - - /** CreateSecondaryClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateSecondaryClusterRequest. */ - class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { - - /** - * Constructs a new CreateSecondaryClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest); - - /** CreateSecondaryClusterRequest parent. */ - public parent: string; - - /** CreateSecondaryClusterRequest clusterId. */ - public clusterId: string; - - /** CreateSecondaryClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** CreateSecondaryClusterRequest requestId. */ - public requestId: string; - - /** CreateSecondaryClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecondaryClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; - - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; - - /** - * Verifies a CreateSecondaryClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecondaryClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest; - - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { - - /** CreateClusterRequest parent */ - parent?: (string|null); - - /** CreateClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** CreateClusterRequest requestId */ - requestId?: (string|null); - - /** CreateClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { - - /** - * Constructs a new CreateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest); - - /** CreateClusterRequest parent. */ - public parent: string; - - /** CreateClusterRequest clusterId. */ - public clusterId: string; - - /** CreateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** CreateClusterRequest requestId. */ - public requestId: string; - - /** CreateClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateClusterRequest): google.cloud.alloydb.v1alpha.CreateClusterRequest; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateClusterRequest; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateClusterRequest; - - /** - * Verifies a CreateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateClusterRequest; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateClusterRequest. */ - interface IUpdateClusterRequest { - - /** UpdateClusterRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** UpdateClusterRequest requestId */ - requestId?: (string|null); - - /** UpdateClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateClusterRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateClusterRequest. */ - class UpdateClusterRequest implements IUpdateClusterRequest { - - /** - * Constructs a new UpdateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest); - - /** UpdateClusterRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** UpdateClusterRequest requestId. */ - public requestId: string; - - /** UpdateClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateClusterRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateClusterRequest): google.cloud.alloydb.v1alpha.UpdateClusterRequest; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateClusterRequest; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateClusterRequest; - - /** - * Verifies an UpdateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateClusterRequest; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @param message UpdateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); - } - - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { - - /** - * Constructs a new GcsDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDestination instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGcsDestination): google.cloud.alloydb.v1alpha.GcsDestination; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GcsDestination; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GcsDestination; - - /** - * Verifies a GcsDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GcsDestination; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDestination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportClusterRequest. */ - interface IExportClusterRequest { - - /** ExportClusterRequest gcsDestination */ - gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); - - /** ExportClusterRequest csvExportOptions */ - csvExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null); - - /** ExportClusterRequest sqlExportOptions */ - sqlExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null); - - /** ExportClusterRequest name */ - name?: (string|null); - - /** ExportClusterRequest database */ - database?: (string|null); - } - - /** Represents an ExportClusterRequest. */ - class ExportClusterRequest implements IExportClusterRequest { - - /** - * Constructs a new ExportClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IExportClusterRequest); - - /** ExportClusterRequest gcsDestination. */ - public gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); - - /** ExportClusterRequest csvExportOptions. */ - public csvExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null); - - /** ExportClusterRequest sqlExportOptions. */ - public sqlExportOptions?: (google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null); - - /** ExportClusterRequest name. */ - public name: string; - - /** ExportClusterRequest database. */ - public database: string; - - /** ExportClusterRequest destination. */ - public destination?: "gcsDestination"; - - /** ExportClusterRequest exportOptions. */ - public exportOptions?: ("csvExportOptions"|"sqlExportOptions"); - - /** - * Creates a new ExportClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IExportClusterRequest): google.cloud.alloydb.v1alpha.ExportClusterRequest; - - /** - * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. - * @param message ExportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. - * @param message ExportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterRequest; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterRequest; - - /** - * Verifies an ExportClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterRequest; - - /** - * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. - * @param message ExportClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExportClusterRequest { - - /** Properties of a CsvExportOptions. */ - interface ICsvExportOptions { - - /** CsvExportOptions selectQuery */ - selectQuery?: (string|null); - - /** CsvExportOptions fieldDelimiter */ - fieldDelimiter?: (string|null); - - /** CsvExportOptions quoteCharacter */ - quoteCharacter?: (string|null); - - /** CsvExportOptions escapeCharacter */ - escapeCharacter?: (string|null); - } - - /** Represents a CsvExportOptions. */ - class CsvExportOptions implements ICsvExportOptions { - - /** - * Constructs a new CsvExportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions); - - /** CsvExportOptions selectQuery. */ - public selectQuery: string; - - /** CsvExportOptions fieldDelimiter. */ - public fieldDelimiter: string; - - /** CsvExportOptions quoteCharacter. */ - public quoteCharacter: string; - - /** CsvExportOptions escapeCharacter. */ - public escapeCharacter: string; - - /** - * Creates a new CsvExportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CsvExportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; - - /** - * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @param message CsvExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @param message CsvExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; - - /** - * Verifies a CsvExportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CsvExportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions; - - /** - * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. - * @param message CsvExportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CsvExportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CsvExportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlExportOptions. */ - interface ISqlExportOptions { - - /** SqlExportOptions tables */ - tables?: (string[]|null); - - /** SqlExportOptions schemaOnly */ - schemaOnly?: (boolean|null); - - /** SqlExportOptions cleanTargetObjects */ - cleanTargetObjects?: (boolean|null); - - /** SqlExportOptions ifExistTargetObjects */ - ifExistTargetObjects?: (boolean|null); - } - - /** Represents a SqlExportOptions. */ - class SqlExportOptions implements ISqlExportOptions { - - /** - * Constructs a new SqlExportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions); - - /** SqlExportOptions tables. */ - public tables: string[]; - - /** SqlExportOptions schemaOnly. */ - public schemaOnly?: (boolean|null); - - /** SqlExportOptions cleanTargetObjects. */ - public cleanTargetObjects?: (boolean|null); - - /** SqlExportOptions ifExistTargetObjects. */ - public ifExistTargetObjects?: (boolean|null); - - /** - * Creates a new SqlExportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlExportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; - - /** - * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @param message SqlExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @param message SqlExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; - - /** - * Verifies a SqlExportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlExportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions; - - /** - * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. - * @param message SqlExportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlExportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlExportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExportClusterResponse. */ - interface IExportClusterResponse { - - /** ExportClusterResponse gcsDestination */ - gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); - } - - /** Represents an ExportClusterResponse. */ - class ExportClusterResponse implements IExportClusterResponse { - - /** - * Constructs a new ExportClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IExportClusterResponse); - - /** ExportClusterResponse gcsDestination. */ - public gcsDestination?: (google.cloud.alloydb.v1alpha.IGcsDestination|null); - - /** ExportClusterResponse destination. */ - public destination?: "gcsDestination"; - - /** - * Creates a new ExportClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IExportClusterResponse): google.cloud.alloydb.v1alpha.ExportClusterResponse; - - /** - * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. - * @param message ExportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. - * @param message ExportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExportClusterResponse; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExportClusterResponse; - - /** - * Verifies an ExportClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExportClusterResponse; - - /** - * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. - * @param message ExportClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportClusterRequest. */ - interface IImportClusterRequest { - - /** ImportClusterRequest sqlImportOptions */ - sqlImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null); - - /** ImportClusterRequest csvImportOptions */ - csvImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null); - - /** ImportClusterRequest name */ - name?: (string|null); - - /** ImportClusterRequest gcsUri */ - gcsUri?: (string|null); - - /** ImportClusterRequest database */ - database?: (string|null); - - /** ImportClusterRequest user */ - user?: (string|null); - } - - /** Represents an ImportClusterRequest. */ - class ImportClusterRequest implements IImportClusterRequest { - - /** - * Constructs a new ImportClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IImportClusterRequest); - - /** ImportClusterRequest sqlImportOptions. */ - public sqlImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null); - - /** ImportClusterRequest csvImportOptions. */ - public csvImportOptions?: (google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null); - - /** ImportClusterRequest name. */ - public name: string; - - /** ImportClusterRequest gcsUri. */ - public gcsUri: string; - - /** ImportClusterRequest database. */ - public database: string; - - /** ImportClusterRequest user. */ - public user: string; - - /** ImportClusterRequest importOptions. */ - public importOptions?: ("sqlImportOptions"|"csvImportOptions"); - - /** - * Creates a new ImportClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IImportClusterRequest): google.cloud.alloydb.v1alpha.ImportClusterRequest; - - /** - * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. - * @param message ImportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. - * @param message ImportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterRequest; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterRequest; - - /** - * Verifies an ImportClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterRequest; - - /** - * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. - * @param message ImportClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportClusterRequest { - - /** Properties of a SqlImportOptions. */ - interface ISqlImportOptions { - } - - /** Represents a SqlImportOptions. */ - class SqlImportOptions implements ISqlImportOptions { - - /** - * Constructs a new SqlImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions); - - /** - * Creates a new SqlImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlImportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; - - /** - * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @param message SqlImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @param message SqlImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; - - /** - * Verifies a SqlImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions; - - /** - * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. - * @param message SqlImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CsvImportOptions. */ - interface ICsvImportOptions { - - /** CsvImportOptions table */ - table?: (string|null); - - /** CsvImportOptions columns */ - columns?: (string[]|null); - - /** CsvImportOptions fieldDelimiter */ - fieldDelimiter?: (string|null); - - /** CsvImportOptions quoteCharacter */ - quoteCharacter?: (string|null); - - /** CsvImportOptions escapeCharacter */ - escapeCharacter?: (string|null); - } - - /** Represents a CsvImportOptions. */ - class CsvImportOptions implements ICsvImportOptions { - - /** - * Constructs a new CsvImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions); - - /** CsvImportOptions table. */ - public table: string; - - /** CsvImportOptions columns. */ - public columns: string[]; - - /** CsvImportOptions fieldDelimiter. */ - public fieldDelimiter: string; - - /** CsvImportOptions quoteCharacter. */ - public quoteCharacter: string; - - /** CsvImportOptions escapeCharacter. */ - public escapeCharacter: string; - - /** - * Creates a new CsvImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CsvImportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; - - /** - * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @param message CsvImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @param message CsvImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; - - /** - * Verifies a CsvImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CsvImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions; - - /** - * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. - * @param message CsvImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CsvImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CsvImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ImportClusterResponse. */ - interface IImportClusterResponse { - - /** ImportClusterResponse bytesDownloaded */ - bytesDownloaded?: (number|Long|string|null); - } - - /** Represents an ImportClusterResponse. */ - class ImportClusterResponse implements IImportClusterResponse { - - /** - * Constructs a new ImportClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IImportClusterResponse); - - /** ImportClusterResponse bytesDownloaded. */ - public bytesDownloaded: (number|Long|string); - - /** - * Creates a new ImportClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IImportClusterResponse): google.cloud.alloydb.v1alpha.ImportClusterResponse; - - /** - * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. - * @param message ImportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. - * @param message ImportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ImportClusterResponse; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ImportClusterResponse; - - /** - * Verifies an ImportClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ImportClusterResponse; - - /** - * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. - * @param message ImportClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ImportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterRequest. */ - interface IUpgradeClusterRequest { - - /** UpgradeClusterRequest name */ - name?: (string|null); - - /** UpgradeClusterRequest version */ - version?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - - /** UpgradeClusterRequest requestId */ - requestId?: (string|null); - - /** UpgradeClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpgradeClusterRequest etag */ - etag?: (string|null); - } - - /** Represents an UpgradeClusterRequest. */ - class UpgradeClusterRequest implements IUpgradeClusterRequest { - - /** - * Constructs a new UpgradeClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest); - - /** UpgradeClusterRequest name. */ - public name: string; - - /** UpgradeClusterRequest version. */ - public version: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** UpgradeClusterRequest requestId. */ - public requestId: string; - - /** UpgradeClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** UpgradeClusterRequest etag. */ - public etag: string; - - /** - * Creates a new UpgradeClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; - - /** - * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. - * @param message UpgradeClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. - * @param message UpgradeClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; - - /** - * Verifies an UpgradeClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterRequest; - - /** - * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. - * @param message UpgradeClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterResponse. */ - interface IUpgradeClusterResponse { - - /** UpgradeClusterResponse status */ - status?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); - - /** UpgradeClusterResponse message */ - message?: (string|null); - - /** UpgradeClusterResponse clusterUpgradeDetails */ - clusterUpgradeDetails?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails[]|null); - } - - /** Represents an UpgradeClusterResponse. */ - class UpgradeClusterResponse implements IUpgradeClusterResponse { - - /** - * Constructs a new UpgradeClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse); - - /** UpgradeClusterResponse status. */ - public status: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); - - /** UpgradeClusterResponse message. */ - public message: string; - - /** UpgradeClusterResponse clusterUpgradeDetails. */ - public clusterUpgradeDetails: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails[]; - - /** - * Creates a new UpgradeClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; - - /** - * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. - * @param message UpgradeClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. - * @param message UpgradeClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; - - /** - * Verifies an UpgradeClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse; - - /** - * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. - * @param message UpgradeClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpgradeClusterResponse { - - /** Properties of a StageInfo. */ - interface IStageInfo { - - /** StageInfo stage */ - stage?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null); - - /** StageInfo status */ - status?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); - - /** StageInfo logsUrl */ - logsUrl?: (string|null); - } - - /** Represents a StageInfo. */ - class StageInfo implements IStageInfo { - - /** - * Constructs a new StageInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo); - - /** StageInfo stage. */ - public stage: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage); - - /** StageInfo status. */ - public status: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); - - /** StageInfo logsUrl. */ - public logsUrl: string; - - /** - * Creates a new StageInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns StageInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; - - /** - * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @param message StageInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @param message StageInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; - - /** - * Decodes a StageInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; - - /** - * Verifies a StageInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo; - - /** - * Creates a plain object from a StageInfo message. Also converts values to other types if specified. - * @param message StageInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceUpgradeDetails. */ - interface IInstanceUpgradeDetails { - - /** InstanceUpgradeDetails name */ - name?: (string|null); - - /** InstanceUpgradeDetails upgradeStatus */ - upgradeStatus?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); - - /** InstanceUpgradeDetails instanceType */ - instanceType?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); - } - - /** Represents an InstanceUpgradeDetails. */ - class InstanceUpgradeDetails implements IInstanceUpgradeDetails { - - /** - * Constructs a new InstanceUpgradeDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails); - - /** InstanceUpgradeDetails name. */ - public name: string; - - /** InstanceUpgradeDetails upgradeStatus. */ - public upgradeStatus: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); - - /** InstanceUpgradeDetails instanceType. */ - public instanceType: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); - - /** - * Creates a new InstanceUpgradeDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceUpgradeDetails instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @param message InstanceUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @param message InstanceUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Verifies an InstanceUpgradeDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceUpgradeDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. - * @param message InstanceUpgradeDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceUpgradeDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceUpgradeDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterUpgradeDetails. */ - interface IClusterUpgradeDetails { - - /** ClusterUpgradeDetails name */ - name?: (string|null); - - /** ClusterUpgradeDetails upgradeStatus */ - upgradeStatus?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); - - /** ClusterUpgradeDetails clusterType */ - clusterType?: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType|null); - - /** ClusterUpgradeDetails databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - - /** ClusterUpgradeDetails stageInfo */ - stageInfo?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo[]|null); - - /** ClusterUpgradeDetails instanceUpgradeDetails */ - instanceUpgradeDetails?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails[]|null); - } - - /** Represents a ClusterUpgradeDetails. */ - class ClusterUpgradeDetails implements IClusterUpgradeDetails { - - /** - * Constructs a new ClusterUpgradeDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails); - - /** ClusterUpgradeDetails name. */ - public name: string; - - /** ClusterUpgradeDetails upgradeStatus. */ - public upgradeStatus: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); - - /** ClusterUpgradeDetails clusterType. */ - public clusterType: (google.cloud.alloydb.v1alpha.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1alpha.Cluster.ClusterType); - - /** ClusterUpgradeDetails databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** ClusterUpgradeDetails stageInfo. */ - public stageInfo: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo[]; - - /** ClusterUpgradeDetails instanceUpgradeDetails. */ - public instanceUpgradeDetails: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails[]; - - /** - * Creates a new ClusterUpgradeDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterUpgradeDetails instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @param message ClusterUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @param message ClusterUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Verifies a ClusterUpgradeDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterUpgradeDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. - * @param message ClusterUpgradeDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterUpgradeDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterUpgradeDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, - NOT_STARTED = 4, - IN_PROGRESS = 5, - SUCCESS = 1, - FAILED = 2, - PARTIAL_SUCCESS = 3, - CANCEL_IN_PROGRESS = 6, - CANCELLED = 7 - } - - /** Stage enum. */ - enum Stage { - STAGE_UNSPECIFIED = 0, - ALLOYDB_PRECHECK = 1, - PG_UPGRADE_CHECK = 2, - PREPARE_FOR_UPGRADE = 5, - PRIMARY_INSTANCE_UPGRADE = 3, - READ_POOL_INSTANCES_UPGRADE = 4, - ROLLBACK = 6, - CLEANUP = 7 - } - } - - /** Properties of a DeleteClusterRequest. */ - interface IDeleteClusterRequest { - - /** DeleteClusterRequest name */ - name?: (string|null); - - /** DeleteClusterRequest requestId */ - requestId?: (string|null); - - /** DeleteClusterRequest etag */ - etag?: (string|null); - - /** DeleteClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteClusterRequest force */ - force?: (boolean|null); - } - - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { - - /** - * Constructs a new DeleteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest); - - /** DeleteClusterRequest name. */ - public name: string; - - /** DeleteClusterRequest requestId. */ - public requestId: string; - - /** DeleteClusterRequest etag. */ - public etag: string; - - /** DeleteClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteClusterRequest force. */ - public force: boolean; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteClusterRequest): google.cloud.alloydb.v1alpha.DeleteClusterRequest; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteClusterRequest; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteClusterRequest; - - /** - * Verifies a DeleteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteClusterRequest; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SwitchoverClusterRequest. */ - interface ISwitchoverClusterRequest { - - /** SwitchoverClusterRequest name */ - name?: (string|null); - - /** SwitchoverClusterRequest requestId */ - requestId?: (string|null); - - /** SwitchoverClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a SwitchoverClusterRequest. */ - class SwitchoverClusterRequest implements ISwitchoverClusterRequest { - - /** - * Constructs a new SwitchoverClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest); - - /** SwitchoverClusterRequest name. */ - public name: string; - - /** SwitchoverClusterRequest requestId. */ - public requestId: string; - - /** SwitchoverClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new SwitchoverClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SwitchoverClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; - - /** - * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. - * @param message SwitchoverClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. - * @param message SwitchoverClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; - - /** - * Verifies a SwitchoverClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SwitchoverClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SwitchoverClusterRequest; - - /** - * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. - * @param message SwitchoverClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SwitchoverClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SwitchoverClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SwitchoverClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PromoteClusterRequest. */ - interface IPromoteClusterRequest { - - /** PromoteClusterRequest name */ - name?: (string|null); - - /** PromoteClusterRequest requestId */ - requestId?: (string|null); - - /** PromoteClusterRequest etag */ - etag?: (string|null); - - /** PromoteClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a PromoteClusterRequest. */ - class PromoteClusterRequest implements IPromoteClusterRequest { - - /** - * Constructs a new PromoteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest); - - /** PromoteClusterRequest name. */ - public name: string; - - /** PromoteClusterRequest requestId. */ - public requestId: string; - - /** PromoteClusterRequest etag. */ - public etag: string; - - /** PromoteClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new PromoteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PromoteClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterRequest): google.cloud.alloydb.v1alpha.PromoteClusterRequest; - - /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.PromoteClusterRequest; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.PromoteClusterRequest; - - /** - * Verifies a PromoteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromoteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.PromoteClusterRequest; - - /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @param message PromoteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromoteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromoteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreClusterRequest. */ - interface IRestoreClusterRequest { - - /** RestoreClusterRequest backupSource */ - backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource */ - continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent */ - parent?: (string|null); - - /** RestoreClusterRequest clusterId */ - clusterId?: (string|null); - - /** RestoreClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** RestoreClusterRequest requestId */ - requestId?: (string|null); - - /** RestoreClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a RestoreClusterRequest. */ - class RestoreClusterRequest implements IRestoreClusterRequest { - - /** - * Constructs a new RestoreClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest); - - /** RestoreClusterRequest backupSource. */ - public backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource. */ - public continuousBackupSource?: (google.cloud.alloydb.v1alpha.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent. */ - public parent: string; - - /** RestoreClusterRequest clusterId. */ - public clusterId: string; - - /** RestoreClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1alpha.ICluster|null); - - /** RestoreClusterRequest requestId. */ - public requestId: string; - - /** RestoreClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** RestoreClusterRequest source. */ - public source?: ("backupSource"|"continuousBackupSource"); - - /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IRestoreClusterRequest): google.cloud.alloydb.v1alpha.RestoreClusterRequest; - - /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestoreClusterRequest; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestoreClusterRequest; - - /** - * Verifies a RestoreClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestoreClusterRequest; - - /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @param message RestoreClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest filter */ - filter?: (string|null); - - /** ListInstancesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest filter. */ - public filter: string; - - /** ListInstancesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesRequest): google.cloud.alloydb.v1alpha.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1alpha.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListInstancesResponse): google.cloud.alloydb.v1alpha.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - - /** GetInstanceRequest view */ - view?: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** GetInstanceRequest view. */ - public view: (google.cloud.alloydb.v1alpha.InstanceView|keyof typeof google.cloud.alloydb.v1alpha.InstanceView); - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetInstanceRequest): google.cloud.alloydb.v1alpha.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** CreateInstanceRequest requestId */ - requestId?: (string|null); - - /** CreateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** CreateInstanceRequest requestId. */ - public requestId: string; - - /** CreateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequest): google.cloud.alloydb.v1alpha.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSecondaryInstanceRequest. */ - interface ICreateSecondaryInstanceRequest { - - /** CreateSecondaryInstanceRequest parent */ - parent?: (string|null); - - /** CreateSecondaryInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateSecondaryInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId */ - requestId?: (string|null); - - /** CreateSecondaryInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateSecondaryInstanceRequest. */ - class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { - - /** - * Constructs a new CreateSecondaryInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest); - - /** CreateSecondaryInstanceRequest parent. */ - public parent: string; - - /** CreateSecondaryInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateSecondaryInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId. */ - public requestId: string; - - /** CreateSecondaryInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecondaryInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; - - /** - * Verifies a CreateSecondaryInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecondaryInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest; - - /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecondaryInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecondaryInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequests. */ - interface ICreateInstanceRequests { - - /** CreateInstanceRequests createInstanceRequests */ - createInstanceRequests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]|null); - } - - /** Represents a CreateInstanceRequests. */ - class CreateInstanceRequests implements ICreateInstanceRequests { - - /** - * Constructs a new CreateInstanceRequests. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests); - - /** CreateInstanceRequests createInstanceRequests. */ - public createInstanceRequests: google.cloud.alloydb.v1alpha.ICreateInstanceRequest[]; - - /** - * Creates a new CreateInstanceRequests instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequests instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateInstanceRequests): google.cloud.alloydb.v1alpha.CreateInstanceRequests; - - /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateInstanceRequests; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateInstanceRequests; - - /** - * Verifies a CreateInstanceRequests message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequests - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateInstanceRequests; - - /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @param message CreateInstanceRequests - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequests to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequests - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesRequest. */ - interface IBatchCreateInstancesRequest { - - /** BatchCreateInstancesRequest parent */ - parent?: (string|null); - - /** BatchCreateInstancesRequest requests */ - requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); - - /** BatchCreateInstancesRequest requestId */ - requestId?: (string|null); - } - - /** Represents a BatchCreateInstancesRequest. */ - class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { - - /** - * Constructs a new BatchCreateInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest); - - /** BatchCreateInstancesRequest parent. */ - public parent: string; - - /** BatchCreateInstancesRequest requests. */ - public requests?: (google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null); - - /** BatchCreateInstancesRequest requestId. */ - public requestId: string; - - /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; - - /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; - - /** - * Verifies a BatchCreateInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest; - - /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @param message BatchCreateInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesResponse. */ - interface IBatchCreateInstancesResponse { - - /** BatchCreateInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1alpha.IInstance[]|null); - } - - /** Represents a BatchCreateInstancesResponse. */ - class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { - - /** - * Constructs a new BatchCreateInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse); - - /** BatchCreateInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1alpha.IInstance[]; - - /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; - - /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; - - /** - * Verifies a BatchCreateInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse; - - /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @param message BatchCreateInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesMetadata. */ - interface IBatchCreateInstancesMetadata { - - /** BatchCreateInstancesMetadata instanceTargets */ - instanceTargets?: (string[]|null); - - /** BatchCreateInstancesMetadata instanceStatuses */ - instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }|null); - } - - /** Represents a BatchCreateInstancesMetadata. */ - class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { - - /** - * Constructs a new BatchCreateInstancesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata); - - /** BatchCreateInstancesMetadata instanceTargets. */ - public instanceTargets: string[]; - - /** BatchCreateInstancesMetadata instanceStatuses. */ - public instanceStatuses: { [k: string]: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus }; - - /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; - - /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; - - /** - * Verifies a BatchCreateInstancesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata; - - /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @param message BatchCreateInstancesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstanceStatus. */ - interface IBatchCreateInstanceStatus { - - /** BatchCreateInstanceStatus state */ - state?: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null); - - /** BatchCreateInstanceStatus errorMsg */ - errorMsg?: (string|null); - - /** BatchCreateInstanceStatus error */ - error?: (google.rpc.IStatus|null); - - /** BatchCreateInstanceStatus type */ - type?: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType|null); - } - - /** Represents a BatchCreateInstanceStatus. */ - class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { - - /** - * Constructs a new BatchCreateInstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus); - - /** BatchCreateInstanceStatus state. */ - public state: (google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State); - - /** BatchCreateInstanceStatus errorMsg. */ - public errorMsg: string; - - /** BatchCreateInstanceStatus error. */ - public error?: (google.rpc.IStatus|null); - - /** BatchCreateInstanceStatus type. */ - public type: (google.cloud.alloydb.v1alpha.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1alpha.Instance.InstanceType); - - /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstanceStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; - - /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; - - /** - * Verifies a BatchCreateInstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus; - - /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @param message BatchCreateInstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchCreateInstanceStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING_CREATE = 1, - READY = 2, - CREATING = 3, - DELETING = 4, - FAILED = 5, - ROLLED_BACK = 6 - } - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** UpdateInstanceRequest requestId */ - requestId?: (string|null); - - /** UpdateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateInstanceRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { - - /** - * Constructs a new UpdateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest); - - /** UpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1alpha.IInstance|null); - - /** UpdateInstanceRequest requestId. */ - public requestId: string; - - /** UpdateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateInstanceRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; - - /** - * Verifies an UpdateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateInstanceRequest; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - - /** DeleteInstanceRequest requestId */ - requestId?: (string|null); - - /** DeleteInstanceRequest etag */ - etag?: (string|null); - - /** DeleteInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** DeleteInstanceRequest requestId. */ - public requestId: string; - - /** DeleteInstanceRequest etag. */ - public etag: string; - - /** DeleteInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FailoverInstanceRequest. */ - interface IFailoverInstanceRequest { - - /** FailoverInstanceRequest name */ - name?: (string|null); - - /** FailoverInstanceRequest requestId */ - requestId?: (string|null); - - /** FailoverInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a FailoverInstanceRequest. */ - class FailoverInstanceRequest implements IFailoverInstanceRequest { - - /** - * Constructs a new FailoverInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest); - - /** FailoverInstanceRequest name. */ - public name: string; - - /** FailoverInstanceRequest requestId. */ - public requestId: string; - - /** FailoverInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FailoverInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; - - /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; - - /** - * Verifies a FailoverInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FailoverInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.FailoverInstanceRequest; - - /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @param message FailoverInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FailoverInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FailoverInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InjectFaultRequest. */ - interface IInjectFaultRequest { - - /** InjectFaultRequest faultType */ - faultType?: (google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|null); - - /** InjectFaultRequest name */ - name?: (string|null); - - /** InjectFaultRequest requestId */ - requestId?: (string|null); - - /** InjectFaultRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an InjectFaultRequest. */ - class InjectFaultRequest implements IInjectFaultRequest { - - /** - * Constructs a new InjectFaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IInjectFaultRequest); - - /** InjectFaultRequest faultType. */ - public faultType: (google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType); - - /** InjectFaultRequest name. */ - public name: string; - - /** InjectFaultRequest requestId. */ - public requestId: string; - - /** InjectFaultRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new InjectFaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InjectFaultRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IInjectFaultRequest): google.cloud.alloydb.v1alpha.InjectFaultRequest; - - /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. - * @param message InjectFaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. - * @param message InjectFaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.InjectFaultRequest; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.InjectFaultRequest; - - /** - * Verifies an InjectFaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InjectFaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.InjectFaultRequest; - - /** - * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. - * @param message InjectFaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InjectFaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InjectFaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InjectFaultRequest { - - /** FaultType enum. */ - enum FaultType { - FAULT_TYPE_UNSPECIFIED = 0, - STOP_VM = 1 - } - } - - /** Properties of a RestartInstanceRequest. */ - interface IRestartInstanceRequest { - - /** RestartInstanceRequest name */ - name?: (string|null); - - /** RestartInstanceRequest requestId */ - requestId?: (string|null); - - /** RestartInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** RestartInstanceRequest nodeIds */ - nodeIds?: (string[]|null); - } - - /** Represents a RestartInstanceRequest. */ - class RestartInstanceRequest implements IRestartInstanceRequest { - - /** - * Constructs a new RestartInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest); - - /** RestartInstanceRequest name. */ - public name: string; - - /** RestartInstanceRequest requestId. */ - public requestId: string; - - /** RestartInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** RestartInstanceRequest nodeIds. */ - public nodeIds: string[]; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestartInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IRestartInstanceRequest): google.cloud.alloydb.v1alpha.RestartInstanceRequest; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.RestartInstanceRequest; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.RestartInstanceRequest; - - /** - * Verifies a RestartInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestartInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.RestartInstanceRequest; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @param message RestartInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestartInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlRequest. */ - interface IExecuteSqlRequest { - - /** ExecuteSqlRequest password */ - password?: (string|null); - - /** ExecuteSqlRequest instance */ - instance?: (string|null); - - /** ExecuteSqlRequest database */ - database?: (string|null); - - /** ExecuteSqlRequest user */ - user?: (string|null); - - /** ExecuteSqlRequest sqlStatement */ - sqlStatement?: (string|null); - - /** ExecuteSqlRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an ExecuteSqlRequest. */ - class ExecuteSqlRequest implements IExecuteSqlRequest { - - /** - * Constructs a new ExecuteSqlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlRequest); - - /** ExecuteSqlRequest password. */ - public password?: (string|null); - - /** ExecuteSqlRequest instance. */ - public instance: string; - - /** ExecuteSqlRequest database. */ - public database: string; - - /** ExecuteSqlRequest user. */ - public user: string; - - /** ExecuteSqlRequest sqlStatement. */ - public sqlStatement: string; - - /** ExecuteSqlRequest validateOnly. */ - public validateOnly: boolean; - - /** ExecuteSqlRequest userCredential. */ - public userCredential?: "password"; - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlRequest): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; - - /** - * Verifies an ExecuteSqlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExecuteSqlRequest; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @param message ExecuteSqlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlResponse. */ - interface IExecuteSqlResponse { - - /** ExecuteSqlResponse sqlResults */ - sqlResults?: (google.cloud.alloydb.v1alpha.ISqlResult[]|null); - - /** ExecuteSqlResponse metadata */ - metadata?: (google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null); - } - - /** Represents an ExecuteSqlResponse. */ - class ExecuteSqlResponse implements IExecuteSqlResponse { - - /** - * Constructs a new ExecuteSqlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlResponse); - - /** ExecuteSqlResponse sqlResults. */ - public sqlResults: google.cloud.alloydb.v1alpha.ISqlResult[]; - - /** ExecuteSqlResponse metadata. */ - public metadata?: (google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null); - - /** - * Creates a new ExecuteSqlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlResponse): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; - - /** - * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. - * @param message ExecuteSqlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. - * @param message ExecuteSqlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; - - /** - * Verifies an ExecuteSqlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExecuteSqlResponse; - - /** - * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. - * @param message ExecuteSqlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExecuteSqlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlMetadata. */ - interface IExecuteSqlMetadata { - - /** ExecuteSqlMetadata message */ - message?: (string|null); - - /** ExecuteSqlMetadata partialResult */ - partialResult?: (boolean|null); - - /** ExecuteSqlMetadata sqlStatementExecutionDuration */ - sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); - - /** ExecuteSqlMetadata status */ - status?: (google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|null); - } - - /** Represents an ExecuteSqlMetadata. */ - class ExecuteSqlMetadata implements IExecuteSqlMetadata { - - /** - * Constructs a new ExecuteSqlMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata); - - /** ExecuteSqlMetadata message. */ - public message: string; - - /** ExecuteSqlMetadata partialResult. */ - public partialResult: boolean; - - /** ExecuteSqlMetadata sqlStatementExecutionDuration. */ - public sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); - - /** ExecuteSqlMetadata status. */ - public status: (google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status); - - /** - * Creates a new ExecuteSqlMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; - - /** - * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. - * @param message ExecuteSqlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. - * @param message ExecuteSqlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; - - /** - * Verifies an ExecuteSqlMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ExecuteSqlMetadata; - - /** - * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. - * @param message ExecuteSqlMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ExecuteSqlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteSqlMetadata { - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, - OK = 1, - PARTIAL = 2, - ERROR = 3 - } - } - - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { - - /** - * Constructs a new ListBackupsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; - - /** ListBackupsRequest pageToken. */ - public pageToken: string; - - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsRequest): google.cloud.alloydb.v1alpha.ListBackupsRequest; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsRequest; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsRequest; - - /** - * Verifies a ListBackupsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsRequest; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.cloud.alloydb.v1alpha.IBackup[]|null); - - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { - - /** - * Constructs a new ListBackupsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse); - - /** ListBackupsResponse backups. */ - public backups: google.cloud.alloydb.v1alpha.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListBackupsResponse): google.cloud.alloydb.v1alpha.ListBackupsResponse; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListBackupsResponse; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListBackupsResponse; - - /** - * Verifies a ListBackupsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListBackupsResponse; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { - - /** GetBackupRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { - - /** - * Constructs a new GetBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest); - - /** GetBackupRequest name. */ - public name: string; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetBackupRequest): google.cloud.alloydb.v1alpha.GetBackupRequest; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetBackupRequest; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetBackupRequest; - - /** - * Verifies a GetBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetBackupRequest; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { - - /** CreateBackupRequest parent */ - parent?: (string|null); - - /** CreateBackupRequest backupId */ - backupId?: (string|null); - - /** CreateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1alpha.IBackup|null); - - /** CreateBackupRequest requestId */ - requestId?: (string|null); - - /** CreateBackupRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { - - /** - * Constructs a new CreateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest); - - /** CreateBackupRequest parent. */ - public parent: string; - - /** CreateBackupRequest backupId. */ - public backupId: string; - - /** CreateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); - - /** CreateBackupRequest requestId. */ - public requestId: string; - - /** CreateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateBackupRequest): google.cloud.alloydb.v1alpha.CreateBackupRequest; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateBackupRequest; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateBackupRequest; - - /** - * Verifies a CreateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateBackupRequest; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1alpha.IBackup|null); - - /** UpdateBackupRequest requestId */ - requestId?: (string|null); - - /** UpdateBackupRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateBackupRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { - - /** - * Constructs a new UpdateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1alpha.IBackup|null); - - /** UpdateBackupRequest requestId. */ - public requestId: string; - - /** UpdateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateBackupRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateBackupRequest): google.cloud.alloydb.v1alpha.UpdateBackupRequest; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateBackupRequest; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateBackupRequest; - - /** - * Verifies an UpdateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateBackupRequest; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { - - /** DeleteBackupRequest name */ - name?: (string|null); - - /** DeleteBackupRequest requestId */ - requestId?: (string|null); - - /** DeleteBackupRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteBackupRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { - - /** - * Constructs a new DeleteBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** DeleteBackupRequest requestId. */ - public requestId: string; - - /** DeleteBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteBackupRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteBackupRequest): google.cloud.alloydb.v1alpha.DeleteBackupRequest; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteBackupRequest; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteBackupRequest; - - /** - * Verifies a DeleteBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteBackupRequest; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSupportedDatabaseFlagsRequest. */ - interface IListSupportedDatabaseFlagsRequest { - - /** ListSupportedDatabaseFlagsRequest parent */ - parent?: (string|null); - - /** ListSupportedDatabaseFlagsRequest pageSize */ - pageSize?: (number|null); - - /** ListSupportedDatabaseFlagsRequest pageToken */ - pageToken?: (string|null); - - /** ListSupportedDatabaseFlagsRequest scope */ - scope?: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null); - } - - /** Represents a ListSupportedDatabaseFlagsRequest. */ - class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { - - /** - * Constructs a new ListSupportedDatabaseFlagsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest); - - /** ListSupportedDatabaseFlagsRequest parent. */ - public parent: string; - - /** ListSupportedDatabaseFlagsRequest pageSize. */ - public pageSize: number; - - /** ListSupportedDatabaseFlagsRequest pageToken. */ - public pageToken: string; - - /** ListSupportedDatabaseFlagsRequest scope. */ - public scope: (google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope); - - /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; - - /** - * Verifies a ListSupportedDatabaseFlagsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSupportedDatabaseFlagsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSupportedDatabaseFlagsResponse. */ - interface IListSupportedDatabaseFlagsResponse { - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ - supportedDatabaseFlags?: (google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]|null); - - /** ListSupportedDatabaseFlagsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSupportedDatabaseFlagsResponse. */ - class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { - - /** - * Constructs a new ListSupportedDatabaseFlagsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse); - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ - public supportedDatabaseFlags: google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]; - - /** ListSupportedDatabaseFlagsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; - - /** - * Verifies a ListSupportedDatabaseFlagsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSupportedDatabaseFlagsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateClientCertificateRequest. */ - interface IGenerateClientCertificateRequest { - - /** GenerateClientCertificateRequest parent */ - parent?: (string|null); - - /** GenerateClientCertificateRequest requestId */ - requestId?: (string|null); - - /** GenerateClientCertificateRequest pemCsr */ - pemCsr?: (string|null); - - /** GenerateClientCertificateRequest certDuration */ - certDuration?: (google.protobuf.IDuration|null); - - /** GenerateClientCertificateRequest publicKey */ - publicKey?: (string|null); - - /** GenerateClientCertificateRequest useMetadataExchange */ - useMetadataExchange?: (boolean|null); - } - - /** Represents a GenerateClientCertificateRequest. */ - class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { - - /** - * Constructs a new GenerateClientCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest); - - /** GenerateClientCertificateRequest parent. */ - public parent: string; - - /** GenerateClientCertificateRequest requestId. */ - public requestId: string; - - /** GenerateClientCertificateRequest pemCsr. */ - public pemCsr: string; - - /** GenerateClientCertificateRequest certDuration. */ - public certDuration?: (google.protobuf.IDuration|null); - - /** GenerateClientCertificateRequest publicKey. */ - public publicKey: string; - - /** GenerateClientCertificateRequest useMetadataExchange. */ - public useMetadataExchange: boolean; - - /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateClientCertificateRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; - - /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; - - /** - * Verifies a GenerateClientCertificateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateClientCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest; - - /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @param message GenerateClientCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateClientCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateClientCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateClientCertificateResponse. */ - interface IGenerateClientCertificateResponse { - - /** GenerateClientCertificateResponse pemCertificate */ - pemCertificate?: (string|null); - - /** GenerateClientCertificateResponse pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** GenerateClientCertificateResponse caCert */ - caCert?: (string|null); - } - - /** Represents a GenerateClientCertificateResponse. */ - class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { - - /** - * Constructs a new GenerateClientCertificateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse); - - /** GenerateClientCertificateResponse pemCertificate. */ - public pemCertificate: string; - - /** GenerateClientCertificateResponse pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** GenerateClientCertificateResponse caCert. */ - public caCert: string; - - /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateClientCertificateResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; - - /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; - - /** - * Verifies a GenerateClientCertificateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateClientCertificateResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse; - - /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @param message GenerateClientCertificateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateClientCertificateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateClientCertificateResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetConnectionInfoRequest. */ - interface IGetConnectionInfoRequest { - - /** GetConnectionInfoRequest parent */ - parent?: (string|null); - - /** GetConnectionInfoRequest requestId */ - requestId?: (string|null); - } - - /** Represents a GetConnectionInfoRequest. */ - class GetConnectionInfoRequest implements IGetConnectionInfoRequest { - - /** - * Constructs a new GetConnectionInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest); - - /** GetConnectionInfoRequest parent. */ - public parent: string; - - /** GetConnectionInfoRequest requestId. */ - public requestId: string; - - /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetConnectionInfoRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; - - /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; - - /** - * Verifies a GetConnectionInfoRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetConnectionInfoRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetConnectionInfoRequest; - - /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @param message GetConnectionInfoRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetConnectionInfoRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetConnectionInfoRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata batchCreateInstancesMetadata */ - batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata promoteClusterStatus */ - promoteClusterStatus?: (google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null); - - /** OperationMetadata upgradeClusterStatus */ - upgradeClusterStatus?: (google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null); - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata); - - /** OperationMetadata batchCreateInstancesMetadata. */ - public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata promoteClusterStatus. */ - public promoteClusterStatus?: (google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null); - - /** OperationMetadata upgradeClusterStatus. */ - public upgradeClusterStatus?: (google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** OperationMetadata requestSpecific. */ - public requestSpecific?: ("batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"); - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IOperationMetadata): google.cloud.alloydb.v1alpha.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PromoteClusterStatus. */ - interface IPromoteClusterStatus { - - /** PromoteClusterStatus state */ - state?: (google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|null); - } - - /** Represents a PromoteClusterStatus. */ - class PromoteClusterStatus implements IPromoteClusterStatus { - - /** - * Constructs a new PromoteClusterStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterStatus); - - /** PromoteClusterStatus state. */ - public state: (google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1alpha.PromoteClusterStatus.State); - - /** - * Creates a new PromoteClusterStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns PromoteClusterStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IPromoteClusterStatus): google.cloud.alloydb.v1alpha.PromoteClusterStatus; - - /** - * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. - * @param message PromoteClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. - * @param message PromoteClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.PromoteClusterStatus; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.PromoteClusterStatus; - - /** - * Verifies a PromoteClusterStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromoteClusterStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.PromoteClusterStatus; - - /** - * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. - * @param message PromoteClusterStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.PromoteClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromoteClusterStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromoteClusterStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PromoteClusterStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PROMOTE_CLUSTER_AVAILABLE_FOR_READ = 1, - PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE = 2, - PROMOTE_CLUSTER_COMPLETED = 3 - } - } - - /** Properties of an UpgradeClusterStatus. */ - interface IUpgradeClusterStatus { - - /** UpgradeClusterStatus state */ - state?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); - - /** UpgradeClusterStatus cancellable */ - cancellable?: (boolean|null); - - /** UpgradeClusterStatus sourceVersion */ - sourceVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - - /** UpgradeClusterStatus targetVersion */ - targetVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); - - /** UpgradeClusterStatus stages */ - stages?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus[]|null); - } - - /** Represents an UpgradeClusterStatus. */ - class UpgradeClusterStatus implements IUpgradeClusterStatus { - - /** - * Constructs a new UpgradeClusterStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus); - - /** UpgradeClusterStatus state. */ - public state: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); - - /** UpgradeClusterStatus cancellable. */ - public cancellable: boolean; - - /** UpgradeClusterStatus sourceVersion. */ - public sourceVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** UpgradeClusterStatus targetVersion. */ - public targetVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); - - /** UpgradeClusterStatus stages. */ - public stages: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus[]; - - /** - * Creates a new UpgradeClusterStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; - - /** - * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. - * @param message UpgradeClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. - * @param message UpgradeClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; - - /** - * Verifies an UpgradeClusterStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus; - - /** - * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. - * @param message UpgradeClusterStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpgradeClusterStatus { - - /** Properties of a StageStatus. */ - interface IStageStatus { - - /** StageStatus readPoolInstancesUpgrade */ - readPoolInstancesUpgrade?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); - - /** StageStatus stage */ - stage?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null); - - /** StageStatus state */ - state?: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null); - - /** StageStatus schedule */ - schedule?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null); - } - - /** Represents a StageStatus. */ - class StageStatus implements IStageStatus { - - /** - * Constructs a new StageStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus); - - /** StageStatus readPoolInstancesUpgrade. */ - public readPoolInstancesUpgrade?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); - - /** StageStatus stage. */ - public stage: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage); - - /** StageStatus state. */ - public state: (google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status); - - /** StageStatus schedule. */ - public schedule?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null); - - /** StageStatus stageSpecificStatus. */ - public stageSpecificStatus?: "readPoolInstancesUpgrade"; - - /** - * Creates a new StageStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns StageStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; - - /** - * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @param message StageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @param message StageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; - - /** - * Decodes a StageStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; - - /** - * Verifies a StageStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus; - - /** - * Creates a plain object from a StageStatus message. Also converts values to other types if specified. - * @param message StageStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StageStatus { - - /** Properties of a StageSchedule. */ - interface IStageSchedule { - - /** StageSchedule estimatedStartTime */ - estimatedStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualStartTime */ - actualStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule estimatedEndTime */ - estimatedEndTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualEndTime */ - actualEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a StageSchedule. */ - class StageSchedule implements IStageSchedule { - - /** - * Constructs a new StageSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule); - - /** StageSchedule estimatedStartTime. */ - public estimatedStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualStartTime. */ - public actualStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule estimatedEndTime. */ - public estimatedEndTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualEndTime. */ - public actualEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new StageSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns StageSchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @param message StageSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @param message StageSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Decodes a StageSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Verifies a StageSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. - * @param message StageSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReadPoolInstancesUpgradeStageStatus. */ - interface IReadPoolInstancesUpgradeStageStatus { - - /** ReadPoolInstancesUpgradeStageStatus upgradeStats */ - upgradeStats?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); - } - - /** Represents a ReadPoolInstancesUpgradeStageStatus. */ - class ReadPoolInstancesUpgradeStageStatus implements IReadPoolInstancesUpgradeStageStatus { - - /** - * Constructs a new ReadPoolInstancesUpgradeStageStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus); - - /** ReadPoolInstancesUpgradeStageStatus upgradeStats. */ - public upgradeStats?: (google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); - - /** - * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolInstancesUpgradeStageStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Verifies a ReadPoolInstancesUpgradeStageStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolInstancesUpgradeStageStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. - * @param message ReadPoolInstancesUpgradeStageStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadPoolInstancesUpgradeStageStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadPoolInstancesUpgradeStageStatus { - - /** Properties of a Stats. */ - interface IStats { - - /** Stats notStarted */ - notStarted?: (number|null); - - /** Stats ongoing */ - ongoing?: (number|null); - - /** Stats success */ - success?: (number|null); - - /** Stats failed */ - failed?: (number|null); - } - - /** Represents a Stats. */ - class Stats implements IStats { - - /** - * Constructs a new Stats. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats); - - /** Stats notStarted. */ - public notStarted: number; - - /** Stats ongoing. */ - public ongoing: number; - - /** Stats success. */ - public success: number; - - /** Stats failed. */ - public failed: number; - - /** - * Creates a new Stats instance using the specified properties. - * @param [properties] Properties to set - * @returns Stats instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Verifies a Stats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Stats - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @param message Stats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Stats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Stats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a ListUsersRequest. */ - interface IListUsersRequest { - - /** ListUsersRequest parent */ - parent?: (string|null); - - /** ListUsersRequest pageSize */ - pageSize?: (number|null); - - /** ListUsersRequest pageToken */ - pageToken?: (string|null); - - /** ListUsersRequest filter */ - filter?: (string|null); - - /** ListUsersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListUsersRequest. */ - class ListUsersRequest implements IListUsersRequest { - - /** - * Constructs a new ListUsersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListUsersRequest); - - /** ListUsersRequest parent. */ - public parent: string; - - /** ListUsersRequest pageSize. */ - public pageSize: number; - - /** ListUsersRequest pageToken. */ - public pageToken: string; - - /** ListUsersRequest filter. */ - public filter: string; - - /** ListUsersRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListUsersRequest): google.cloud.alloydb.v1alpha.ListUsersRequest; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListUsersRequest; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListUsersRequest; - - /** - * Verifies a ListUsersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListUsersRequest; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @param message ListUsersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListUsersResponse. */ - interface IListUsersResponse { - - /** ListUsersResponse users */ - users?: (google.cloud.alloydb.v1alpha.IUser[]|null); - - /** ListUsersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListUsersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListUsersResponse. */ - class ListUsersResponse implements IListUsersResponse { - - /** - * Constructs a new ListUsersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListUsersResponse); - - /** ListUsersResponse users. */ - public users: google.cloud.alloydb.v1alpha.IUser[]; - - /** ListUsersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListUsersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListUsersResponse): google.cloud.alloydb.v1alpha.ListUsersResponse; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListUsersResponse; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListUsersResponse; - - /** - * Verifies a ListUsersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListUsersResponse; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @param message ListUsersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetUserRequest. */ - interface IGetUserRequest { - - /** GetUserRequest name */ - name?: (string|null); - } - - /** Represents a GetUserRequest. */ - class GetUserRequest implements IGetUserRequest { - - /** - * Constructs a new GetUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IGetUserRequest); - - /** GetUserRequest name. */ - public name: string; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IGetUserRequest): google.cloud.alloydb.v1alpha.GetUserRequest; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.GetUserRequest; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.GetUserRequest; - - /** - * Verifies a GetUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.GetUserRequest; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @param message GetUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateUserRequest. */ - interface ICreateUserRequest { - - /** CreateUserRequest parent */ - parent?: (string|null); - - /** CreateUserRequest userId */ - userId?: (string|null); - - /** CreateUserRequest user */ - user?: (google.cloud.alloydb.v1alpha.IUser|null); - - /** CreateUserRequest requestId */ - requestId?: (string|null); - - /** CreateUserRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateUserRequest. */ - class CreateUserRequest implements ICreateUserRequest { - - /** - * Constructs a new CreateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateUserRequest); - - /** CreateUserRequest parent. */ - public parent: string; - - /** CreateUserRequest userId. */ - public userId: string; - - /** CreateUserRequest user. */ - public user?: (google.cloud.alloydb.v1alpha.IUser|null); - - /** CreateUserRequest requestId. */ - public requestId: string; - - /** CreateUserRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateUserRequest): google.cloud.alloydb.v1alpha.CreateUserRequest; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateUserRequest; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateUserRequest; - - /** - * Verifies a CreateUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateUserRequest; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @param message CreateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateUserRequest. */ - interface IUpdateUserRequest { - - /** UpdateUserRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateUserRequest user */ - user?: (google.cloud.alloydb.v1alpha.IUser|null); - - /** UpdateUserRequest requestId */ - requestId?: (string|null); - - /** UpdateUserRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateUserRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateUserRequest. */ - class UpdateUserRequest implements IUpdateUserRequest { - - /** - * Constructs a new UpdateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IUpdateUserRequest); - - /** UpdateUserRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateUserRequest user. */ - public user?: (google.cloud.alloydb.v1alpha.IUser|null); - - /** UpdateUserRequest requestId. */ - public requestId: string; - - /** UpdateUserRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateUserRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IUpdateUserRequest): google.cloud.alloydb.v1alpha.UpdateUserRequest; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.UpdateUserRequest; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.UpdateUserRequest; - - /** - * Verifies an UpdateUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.UpdateUserRequest; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @param message UpdateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteUserRequest. */ - interface IDeleteUserRequest { - - /** DeleteUserRequest name */ - name?: (string|null); - - /** DeleteUserRequest requestId */ - requestId?: (string|null); - - /** DeleteUserRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteUserRequest. */ - class DeleteUserRequest implements IDeleteUserRequest { - - /** - * Constructs a new DeleteUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IDeleteUserRequest); - - /** DeleteUserRequest name. */ - public name: string; - - /** DeleteUserRequest requestId. */ - public requestId: string; - - /** DeleteUserRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IDeleteUserRequest): google.cloud.alloydb.v1alpha.DeleteUserRequest; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.DeleteUserRequest; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.DeleteUserRequest; - - /** - * Verifies a DeleteUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.DeleteUserRequest; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @param message DeleteUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesRequest. */ - interface IListDatabasesRequest { - - /** ListDatabasesRequest parent */ - parent?: (string|null); - - /** ListDatabasesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabasesRequest pageToken */ - pageToken?: (string|null); - - /** ListDatabasesRequest filter */ - filter?: (string|null); - } - - /** Represents a ListDatabasesRequest. */ - class ListDatabasesRequest implements IListDatabasesRequest { - - /** - * Constructs a new ListDatabasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListDatabasesRequest); - - /** ListDatabasesRequest parent. */ - public parent: string; - - /** ListDatabasesRequest pageSize. */ - public pageSize: number; - - /** ListDatabasesRequest pageToken. */ - public pageToken: string; - - /** ListDatabasesRequest filter. */ - public filter: string; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListDatabasesRequest): google.cloud.alloydb.v1alpha.ListDatabasesRequest; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListDatabasesRequest; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListDatabasesRequest; - - /** - * Verifies a ListDatabasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListDatabasesRequest; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @param message ListDatabasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesResponse. */ - interface IListDatabasesResponse { - - /** ListDatabasesResponse databases */ - databases?: (google.cloud.alloydb.v1alpha.IDatabase[]|null); - - /** ListDatabasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabasesResponse. */ - class ListDatabasesResponse implements IListDatabasesResponse { - - /** - * Constructs a new ListDatabasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.IListDatabasesResponse); - - /** ListDatabasesResponse databases. */ - public databases: google.cloud.alloydb.v1alpha.IDatabase[]; - - /** ListDatabasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.IListDatabasesResponse): google.cloud.alloydb.v1alpha.ListDatabasesResponse; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.ListDatabasesResponse; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.ListDatabasesResponse; - - /** - * Verifies a ListDatabasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.ListDatabasesResponse; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @param message ListDatabasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDatabaseRequest. */ - interface ICreateDatabaseRequest { - - /** CreateDatabaseRequest parent */ - parent?: (string|null); - - /** CreateDatabaseRequest databaseId */ - databaseId?: (string|null); - - /** CreateDatabaseRequest database */ - database?: (google.cloud.alloydb.v1alpha.IDatabase|null); - } - - /** Represents a CreateDatabaseRequest. */ - class CreateDatabaseRequest implements ICreateDatabaseRequest { - - /** - * Constructs a new CreateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest); - - /** CreateDatabaseRequest parent. */ - public parent: string; - - /** CreateDatabaseRequest databaseId. */ - public databaseId: string; - - /** CreateDatabaseRequest database. */ - public database?: (google.cloud.alloydb.v1alpha.IDatabase|null); - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDatabaseRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; - - /** - * Verifies a CreateDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.CreateDatabaseRequest; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @param message CreateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResult. */ - interface ISqlResult { - - /** SqlResult columns */ - columns?: (google.cloud.alloydb.v1alpha.ISqlResultColumn[]|null); - - /** SqlResult rows */ - rows?: (google.cloud.alloydb.v1alpha.ISqlResultRow[]|null); - } - - /** Represents a SqlResult. */ - class SqlResult implements ISqlResult { - - /** - * Constructs a new SqlResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResult); - - /** SqlResult columns. */ - public columns: google.cloud.alloydb.v1alpha.ISqlResultColumn[]; - - /** SqlResult rows. */ - public rows: google.cloud.alloydb.v1alpha.ISqlResultRow[]; - - /** - * Creates a new SqlResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResult instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResult): google.cloud.alloydb.v1alpha.SqlResult; - - /** - * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. - * @param message SqlResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. - * @param message SqlResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResult; - - /** - * Decodes a SqlResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResult; - - /** - * Verifies a SqlResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResult; - - /** - * Creates a plain object from a SqlResult message. Also converts values to other types if specified. - * @param message SqlResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SqlResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultColumn. */ - interface ISqlResultColumn { - - /** SqlResultColumn name */ - name?: (string|null); - - /** SqlResultColumn type */ - type?: (string|null); - } - - /** Represents a SqlResultColumn. */ - class SqlResultColumn implements ISqlResultColumn { - - /** - * Constructs a new SqlResultColumn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResultColumn); - - /** SqlResultColumn name. */ - public name: string; - - /** SqlResultColumn type. */ - public type: string; - - /** - * Creates a new SqlResultColumn instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultColumn instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResultColumn): google.cloud.alloydb.v1alpha.SqlResultColumn; - - /** - * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. - * @param message SqlResultColumn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. - * @param message SqlResultColumn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResultColumn; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResultColumn; - - /** - * Verifies a SqlResultColumn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultColumn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResultColumn; - - /** - * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. - * @param message SqlResultColumn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SqlResultColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultColumn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultColumn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultRow. */ - interface ISqlResultRow { - - /** SqlResultRow values */ - values?: (google.cloud.alloydb.v1alpha.ISqlResultValue[]|null); - } - - /** Represents a SqlResultRow. */ - class SqlResultRow implements ISqlResultRow { - - /** - * Constructs a new SqlResultRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResultRow); - - /** SqlResultRow values. */ - public values: google.cloud.alloydb.v1alpha.ISqlResultValue[]; - - /** - * Creates a new SqlResultRow instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultRow instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResultRow): google.cloud.alloydb.v1alpha.SqlResultRow; - - /** - * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. - * @param message SqlResultRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. - * @param message SqlResultRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResultRow; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResultRow; - - /** - * Verifies a SqlResultRow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResultRow; - - /** - * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. - * @param message SqlResultRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SqlResultRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultRow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultValue. */ - interface ISqlResultValue { - - /** SqlResultValue value */ - value?: (string|null); - - /** SqlResultValue nullValue */ - nullValue?: (boolean|null); - } - - /** Represents a SqlResultValue. */ - class SqlResultValue implements ISqlResultValue { - - /** - * Constructs a new SqlResultValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1alpha.ISqlResultValue); - - /** SqlResultValue value. */ - public value?: (string|null); - - /** SqlResultValue nullValue. */ - public nullValue?: (boolean|null); - - /** - * Creates a new SqlResultValue instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultValue instance - */ - public static create(properties?: google.cloud.alloydb.v1alpha.ISqlResultValue): google.cloud.alloydb.v1alpha.SqlResultValue; - - /** - * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. - * @param message SqlResultValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1alpha.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. - * @param message SqlResultValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1alpha.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.SqlResultValue; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.SqlResultValue; - - /** - * Verifies a SqlResultValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.SqlResultValue; - - /** - * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. - * @param message SqlResultValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1alpha.SqlResultValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v1beta. */ - namespace v1beta { - - /** Properties of a CloudSQLBackupRunSource. */ - interface ICloudSQLBackupRunSource { - - /** CloudSQLBackupRunSource project */ - project?: (string|null); - - /** CloudSQLBackupRunSource instanceId */ - instanceId?: (string|null); - - /** CloudSQLBackupRunSource backupRunId */ - backupRunId?: (number|Long|string|null); - } - - /** Represents a CloudSQLBackupRunSource. */ - class CloudSQLBackupRunSource implements ICloudSQLBackupRunSource { - - /** - * Constructs a new CloudSQLBackupRunSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource); - - /** CloudSQLBackupRunSource project. */ - public project: string; - - /** CloudSQLBackupRunSource instanceId. */ - public instanceId: string; - - /** CloudSQLBackupRunSource backupRunId. */ - public backupRunId: (number|Long|string); - - /** - * Creates a new CloudSQLBackupRunSource instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSQLBackupRunSource instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; - - /** - * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. - * @param message CloudSQLBackupRunSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. - * @param message CloudSQLBackupRunSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; - - /** - * Verifies a CloudSQLBackupRunSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSQLBackupRunSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CloudSQLBackupRunSource; - - /** - * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. - * @param message CloudSQLBackupRunSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CloudSQLBackupRunSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSQLBackupRunSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSQLBackupRunSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AlloyDBCSQLAdmin */ - class AlloyDBCSQLAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new AlloyDBCSQLAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBCSQLAdmin; - - /** - * Calls RestoreFromCloudSQL. - * @param request RestoreFromCloudSQLRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreFromCloudSQL(request: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, callback: google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback): void; - - /** - * Calls RestoreFromCloudSQL. - * @param request RestoreFromCloudSQLRequest message or plain object - * @returns Promise - */ - public restoreFromCloudSQL(request: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest): Promise; - } - - namespace AlloyDBCSQLAdmin { - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin|restoreFromCloudSQL}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreFromCloudSQLCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a RestoreFromCloudSQLRequest. */ - interface IRestoreFromCloudSQLRequest { - - /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource */ - cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); - - /** RestoreFromCloudSQLRequest parent */ - parent?: (string|null); - - /** RestoreFromCloudSQLRequest clusterId */ - clusterId?: (string|null); - - /** RestoreFromCloudSQLRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - } - - /** Represents a RestoreFromCloudSQLRequest. */ - class RestoreFromCloudSQLRequest implements IRestoreFromCloudSQLRequest { - - /** - * Constructs a new RestoreFromCloudSQLRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest); - - /** RestoreFromCloudSQLRequest cloudsqlBackupRunSource. */ - public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); - - /** RestoreFromCloudSQLRequest parent. */ - public parent: string; - - /** RestoreFromCloudSQLRequest clusterId. */ - public clusterId: string; - - /** RestoreFromCloudSQLRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** RestoreFromCloudSQLRequest source. */ - public source?: "cloudsqlBackupRunSource"; - - /** - * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreFromCloudSQLRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. - * @param message RestoreFromCloudSQLRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. - * @param message RestoreFromCloudSQLRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; - - /** - * Verifies a RestoreFromCloudSQLRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreFromCloudSQLRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest; - - /** - * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. - * @param message RestoreFromCloudSQLRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreFromCloudSQLRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreFromCloudSQLRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** InstanceView enum. */ - enum InstanceView { - INSTANCE_VIEW_UNSPECIFIED = 0, - INSTANCE_VIEW_BASIC = 1, - INSTANCE_VIEW_FULL = 2 - } - - /** ClusterView enum. */ - enum ClusterView { - CLUSTER_VIEW_UNSPECIFIED = 0, - CLUSTER_VIEW_BASIC = 1, - CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 - } - - /** DatabaseVersion enum. */ - enum DatabaseVersion { - DATABASE_VERSION_UNSPECIFIED = 0, - POSTGRES_13 = 1, - POSTGRES_14 = 2, - POSTGRES_15 = 3, - POSTGRES_16 = 4, - POSTGRES_17 = 5, - POSTGRES_18 = 6 - } - - /** SubscriptionType enum. */ - enum SubscriptionType { - SUBSCRIPTION_TYPE_UNSPECIFIED = 0, - STANDARD = 1, - TRIAL = 2 - } - - /** Properties of a UserPassword. */ - interface IUserPassword { - - /** UserPassword user */ - user?: (string|null); - - /** UserPassword password */ - password?: (string|null); - } - - /** Represents a UserPassword. */ - class UserPassword implements IUserPassword { - - /** - * Constructs a new UserPassword. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUserPassword); - - /** UserPassword user. */ - public user: string; - - /** UserPassword password. */ - public password: string; - - /** - * Creates a new UserPassword instance using the specified properties. - * @param [properties] Properties to set - * @returns UserPassword instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUserPassword): google.cloud.alloydb.v1beta.UserPassword; - - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. - * @param message UserPassword message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UserPassword; - - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UserPassword; - - /** - * Verifies a UserPassword message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserPassword - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UserPassword; - - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @param message UserPassword - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UserPassword to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UserPassword - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MigrationSource. */ - interface IMigrationSource { - - /** MigrationSource hostPort */ - hostPort?: (string|null); - - /** MigrationSource referenceId */ - referenceId?: (string|null); - - /** MigrationSource sourceType */ - sourceType?: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null); - } - - /** Represents a MigrationSource. */ - class MigrationSource implements IMigrationSource { - - /** - * Constructs a new MigrationSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IMigrationSource); - - /** MigrationSource hostPort. */ - public hostPort: string; - - /** MigrationSource referenceId. */ - public referenceId: string; - - /** MigrationSource sourceType. */ - public sourceType: (google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|keyof typeof google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType); - - /** - * Creates a new MigrationSource instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationSource instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IMigrationSource): google.cloud.alloydb.v1beta.MigrationSource; - - /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. - * @param message MigrationSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMigrationSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MigrationSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MigrationSource; - - /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MigrationSource; - - /** - * Verifies a MigrationSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MigrationSource; - - /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @param message MigrationSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.MigrationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MigrationSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MigrationSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MigrationSource { - - /** MigrationSourceType enum. */ - enum MigrationSourceType { - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0, - DMS = 1 - } - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig); - - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionConfig): google.cloud.alloydb.v1beta.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionInfo. */ - interface IEncryptionInfo { - - /** EncryptionInfo encryptionType */ - encryptionType?: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type|null); - - /** EncryptionInfo kmsKeyVersions */ - kmsKeyVersions?: (string[]|null); - } - - /** Represents an EncryptionInfo. */ - class EncryptionInfo implements IEncryptionInfo { - - /** - * Constructs a new EncryptionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo); - - /** EncryptionInfo encryptionType. */ - public encryptionType: (google.cloud.alloydb.v1beta.EncryptionInfo.Type|keyof typeof google.cloud.alloydb.v1beta.EncryptionInfo.Type); - - /** EncryptionInfo kmsKeyVersions. */ - public kmsKeyVersions: string[]; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IEncryptionInfo): google.cloud.alloydb.v1beta.EncryptionInfo; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @param message EncryptionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IEncryptionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.EncryptionInfo; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.EncryptionInfo; - - /** - * Verifies an EncryptionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.EncryptionInfo; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @param message EncryptionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.EncryptionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EncryptionInfo { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - GOOGLE_DEFAULT_ENCRYPTION = 1, - CUSTOMER_MANAGED_ENCRYPTION = 2 - } - } - - /** Properties of a SslConfig. */ - interface ISslConfig { - - /** SslConfig sslMode */ - sslMode?: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode|null); - - /** SslConfig caSource */ - caSource?: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource|null); - } - - /** Represents a SslConfig. */ - class SslConfig implements ISslConfig { - - /** - * Constructs a new SslConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISslConfig); - - /** SslConfig sslMode. */ - public sslMode: (google.cloud.alloydb.v1beta.SslConfig.SslMode|keyof typeof google.cloud.alloydb.v1beta.SslConfig.SslMode); - - /** SslConfig caSource. */ - public caSource: (google.cloud.alloydb.v1beta.SslConfig.CaSource|keyof typeof google.cloud.alloydb.v1beta.SslConfig.CaSource); - - /** - * Creates a new SslConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SslConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISslConfig): google.cloud.alloydb.v1beta.SslConfig; - - /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SslConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SslConfig; - - /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SslConfig; - - /** - * Verifies a SslConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SslConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SslConfig; - - /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @param message SslConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SslConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SslConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SslConfig { - - /** SslMode enum. */ - enum SslMode { - SSL_MODE_UNSPECIFIED = 0, - SSL_MODE_ALLOW = 1, - SSL_MODE_REQUIRE = 2, - SSL_MODE_VERIFY_CA = 3, - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4, - ENCRYPTED_ONLY = 5 - } - - /** CaSource enum. */ - enum CaSource { - CA_SOURCE_UNSPECIFIED = 0, - CA_SOURCE_MANAGED = 1 - } - } - - /** Properties of an AutomatedBackupPolicy. */ - interface IAutomatedBackupPolicy { - - /** AutomatedBackupPolicy weeklySchedule */ - weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention */ - timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention */ - quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled */ - enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow */ - backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location */ - location?: (string|null); - - /** AutomatedBackupPolicy labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents an AutomatedBackupPolicy. */ - class AutomatedBackupPolicy implements IAutomatedBackupPolicy { - - /** - * Constructs a new AutomatedBackupPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy); - - /** AutomatedBackupPolicy weeklySchedule. */ - public weeklySchedule?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null); - - /** AutomatedBackupPolicy timeBasedRetention. */ - public timeBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null); - - /** AutomatedBackupPolicy quantityBasedRetention. */ - public quantityBasedRetention?: (google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null); - - /** AutomatedBackupPolicy enabled. */ - public enabled?: (boolean|null); - - /** AutomatedBackupPolicy backupWindow. */ - public backupWindow?: (google.protobuf.IDuration|null); - - /** AutomatedBackupPolicy encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** AutomatedBackupPolicy location. */ - public location: string; - - /** AutomatedBackupPolicy labels. */ - public labels: { [k: string]: string }; - - /** AutomatedBackupPolicy schedule. */ - public schedule?: "weeklySchedule"; - - /** AutomatedBackupPolicy retention. */ - public retention?: ("timeBasedRetention"|"quantityBasedRetention"); - - /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AutomatedBackupPolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; - - /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. - * @param message AutomatedBackupPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IAutomatedBackupPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; - - /** - * Verifies an AutomatedBackupPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutomatedBackupPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy; - - /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @param message AutomatedBackupPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutomatedBackupPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutomatedBackupPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutomatedBackupPolicy { - - /** Properties of a WeeklySchedule. */ - interface IWeeklySchedule { - - /** WeeklySchedule startTimes */ - startTimes?: (google.type.ITimeOfDay[]|null); - - /** WeeklySchedule daysOfWeek */ - daysOfWeek?: (google.type.DayOfWeek[]|null); - } - - /** Represents a WeeklySchedule. */ - class WeeklySchedule implements IWeeklySchedule { - - /** - * Constructs a new WeeklySchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule); - - /** WeeklySchedule startTimes. */ - public startTimes: google.type.ITimeOfDay[]; - - /** WeeklySchedule daysOfWeek. */ - public daysOfWeek: google.type.DayOfWeek[]; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns WeeklySchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @param message WeeklySchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Verifies a WeeklySchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeeklySchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule; - - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @param message WeeklySchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeeklySchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WeeklySchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeBasedRetention. */ - interface ITimeBasedRetention { - - /** TimeBasedRetention retentionPeriod */ - retentionPeriod?: (google.protobuf.IDuration|null); - } - - /** Represents a TimeBasedRetention. */ - class TimeBasedRetention implements ITimeBasedRetention { - - /** - * Constructs a new TimeBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention); - - /** TimeBasedRetention retentionPeriod. */ - public retentionPeriod?: (google.protobuf.IDuration|null); - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @param message TimeBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Verifies a TimeBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @param message TimeBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QuantityBasedRetention. */ - interface IQuantityBasedRetention { - - /** QuantityBasedRetention count */ - count?: (number|null); - } - - /** Represents a QuantityBasedRetention. */ - class QuantityBasedRetention implements IQuantityBasedRetention { - - /** - * Constructs a new QuantityBasedRetention. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention); - - /** QuantityBasedRetention count. */ - public count: number; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedRetention instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @param message QuantityBasedRetention message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Verifies a QuantityBasedRetention message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedRetention - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @param message QuantityBasedRetention - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedRetention - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ContinuousBackupConfig. */ - interface IContinuousBackupConfig { - - /** ContinuousBackupConfig enabled */ - enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays */ - recoveryWindowDays?: (number|null); - - /** ContinuousBackupConfig encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - } - - /** Represents a ContinuousBackupConfig. */ - class ContinuousBackupConfig implements IContinuousBackupConfig { - - /** - * Constructs a new ContinuousBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig); - - /** ContinuousBackupConfig enabled. */ - public enabled?: (boolean|null); - - /** ContinuousBackupConfig recoveryWindowDays. */ - public recoveryWindowDays: number; - - /** ContinuousBackupConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupConfig): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. - * @param message ContinuousBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Verifies a ContinuousBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupConfig; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @param message ContinuousBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContinuousBackupInfo. */ - interface IContinuousBackupInfo { - - /** ContinuousBackupInfo encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime */ - enabledTime?: (google.protobuf.ITimestamp|null); - - /** ContinuousBackupInfo schedule */ - schedule?: (google.type.DayOfWeek[]|null); - - /** ContinuousBackupInfo earliestRestorableTime */ - earliestRestorableTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ContinuousBackupInfo. */ - class ContinuousBackupInfo implements IContinuousBackupInfo { - - /** - * Constructs a new ContinuousBackupInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo); - - /** ContinuousBackupInfo encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** ContinuousBackupInfo enabledTime. */ - public enabledTime?: (google.protobuf.ITimestamp|null); - - /** ContinuousBackupInfo schedule. */ - public schedule: google.type.DayOfWeek[]; - - /** ContinuousBackupInfo earliestRestorableTime. */ - public earliestRestorableTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupInfo): google.cloud.alloydb.v1beta.ContinuousBackupInfo; - - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. - * @param message ContinuousBackupInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupInfo; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupInfo; - - /** - * Verifies a ContinuousBackupInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupInfo; - - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @param message ContinuousBackupInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupSource. */ - interface IBackupSource { - - /** BackupSource backupUid */ - backupUid?: (string|null); - - /** BackupSource backupName */ - backupName?: (string|null); - } - - /** Represents a BackupSource. */ - class BackupSource implements IBackupSource { - - /** - * Constructs a new BackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IBackupSource); - - /** BackupSource backupUid. */ - public backupUid: string; - - /** BackupSource backupName. */ - public backupName: string; - - /** - * Creates a new BackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBackupSource): google.cloud.alloydb.v1beta.BackupSource; - - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. - * @param message BackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BackupSource; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BackupSource; - - /** - * Verifies a BackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BackupSource; - - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @param message BackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.BackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContinuousBackupSource. */ - interface IContinuousBackupSource { - - /** ContinuousBackupSource cluster */ - cluster?: (string|null); - - /** ContinuousBackupSource pointInTime */ - pointInTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ContinuousBackupSource. */ - class ContinuousBackupSource implements IContinuousBackupSource { - - /** - * Constructs a new ContinuousBackupSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource); - - /** ContinuousBackupSource cluster. */ - public cluster: string; - - /** ContinuousBackupSource pointInTime. */ - public pointInTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ContinuousBackupSource instance using the specified properties. - * @param [properties] Properties to set - * @returns ContinuousBackupSource instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IContinuousBackupSource): google.cloud.alloydb.v1beta.ContinuousBackupSource; - - /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. - * @param message ContinuousBackupSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IContinuousBackupSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ContinuousBackupSource; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ContinuousBackupSource; - - /** - * Verifies a ContinuousBackupSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContinuousBackupSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ContinuousBackupSource; - - /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @param message ContinuousBackupSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ContinuousBackupSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContinuousBackupSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContinuousBackupSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MaintenanceUpdatePolicy. */ - interface IMaintenanceUpdatePolicy { - - /** MaintenanceUpdatePolicy maintenanceWindows */ - maintenanceWindows?: (google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow[]|null); - - /** MaintenanceUpdatePolicy denyMaintenancePeriods */ - denyMaintenancePeriods?: (google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]|null); - } - - /** Represents a MaintenanceUpdatePolicy. */ - class MaintenanceUpdatePolicy implements IMaintenanceUpdatePolicy { - - /** - * Constructs a new MaintenanceUpdatePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy); - - /** MaintenanceUpdatePolicy maintenanceWindows. */ - public maintenanceWindows: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow[]; - - /** MaintenanceUpdatePolicy denyMaintenancePeriods. */ - public denyMaintenancePeriods: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod[]; - - /** - * Creates a new MaintenanceUpdatePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceUpdatePolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; - - /** - * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. - * @param message MaintenanceUpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. - * @param message MaintenanceUpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; - - /** - * Verifies a MaintenanceUpdatePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceUpdatePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy; - - /** - * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. - * @param message MaintenanceUpdatePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceUpdatePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceUpdatePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MaintenanceUpdatePolicy { - - /** Properties of a MaintenanceWindow. */ - interface IMaintenanceWindow { - - /** MaintenanceWindow day */ - day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); - - /** MaintenanceWindow startTime */ - startTime?: (google.type.ITimeOfDay|null); - } - - /** Represents a MaintenanceWindow. */ - class MaintenanceWindow implements IMaintenanceWindow { - - /** - * Constructs a new MaintenanceWindow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow); - - /** MaintenanceWindow day. */ - public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); - - /** MaintenanceWindow startTime. */ - public startTime?: (google.type.ITimeOfDay|null); - - /** - * Creates a new MaintenanceWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceWindow instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Verifies a MaintenanceWindow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceWindow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow; - - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @param message MaintenanceWindow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceWindow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DenyMaintenancePeriod. */ - interface IDenyMaintenancePeriod { - - /** DenyMaintenancePeriod startDate */ - startDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod endDate */ - endDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod time */ - time?: (google.type.ITimeOfDay|null); - } - - /** Represents a DenyMaintenancePeriod. */ - class DenyMaintenancePeriod implements IDenyMaintenancePeriod { - - /** - * Constructs a new DenyMaintenancePeriod. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod); - - /** DenyMaintenancePeriod startDate. */ - public startDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod endDate. */ - public endDate?: (google.type.IDate|null); - - /** DenyMaintenancePeriod time. */ - public time?: (google.type.ITimeOfDay|null); - - /** - * Creates a new DenyMaintenancePeriod instance using the specified properties. - * @param [properties] Properties to set - * @returns DenyMaintenancePeriod instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @param message DenyMaintenancePeriod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @param message DenyMaintenancePeriod message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Verifies a DenyMaintenancePeriod message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DenyMaintenancePeriod - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod; - - /** - * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. - * @param message DenyMaintenancePeriod - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DenyMaintenancePeriod to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DenyMaintenancePeriod - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a MaintenanceSchedule. */ - interface IMaintenanceSchedule { - - /** MaintenanceSchedule startTime */ - startTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a MaintenanceSchedule. */ - class MaintenanceSchedule implements IMaintenanceSchedule { - - /** - * Constructs a new MaintenanceSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IMaintenanceSchedule); - - /** MaintenanceSchedule startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new MaintenanceSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns MaintenanceSchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IMaintenanceSchedule): google.cloud.alloydb.v1beta.MaintenanceSchedule; - - /** - * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. - * @param message MaintenanceSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. - * @param message MaintenanceSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.MaintenanceSchedule; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.MaintenanceSchedule; - - /** - * Verifies a MaintenanceSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MaintenanceSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.MaintenanceSchedule; - - /** - * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. - * @param message MaintenanceSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MaintenanceSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MaintenanceSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Cluster. */ - interface ICluster { - - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); - - /** Cluster cloudsqlBackupRunSource */ - cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); - - /** Cluster name */ - name?: (string|null); - - /** Cluster displayName */ - displayName?: (string|null); - - /** Cluster uid */ - uid?: (string|null); - - /** Cluster createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels */ - labels?: ({ [k: string]: string }|null); - - /** Cluster state */ - state?: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State|null); - - /** Cluster clusterType */ - clusterType?: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType|null); - - /** Cluster databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); - - /** Cluster networkConfig */ - networkConfig?: (google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null); - - /** Cluster network */ - network?: (string|null); - - /** Cluster etag */ - etag?: (string|null); - - /** Cluster annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Cluster reconciling */ - reconciling?: (boolean|null); - - /** Cluster initialUser */ - initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); - - /** Cluster automatedBackupPolicy */ - automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig */ - sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); - - /** Cluster encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** Cluster encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig */ - continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo */ - continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig */ - secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig */ - primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); - - /** Cluster satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Cluster pscConfig */ - pscConfig?: (google.cloud.alloydb.v1beta.Cluster.IPscConfig|null); - - /** Cluster maintenanceUpdatePolicy */ - maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule */ - maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); - - /** Cluster geminiConfig */ - geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiClusterConfig|null); - - /** Cluster subscriptionType */ - subscriptionType?: (google.cloud.alloydb.v1beta.SubscriptionType|keyof typeof google.cloud.alloydb.v1beta.SubscriptionType|null); - - /** Cluster trialMetadata */ - trialMetadata?: (google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null); - - /** Cluster tags */ - tags?: ({ [k: string]: string }|null); - - /** Cluster serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** Cluster dataplexConfig */ - dataplexConfig?: (google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null); - } - - /** Represents a Cluster. */ - class Cluster implements ICluster { - - /** - * Constructs a new Cluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICluster); - - /** Cluster backupSource. */ - public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** Cluster migrationSource. */ - public migrationSource?: (google.cloud.alloydb.v1beta.IMigrationSource|null); - - /** Cluster cloudsqlBackupRunSource. */ - public cloudsqlBackupRunSource?: (google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null); - - /** Cluster name. */ - public name: string; - - /** Cluster displayName. */ - public displayName: string; - - /** Cluster uid. */ - public uid: string; - - /** Cluster createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Cluster updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Cluster deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Cluster labels. */ - public labels: { [k: string]: string }; - - /** Cluster state. */ - public state: (google.cloud.alloydb.v1beta.Cluster.State|keyof typeof google.cloud.alloydb.v1beta.Cluster.State); - - /** Cluster clusterType. */ - public clusterType: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType); - - /** Cluster databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); - - /** Cluster networkConfig. */ - public networkConfig?: (google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null); - - /** Cluster network. */ - public network: string; - - /** Cluster etag. */ - public etag: string; - - /** Cluster annotations. */ - public annotations: { [k: string]: string }; - - /** Cluster reconciling. */ - public reconciling: boolean; - - /** Cluster initialUser. */ - public initialUser?: (google.cloud.alloydb.v1beta.IUserPassword|null); - - /** Cluster automatedBackupPolicy. */ - public automatedBackupPolicy?: (google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null); - - /** Cluster sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); - - /** Cluster encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** Cluster encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** Cluster continuousBackupConfig. */ - public continuousBackupConfig?: (google.cloud.alloydb.v1beta.IContinuousBackupConfig|null); - - /** Cluster continuousBackupInfo. */ - public continuousBackupInfo?: (google.cloud.alloydb.v1beta.IContinuousBackupInfo|null); - - /** Cluster secondaryConfig. */ - public secondaryConfig?: (google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null); - - /** Cluster primaryConfig. */ - public primaryConfig?: (google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null); - - /** Cluster satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Cluster pscConfig. */ - public pscConfig?: (google.cloud.alloydb.v1beta.Cluster.IPscConfig|null); - - /** Cluster maintenanceUpdatePolicy. */ - public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule. */ - public maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); - - /** Cluster geminiConfig. */ - public geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiClusterConfig|null); - - /** Cluster subscriptionType. */ - public subscriptionType: (google.cloud.alloydb.v1beta.SubscriptionType|keyof typeof google.cloud.alloydb.v1beta.SubscriptionType); - - /** Cluster trialMetadata. */ - public trialMetadata?: (google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null); - - /** Cluster tags. */ - public tags: { [k: string]: string }; - - /** Cluster serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** Cluster dataplexConfig. */ - public dataplexConfig?: (google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null); - - /** Cluster source. */ - public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); - - /** - * Creates a new Cluster instance using the specified properties. - * @param [properties] Properties to set - * @returns Cluster instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICluster): google.cloud.alloydb.v1beta.Cluster; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster; - - /** - * Verifies a Cluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cluster - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @param message Cluster - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cluster to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Cluster - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Cluster { - - /** Properties of a NetworkConfig. */ - interface INetworkConfig { - - /** NetworkConfig network */ - network?: (string|null); - - /** NetworkConfig allocatedIpRange */ - allocatedIpRange?: (string|null); - } - - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { - - /** - * Constructs a new NetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.INetworkConfig); - - /** NetworkConfig network. */ - public network: string; - - /** NetworkConfig allocatedIpRange. */ - public allocatedIpRange: string; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.INetworkConfig): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; - - /** - * Verifies a NetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.NetworkConfig; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @param message NetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecondaryConfig. */ - interface ISecondaryConfig { - - /** SecondaryConfig primaryClusterName */ - primaryClusterName?: (string|null); - } - - /** Represents a SecondaryConfig. */ - class SecondaryConfig implements ISecondaryConfig { - - /** - * Constructs a new SecondaryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig); - - /** SecondaryConfig primaryClusterName. */ - public primaryClusterName: string; - - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SecondaryConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; - - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. - * @param message SecondaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; - - /** - * Verifies a SecondaryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecondaryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.SecondaryConfig; - - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @param message SecondaryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.SecondaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecondaryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecondaryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PrimaryConfig. */ - interface IPrimaryConfig { - - /** PrimaryConfig secondaryClusterNames */ - secondaryClusterNames?: (string[]|null); - } - - /** Represents a PrimaryConfig. */ - class PrimaryConfig implements IPrimaryConfig { - - /** - * Constructs a new PrimaryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig); - - /** PrimaryConfig secondaryClusterNames. */ - public secondaryClusterNames: string[]; - - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PrimaryConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; - - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. - * @param message PrimaryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; - - /** - * Verifies a PrimaryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrimaryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.PrimaryConfig; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @param message PrimaryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.PrimaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PrimaryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PrimaryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscConfig. */ - interface IPscConfig { - - /** PscConfig pscEnabled */ - pscEnabled?: (boolean|null); - - /** PscConfig serviceOwnedProjectNumber */ - serviceOwnedProjectNumber?: (number|Long|string|null); - } - - /** Represents a PscConfig. */ - class PscConfig implements IPscConfig { - - /** - * Constructs a new PscConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IPscConfig); - - /** PscConfig pscEnabled. */ - public pscEnabled: boolean; - - /** PscConfig serviceOwnedProjectNumber. */ - public serviceOwnedProjectNumber: (number|Long|string); - - /** - * Creates a new PscConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IPscConfig): google.cloud.alloydb.v1beta.Cluster.PscConfig; - - /** - * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. - * @param message PscConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. - * @param message PscConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IPscConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.PscConfig; - - /** - * Decodes a PscConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.PscConfig; - - /** - * Verifies a PscConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.PscConfig; - - /** - * Creates a plain object from a PscConfig message. Also converts values to other types if specified. - * @param message PscConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.PscConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrialMetadata. */ - interface ITrialMetadata { - - /** TrialMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata upgradeTime */ - upgradeTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata graceEndTime */ - graceEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TrialMetadata. */ - class TrialMetadata implements ITrialMetadata { - - /** - * Constructs a new TrialMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata); - - /** TrialMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata upgradeTime. */ - public upgradeTime?: (google.protobuf.ITimestamp|null); - - /** TrialMetadata graceEndTime. */ - public graceEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TrialMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns TrialMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; - - /** - * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. - * @param message TrialMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. - * @param message TrialMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.ITrialMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; - - /** - * Verifies a TrialMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrialMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.TrialMetadata; - - /** - * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. - * @param message TrialMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.TrialMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrialMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrialMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataplexConfig. */ - interface IDataplexConfig { - - /** DataplexConfig enabled */ - enabled?: (boolean|null); - } - - /** Represents a DataplexConfig. */ - class DataplexConfig implements IDataplexConfig { - - /** - * Constructs a new DataplexConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig); - - /** DataplexConfig enabled. */ - public enabled: boolean; - - /** - * Creates a new DataplexConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DataplexConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; - - /** - * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. - * @param message DataplexConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. - * @param message DataplexConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; - - /** - * Verifies a DataplexConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataplexConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; - - /** - * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. - * @param message DataplexConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataplexConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataplexConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - EMPTY = 3, - CREATING = 4, - DELETING = 5, - FAILED = 6, - BOOTSTRAPPING = 7, - MAINTENANCE = 8, - PROMOTING = 9 - } - - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - SECONDARY = 2 - } - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance displayName */ - displayName?: (string|null); - - /** Instance uid */ - uid?: (string|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance state */ - state?: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State|null); - - /** Instance instanceType */ - instanceType?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); - - /** Instance machineConfig */ - machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); - - /** Instance availabilityType */ - availabilityType?: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType|null); - - /** Instance gceZone */ - gceZone?: (string|null); - - /** Instance databaseFlags */ - databaseFlags?: ({ [k: string]: string }|null); - - /** Instance writableNode */ - writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); - - /** Instance nodes */ - nodes?: (google.cloud.alloydb.v1beta.Instance.INode[]|null); - - /** Instance queryInsightsConfig */ - queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); - - /** Instance observabilityConfig */ - observabilityConfig?: (google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null); - - /** Instance readPoolConfig */ - readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); - - /** Instance ipAddress */ - ipAddress?: (string|null); - - /** Instance publicIpAddress */ - publicIpAddress?: (string|null); - - /** Instance reconciling */ - reconciling?: (boolean|null); - - /** Instance etag */ - etag?: (string|null); - - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Instance updatePolicy */ - updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); - - /** Instance clientConnectionConfig */ - clientConnectionConfig?: (google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null); - - /** Instance satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Instance pscInstanceConfig */ - pscInstanceConfig?: (google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null); - - /** Instance networkConfig */ - networkConfig?: (google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null); - - /** Instance geminiConfig */ - geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null); - - /** Instance outboundPublicIpAddresses */ - outboundPublicIpAddresses?: (string[]|null); - - /** Instance activationPolicy */ - activationPolicy?: (google.cloud.alloydb.v1beta.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1beta.Instance.ActivationPolicy|null); - - /** Instance connectionPoolConfig */ - connectionPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null); - - /** Instance gcaConfig */ - gcaConfig?: (google.cloud.alloydb.v1beta.IGCAInstanceConfig|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance displayName. */ - public displayName: string; - - /** Instance uid. */ - public uid: string; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance state. */ - public state: (google.cloud.alloydb.v1beta.Instance.State|keyof typeof google.cloud.alloydb.v1beta.Instance.State); - - /** Instance instanceType. */ - public instanceType: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); - - /** Instance machineConfig. */ - public machineConfig?: (google.cloud.alloydb.v1beta.Instance.IMachineConfig|null); - - /** Instance availabilityType. */ - public availabilityType: (google.cloud.alloydb.v1beta.Instance.AvailabilityType|keyof typeof google.cloud.alloydb.v1beta.Instance.AvailabilityType); - - /** Instance gceZone. */ - public gceZone: string; - - /** Instance databaseFlags. */ - public databaseFlags: { [k: string]: string }; - - /** Instance writableNode. */ - public writableNode?: (google.cloud.alloydb.v1beta.Instance.INode|null); - - /** Instance nodes. */ - public nodes: google.cloud.alloydb.v1beta.Instance.INode[]; - - /** Instance queryInsightsConfig. */ - public queryInsightsConfig?: (google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null); - - /** Instance observabilityConfig. */ - public observabilityConfig?: (google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null); - - /** Instance readPoolConfig. */ - public readPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null); - - /** Instance ipAddress. */ - public ipAddress: string; - - /** Instance publicIpAddress. */ - public publicIpAddress: string; - - /** Instance reconciling. */ - public reconciling: boolean; - - /** Instance etag. */ - public etag: string; - - /** Instance annotations. */ - public annotations: { [k: string]: string }; - - /** Instance updatePolicy. */ - public updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); - - /** Instance clientConnectionConfig. */ - public clientConnectionConfig?: (google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null); - - /** Instance satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Instance pscInstanceConfig. */ - public pscInstanceConfig?: (google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null); - - /** Instance networkConfig. */ - public networkConfig?: (google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null); - - /** Instance geminiConfig. */ - public geminiConfig?: (google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null); - - /** Instance outboundPublicIpAddresses. */ - public outboundPublicIpAddresses: string[]; - - /** Instance activationPolicy. */ - public activationPolicy: (google.cloud.alloydb.v1beta.Instance.ActivationPolicy|keyof typeof google.cloud.alloydb.v1beta.Instance.ActivationPolicy); - - /** Instance connectionPoolConfig. */ - public connectionPoolConfig?: (google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null); - - /** Instance gcaConfig. */ - public gcaConfig?: (google.cloud.alloydb.v1beta.IGCAInstanceConfig|null); - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IInstance): google.cloud.alloydb.v1beta.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Instance { - - /** Properties of a MachineConfig. */ - interface IMachineConfig { - - /** MachineConfig cpuCount */ - cpuCount?: (number|null); - - /** MachineConfig machineType */ - machineType?: (string|null); - } - - /** Represents a MachineConfig. */ - class MachineConfig implements IMachineConfig { - - /** - * Constructs a new MachineConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig); - - /** MachineConfig cpuCount. */ - public cpuCount: number; - - /** MachineConfig machineType. */ - public machineType: string; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MachineConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IMachineConfig): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @param message MachineConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Verifies a MachineConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MachineConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.MachineConfig; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @param message MachineConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MachineConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MachineConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Node. */ - interface INode { - - /** Node zoneId */ - zoneId?: (string|null); - - /** Node id */ - id?: (string|null); - - /** Node ip */ - ip?: (string|null); - - /** Node state */ - state?: (string|null); - } - - /** Represents a Node. */ - class Node implements INode { - - /** - * Constructs a new Node. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.INode); - - /** Node zoneId. */ - public zoneId: string; - - /** Node id. */ - public id: string; - - /** Node ip. */ - public ip: string; - - /** Node state. */ - public state: string; - - /** - * Creates a new Node instance using the specified properties. - * @param [properties] Properties to set - * @returns Node instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.INode): google.cloud.alloydb.v1beta.Instance.Node; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @param message Node message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Node message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.Node; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.Node; - - /** - * Verifies a Node message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Node - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.Node; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @param message Node - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Node to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Node - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryInsightsInstanceConfig. */ - interface IQueryInsightsInstanceConfig { - - /** QueryInsightsInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress */ - recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength */ - queryStringLength?: (number|null); - - /** QueryInsightsInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - } - - /** Represents a QueryInsightsInstanceConfig. */ - class QueryInsightsInstanceConfig implements IQueryInsightsInstanceConfig { - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig); - - /** QueryInsightsInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** QueryInsightsInstanceConfig recordClientAddress. */ - public recordClientAddress?: (boolean|null); - - /** QueryInsightsInstanceConfig queryStringLength. */ - public queryStringLength: number; - - /** QueryInsightsInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryInsightsInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @param message QueryInsightsInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - - /** - * Verifies a QueryInsightsInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInsightsInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @param message QueryInsightsInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ObservabilityInstanceConfig. */ - interface IObservabilityInstanceConfig { - - /** ObservabilityInstanceConfig enabled */ - enabled?: (boolean|null); - - /** ObservabilityInstanceConfig preserveComments */ - preserveComments?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEvents */ - trackWaitEvents?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEventTypes */ - trackWaitEventTypes?: (boolean|null); - - /** ObservabilityInstanceConfig maxQueryStringLength */ - maxQueryStringLength?: (number|null); - - /** ObservabilityInstanceConfig recordApplicationTags */ - recordApplicationTags?: (boolean|null); - - /** ObservabilityInstanceConfig queryPlansPerMinute */ - queryPlansPerMinute?: (number|null); - - /** ObservabilityInstanceConfig trackActiveQueries */ - trackActiveQueries?: (boolean|null); - - /** ObservabilityInstanceConfig trackClientAddress */ - trackClientAddress?: (boolean|null); - - /** ObservabilityInstanceConfig assistiveExperiencesEnabled */ - assistiveExperiencesEnabled?: (boolean|null); - } - - /** Represents an ObservabilityInstanceConfig. */ - class ObservabilityInstanceConfig implements IObservabilityInstanceConfig { - - /** - * Constructs a new ObservabilityInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig); - - /** ObservabilityInstanceConfig enabled. */ - public enabled?: (boolean|null); - - /** ObservabilityInstanceConfig preserveComments. */ - public preserveComments?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEvents. */ - public trackWaitEvents?: (boolean|null); - - /** ObservabilityInstanceConfig trackWaitEventTypes. */ - public trackWaitEventTypes?: (boolean|null); - - /** ObservabilityInstanceConfig maxQueryStringLength. */ - public maxQueryStringLength?: (number|null); - - /** ObservabilityInstanceConfig recordApplicationTags. */ - public recordApplicationTags?: (boolean|null); - - /** ObservabilityInstanceConfig queryPlansPerMinute. */ - public queryPlansPerMinute?: (number|null); - - /** ObservabilityInstanceConfig trackActiveQueries. */ - public trackActiveQueries?: (boolean|null); - - /** ObservabilityInstanceConfig trackClientAddress. */ - public trackClientAddress?: (boolean|null); - - /** ObservabilityInstanceConfig assistiveExperiencesEnabled. */ - public assistiveExperiencesEnabled?: (boolean|null); - - /** - * Creates a new ObservabilityInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ObservabilityInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; - - /** - * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @param message ObservabilityInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @param message ObservabilityInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; - - /** - * Verifies an ObservabilityInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObservabilityInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig; - - /** - * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. - * @param message ObservabilityInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObservabilityInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ObservabilityInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadPoolConfig. */ - interface IReadPoolConfig { - - /** ReadPoolConfig nodeCount */ - nodeCount?: (number|null); - } - - /** Represents a ReadPoolConfig. */ - class ReadPoolConfig implements IReadPoolConfig { - - /** - * Constructs a new ReadPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig); - - /** ReadPoolConfig nodeCount. */ - public nodeCount: number; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. - * @param message ReadPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IReadPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; - - /** - * Verifies a ReadPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ReadPoolConfig; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @param message ReadPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.ReadPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdatePolicy. */ - interface IUpdatePolicy { - - /** UpdatePolicy mode */ - mode?: (google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|null); - } - - /** Represents an UpdatePolicy. */ - class UpdatePolicy implements IUpdatePolicy { - - /** - * Constructs a new UpdatePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy); - - /** UpdatePolicy mode. */ - public mode: (google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|keyof typeof google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode); - - /** - * Creates a new UpdatePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdatePolicy instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; - - /** - * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. - * @param message UpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. - * @param message UpdatePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; - - /** - * Verifies an UpdatePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdatePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.UpdatePolicy; - - /** - * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. - * @param message UpdatePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.UpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdatePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdatePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpdatePolicy { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - DEFAULT = 1, - FORCE_APPLY = 2 - } - } - - /** Properties of a ClientConnectionConfig. */ - interface IClientConnectionConfig { - - /** ClientConnectionConfig requireConnectors */ - requireConnectors?: (boolean|null); - - /** ClientConnectionConfig sslConfig */ - sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); - } - - /** Represents a ClientConnectionConfig. */ - class ClientConnectionConfig implements IClientConnectionConfig { - - /** - * Constructs a new ClientConnectionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig); - - /** ClientConnectionConfig requireConnectors. */ - public requireConnectors: boolean; - - /** ClientConnectionConfig sslConfig. */ - public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); - - /** - * Creates a new ClientConnectionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientConnectionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; - - /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; - - /** - * Verifies a ClientConnectionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientConnectionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; - - /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @param message ClientConnectionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientConnectionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientConnectionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscInterfaceConfig. */ - interface IPscInterfaceConfig { - - /** PscInterfaceConfig networkAttachmentResource */ - networkAttachmentResource?: (string|null); - } - - /** Represents a PscInterfaceConfig. */ - class PscInterfaceConfig implements IPscInterfaceConfig { - - /** - * Constructs a new PscInterfaceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig); - - /** PscInterfaceConfig networkAttachmentResource. */ - public networkAttachmentResource: string; - - /** - * Creates a new PscInterfaceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscInterfaceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; - - /** - * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. - * @param message PscInterfaceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. - * @param message PscInterfaceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; - - /** - * Verifies a PscInterfaceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscInterfaceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig; - - /** - * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. - * @param message PscInterfaceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscInterfaceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscInterfaceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscAutoConnectionConfig. */ - interface IPscAutoConnectionConfig { - - /** PscAutoConnectionConfig consumerProject */ - consumerProject?: (string|null); - - /** PscAutoConnectionConfig consumerNetwork */ - consumerNetwork?: (string|null); - - /** PscAutoConnectionConfig ipAddress */ - ipAddress?: (string|null); - - /** PscAutoConnectionConfig status */ - status?: (string|null); - - /** PscAutoConnectionConfig consumerNetworkStatus */ - consumerNetworkStatus?: (string|null); - } - - /** Represents a PscAutoConnectionConfig. */ - class PscAutoConnectionConfig implements IPscAutoConnectionConfig { - - /** - * Constructs a new PscAutoConnectionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig); - - /** PscAutoConnectionConfig consumerProject. */ - public consumerProject: string; - - /** PscAutoConnectionConfig consumerNetwork. */ - public consumerNetwork: string; - - /** PscAutoConnectionConfig ipAddress. */ - public ipAddress: string; - - /** PscAutoConnectionConfig status. */ - public status: string; - - /** PscAutoConnectionConfig consumerNetworkStatus. */ - public consumerNetworkStatus: string; - - /** - * Creates a new PscAutoConnectionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscAutoConnectionConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; - - /** - * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @param message PscAutoConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @param message PscAutoConnectionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; - - /** - * Verifies a PscAutoConnectionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscAutoConnectionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig; - - /** - * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. - * @param message PscAutoConnectionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscAutoConnectionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscAutoConnectionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PscInstanceConfig. */ - interface IPscInstanceConfig { - - /** PscInstanceConfig serviceAttachmentLink */ - serviceAttachmentLink?: (string|null); - - /** PscInstanceConfig allowedConsumerProjects */ - allowedConsumerProjects?: (string[]|null); - - /** PscInstanceConfig pscDnsName */ - pscDnsName?: (string|null); - - /** PscInstanceConfig pscInterfaceConfigs */ - pscInterfaceConfigs?: (google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]|null); - - /** PscInstanceConfig pscAutoConnections */ - pscAutoConnections?: (google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig[]|null); - } - - /** Represents a PscInstanceConfig. */ - class PscInstanceConfig implements IPscInstanceConfig { - - /** - * Constructs a new PscInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig); - - /** PscInstanceConfig serviceAttachmentLink. */ - public serviceAttachmentLink: string; - - /** PscInstanceConfig allowedConsumerProjects. */ - public allowedConsumerProjects: string[]; - - /** PscInstanceConfig pscDnsName. */ - public pscDnsName: string; - - /** PscInstanceConfig pscInterfaceConfigs. */ - public pscInterfaceConfigs: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]; - - /** PscInstanceConfig pscAutoConnections. */ - public pscAutoConnections: google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig[]; - - /** - * Creates a new PscInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PscInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; - - /** - * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. - * @param message PscInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. - * @param message PscInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; - - /** - * Verifies a PscInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PscInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.PscInstanceConfig; - - /** - * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. - * @param message PscInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.PscInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PscInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PscInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceNetworkConfig. */ - interface IInstanceNetworkConfig { - - /** InstanceNetworkConfig authorizedExternalNetworks */ - authorizedExternalNetworks?: (google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]|null); - - /** InstanceNetworkConfig enablePublicIp */ - enablePublicIp?: (boolean|null); - - /** InstanceNetworkConfig enableOutboundPublicIp */ - enableOutboundPublicIp?: (boolean|null); - - /** InstanceNetworkConfig network */ - network?: (string|null); - - /** InstanceNetworkConfig allocatedIpRangeOverride */ - allocatedIpRangeOverride?: (string|null); - } - - /** Represents an InstanceNetworkConfig. */ - class InstanceNetworkConfig implements IInstanceNetworkConfig { - - /** - * Constructs a new InstanceNetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig); - - /** InstanceNetworkConfig authorizedExternalNetworks. */ - public authorizedExternalNetworks: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork[]; - - /** InstanceNetworkConfig enablePublicIp. */ - public enablePublicIp: boolean; - - /** InstanceNetworkConfig enableOutboundPublicIp. */ - public enableOutboundPublicIp: boolean; - - /** InstanceNetworkConfig network. */ - public network: string; - - /** InstanceNetworkConfig allocatedIpRangeOverride. */ - public allocatedIpRangeOverride: string; - - /** - * Creates a new InstanceNetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceNetworkConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; - - /** - * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. - * @param message InstanceNetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. - * @param message InstanceNetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; - - /** - * Verifies an InstanceNetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceNetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig; - - /** - * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. - * @param message InstanceNetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceNetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceNetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceNetworkConfig { - - /** Properties of an AuthorizedNetwork. */ - interface IAuthorizedNetwork { - - /** AuthorizedNetwork cidrRange */ - cidrRange?: (string|null); - } - - /** Represents an AuthorizedNetwork. */ - class AuthorizedNetwork implements IAuthorizedNetwork { - - /** - * Constructs a new AuthorizedNetwork. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork); - - /** AuthorizedNetwork cidrRange. */ - public cidrRange: string; - - /** - * Creates a new AuthorizedNetwork instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthorizedNetwork instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @param message AuthorizedNetwork message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @param message AuthorizedNetwork message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Verifies an AuthorizedNetwork message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuthorizedNetwork - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork; - - /** - * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. - * @param message AuthorizedNetwork - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuthorizedNetwork to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuthorizedNetwork - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ConnectionPoolConfig. */ - interface IConnectionPoolConfig { - - /** ConnectionPoolConfig enabled */ - enabled?: (boolean|null); - - /** ConnectionPoolConfig flags */ - flags?: ({ [k: string]: string }|null); - - /** ConnectionPoolConfig poolerCount */ - poolerCount?: (number|null); - } - - /** Represents a ConnectionPoolConfig. */ - class ConnectionPoolConfig implements IConnectionPoolConfig { - - /** - * Constructs a new ConnectionPoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig); - - /** ConnectionPoolConfig enabled. */ - public enabled: boolean; - - /** ConnectionPoolConfig flags. */ - public flags: { [k: string]: string }; - - /** ConnectionPoolConfig poolerCount. */ - public poolerCount: number; - - /** - * Creates a new ConnectionPoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionPoolConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; - - /** - * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. - * @param message ConnectionPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. - * @param message ConnectionPoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; - - /** - * Verifies a ConnectionPoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionPoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig; - - /** - * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. - * @param message ConnectionPoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionPoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectionPoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - STOPPED = 2, - CREATING = 3, - DELETING = 4, - MAINTENANCE = 5, - FAILED = 6, - BOOTSTRAPPING = 8, - PROMOTING = 9 - } - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - READ_POOL = 2, - SECONDARY = 3 - } - - /** AvailabilityType enum. */ - enum AvailabilityType { - AVAILABILITY_TYPE_UNSPECIFIED = 0, - ZONAL = 1, - REGIONAL = 2 - } - - /** ActivationPolicy enum. */ - enum ActivationPolicy { - ACTIVATION_POLICY_UNSPECIFIED = 0, - ALWAYS = 1, - NEVER = 2 - } - } - - /** Properties of a ConnectionInfo. */ - interface IConnectionInfo { - - /** ConnectionInfo name */ - name?: (string|null); - - /** ConnectionInfo ipAddress */ - ipAddress?: (string|null); - - /** ConnectionInfo publicIpAddress */ - publicIpAddress?: (string|null); - - /** ConnectionInfo pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** ConnectionInfo instanceUid */ - instanceUid?: (string|null); - - /** ConnectionInfo pscDnsName */ - pscDnsName?: (string|null); - } - - /** Represents a ConnectionInfo. */ - class ConnectionInfo implements IConnectionInfo { - - /** - * Constructs a new ConnectionInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IConnectionInfo); - - /** ConnectionInfo name. */ - public name: string; - - /** ConnectionInfo ipAddress. */ - public ipAddress: string; - - /** ConnectionInfo publicIpAddress. */ - public publicIpAddress: string; - - /** ConnectionInfo pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** ConnectionInfo instanceUid. */ - public instanceUid: string; - - /** ConnectionInfo pscDnsName. */ - public pscDnsName: string; - - /** - * Creates a new ConnectionInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ConnectionInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IConnectionInfo): google.cloud.alloydb.v1beta.ConnectionInfo; - - /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @param message ConnectionInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ConnectionInfo; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ConnectionInfo; - - /** - * Verifies a ConnectionInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ConnectionInfo; - - /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @param message ConnectionInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConnectionInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup name */ - name?: (string|null); - - /** Backup displayName */ - displayName?: (string|null); - - /** Backup uid */ - uid?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup createCompletionTime */ - createCompletionTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels */ - labels?: ({ [k: string]: string }|null); - - /** Backup state */ - state?: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State|null); - - /** Backup type */ - type?: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type|null); - - /** Backup description */ - description?: (string|null); - - /** Backup clusterUid */ - clusterUid?: (string|null); - - /** Backup clusterName */ - clusterName?: (string|null); - - /** Backup reconciling */ - reconciling?: (boolean|null); - - /** Backup encryptionConfig */ - encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** Backup encryptionInfo */ - encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** Backup etag */ - etag?: (string|null); - - /** Backup annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Backup sizeBytes */ - sizeBytes?: (number|Long|string|null); - - /** Backup expiryTime */ - expiryTime?: (google.protobuf.ITimestamp|null); - - /** Backup expiryQuantity */ - expiryQuantity?: (google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null); - - /** Backup satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Backup databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); - - /** Backup tags */ - tags?: ({ [k: string]: string }|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { - - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IBackup); - - /** Backup name. */ - public name: string; - - /** Backup displayName. */ - public displayName: string; - - /** Backup uid. */ - public uid: string; - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Backup createCompletionTime. */ - public createCompletionTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels. */ - public labels: { [k: string]: string }; - - /** Backup state. */ - public state: (google.cloud.alloydb.v1beta.Backup.State|keyof typeof google.cloud.alloydb.v1beta.Backup.State); - - /** Backup type. */ - public type: (google.cloud.alloydb.v1beta.Backup.Type|keyof typeof google.cloud.alloydb.v1beta.Backup.Type); - - /** Backup description. */ - public description: string; - - /** Backup clusterUid. */ - public clusterUid: string; - - /** Backup clusterName. */ - public clusterName: string; - - /** Backup reconciling. */ - public reconciling: boolean; - - /** Backup encryptionConfig. */ - public encryptionConfig?: (google.cloud.alloydb.v1beta.IEncryptionConfig|null); - - /** Backup encryptionInfo. */ - public encryptionInfo?: (google.cloud.alloydb.v1beta.IEncryptionInfo|null); - - /** Backup etag. */ - public etag: string; - - /** Backup annotations. */ - public annotations: { [k: string]: string }; - - /** Backup sizeBytes. */ - public sizeBytes: (number|Long|string); - - /** Backup expiryTime. */ - public expiryTime?: (google.protobuf.ITimestamp|null); - - /** Backup expiryQuantity. */ - public expiryQuantity?: (google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null); - - /** Backup satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Backup databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); - - /** Backup tags. */ - public tags: { [k: string]: string }; - - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBackup): google.cloud.alloydb.v1beta.Backup; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Backup; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Backup; - - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Backup { - - /** Properties of a QuantityBasedExpiry. */ - interface IQuantityBasedExpiry { - - /** QuantityBasedExpiry retentionCount */ - retentionCount?: (number|null); - - /** QuantityBasedExpiry totalRetentionCount */ - totalRetentionCount?: (number|null); - } - - /** Represents a QuantityBasedExpiry. */ - class QuantityBasedExpiry implements IQuantityBasedExpiry { - - /** - * Constructs a new QuantityBasedExpiry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry); - - /** QuantityBasedExpiry retentionCount. */ - public retentionCount: number; - - /** QuantityBasedExpiry totalRetentionCount. */ - public totalRetentionCount: number; - - /** - * Creates a new QuantityBasedExpiry instance using the specified properties. - * @param [properties] Properties to set - * @returns QuantityBasedExpiry instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; - - /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. - * @param message QuantityBasedExpiry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. - * @param message QuantityBasedExpiry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; - - /** - * Verifies a QuantityBasedExpiry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuantityBasedExpiry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; - - /** - * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. - * @param message QuantityBasedExpiry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuantityBasedExpiry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QuantityBasedExpiry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - READY = 1, - CREATING = 2, - FAILED = 3, - DELETING = 4 - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ON_DEMAND = 1, - AUTOMATED = 2, - CONTINUOUS = 3 - } - } - - /** Properties of a SupportedDatabaseFlag. */ - interface ISupportedDatabaseFlag { - - /** SupportedDatabaseFlag stringRestrictions */ - stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); - - /** SupportedDatabaseFlag integerRestrictions */ - integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); - - /** SupportedDatabaseFlag recommendedStringValue */ - recommendedStringValue?: (string|null); - - /** SupportedDatabaseFlag recommendedIntegerValue */ - recommendedIntegerValue?: (google.protobuf.IInt64Value|null); - - /** SupportedDatabaseFlag name */ - name?: (string|null); - - /** SupportedDatabaseFlag flagName */ - flagName?: (string|null); - - /** SupportedDatabaseFlag valueType */ - valueType?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null); - - /** SupportedDatabaseFlag acceptsMultipleValues */ - acceptsMultipleValues?: (boolean|null); - - /** SupportedDatabaseFlag supportedDbVersions */ - supportedDbVersions?: (google.cloud.alloydb.v1beta.DatabaseVersion[]|null); - - /** SupportedDatabaseFlag requiresDbRestart */ - requiresDbRestart?: (boolean|null); - - /** SupportedDatabaseFlag scope */ - scope?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null); - } - - /** Represents a SupportedDatabaseFlag. */ - class SupportedDatabaseFlag implements ISupportedDatabaseFlag { - - /** - * Constructs a new SupportedDatabaseFlag. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag); - - /** SupportedDatabaseFlag stringRestrictions. */ - public stringRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null); - - /** SupportedDatabaseFlag integerRestrictions. */ - public integerRestrictions?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null); - - /** SupportedDatabaseFlag recommendedStringValue. */ - public recommendedStringValue?: (string|null); - - /** SupportedDatabaseFlag recommendedIntegerValue. */ - public recommendedIntegerValue?: (google.protobuf.IInt64Value|null); - - /** SupportedDatabaseFlag name. */ - public name: string; - - /** SupportedDatabaseFlag flagName. */ - public flagName: string; - - /** SupportedDatabaseFlag valueType. */ - public valueType: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType); - - /** SupportedDatabaseFlag acceptsMultipleValues. */ - public acceptsMultipleValues: boolean; - - /** SupportedDatabaseFlag supportedDbVersions. */ - public supportedDbVersions: google.cloud.alloydb.v1beta.DatabaseVersion[]; - - /** SupportedDatabaseFlag requiresDbRestart. */ - public requiresDbRestart: boolean; - - /** SupportedDatabaseFlag scope. */ - public scope: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope); - - /** SupportedDatabaseFlag restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); - - /** SupportedDatabaseFlag recommendedValue. */ - public recommendedValue?: ("recommendedStringValue"|"recommendedIntegerValue"); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @param [properties] Properties to set - * @returns SupportedDatabaseFlag instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. - * @param message SupportedDatabaseFlag message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; - - /** - * Verifies a SupportedDatabaseFlag message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SupportedDatabaseFlag - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @param message SupportedDatabaseFlag - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SupportedDatabaseFlag { - - /** Properties of a StringRestrictions. */ - interface IStringRestrictions { - - /** StringRestrictions allowedValues */ - allowedValues?: (string[]|null); - } - - /** Represents a StringRestrictions. */ - class StringRestrictions implements IStringRestrictions { - - /** - * Constructs a new StringRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions); - - /** StringRestrictions allowedValues. */ - public allowedValues: string[]; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns StringRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @param message StringRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Verifies a StringRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @param message StringRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IntegerRestrictions. */ - interface IIntegerRestrictions { - - /** IntegerRestrictions minValue */ - minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue */ - maxValue?: (google.protobuf.IInt64Value|null); - } - - /** Represents an IntegerRestrictions. */ - class IntegerRestrictions implements IIntegerRestrictions { - - /** - * Constructs a new IntegerRestrictions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions); - - /** IntegerRestrictions minValue. */ - public minValue?: (google.protobuf.IInt64Value|null); - - /** IntegerRestrictions maxValue. */ - public maxValue?: (google.protobuf.IInt64Value|null); - - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @param [properties] Properties to set - * @returns IntegerRestrictions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @param message IntegerRestrictions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Verifies an IntegerRestrictions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntegerRestrictions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions; - - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @param message IntegerRestrictions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntegerRestrictions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IntegerRestrictions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - STRING = 1, - INTEGER = 2, - FLOAT = 3, - NONE = 4 - } - - /** Scope enum. */ - enum Scope { - SCOPE_UNSPECIFIED = 0, - DATABASE = 1, - CONNECTION_POOL = 2 - } - } - - /** Properties of a User. */ - interface IUser { - - /** User name */ - name?: (string|null); - - /** User password */ - password?: (string|null); - - /** User databaseRoles */ - databaseRoles?: (string[]|null); - - /** User userType */ - userType?: (google.cloud.alloydb.v1beta.User.UserType|keyof typeof google.cloud.alloydb.v1beta.User.UserType|null); - - /** User keepExtraRoles */ - keepExtraRoles?: (boolean|null); - } - - /** Represents a User. */ - class User implements IUser { - - /** - * Constructs a new User. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUser); - - /** User name. */ - public name: string; - - /** User password. */ - public password: string; - - /** User databaseRoles. */ - public databaseRoles: string[]; - - /** User userType. */ - public userType: (google.cloud.alloydb.v1beta.User.UserType|keyof typeof google.cloud.alloydb.v1beta.User.UserType); - - /** User keepExtraRoles. */ - public keepExtraRoles: boolean; - - /** - * Creates a new User instance using the specified properties. - * @param [properties] Properties to set - * @returns User instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUser): google.cloud.alloydb.v1beta.User; - - /** - * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a User message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.User; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.User; - - /** - * Verifies a User message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns User - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.User; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @param message User - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this User to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for User - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace User { - - /** UserType enum. */ - enum UserType { - USER_TYPE_UNSPECIFIED = 0, - ALLOYDB_BUILT_IN = 1, - ALLOYDB_IAM_USER = 2 - } - } - - /** Properties of a Database. */ - interface IDatabase { - - /** Database name */ - name?: (string|null); - - /** Database charset */ - charset?: (string|null); - - /** Database collation */ - collation?: (string|null); - - /** Database characterType */ - characterType?: (string|null); - - /** Database isTemplate */ - isTemplate?: (boolean|null); - - /** Database databaseTemplate */ - databaseTemplate?: (string|null); - - /** Database isTemplateDatabase */ - isTemplateDatabase?: (boolean|null); - } - - /** Represents a Database. */ - class Database implements IDatabase { - - /** - * Constructs a new Database. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IDatabase); - - /** Database name. */ - public name: string; - - /** Database charset. */ - public charset: string; - - /** Database collation. */ - public collation: string; - - /** Database characterType. */ - public characterType: string; - - /** Database isTemplate. */ - public isTemplate: boolean; - - /** Database databaseTemplate. */ - public databaseTemplate: string; - - /** Database isTemplateDatabase. */ - public isTemplateDatabase?: (boolean|null); - - /** - * Creates a new Database instance using the specified properties. - * @param [properties] Properties to set - * @returns Database instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IDatabase): google.cloud.alloydb.v1beta.Database; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. - * @param message Database message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDatabase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Database message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Database; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Database; - - /** - * Verifies a Database message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Database - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Database; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @param message Database - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.Database, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Database to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Database - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** GCAEntitlementType enum. */ - enum GCAEntitlementType { - GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0, - GCA_STANDARD = 1 - } - - /** Properties of a GeminiClusterConfig. */ - interface IGeminiClusterConfig { - - /** GeminiClusterConfig entitled */ - entitled?: (boolean|null); - } - - /** Represents a GeminiClusterConfig. */ - class GeminiClusterConfig implements IGeminiClusterConfig { - - /** - * Constructs a new GeminiClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGeminiClusterConfig); - - /** GeminiClusterConfig entitled. */ - public entitled: boolean; - - /** - * Creates a new GeminiClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GeminiClusterConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGeminiClusterConfig): google.cloud.alloydb.v1beta.GeminiClusterConfig; - - /** - * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. - * @param message GeminiClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. - * @param message GeminiClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGeminiClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GeminiClusterConfig; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GeminiClusterConfig; - - /** - * Verifies a GeminiClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeminiClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GeminiClusterConfig; - - /** - * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. - * @param message GeminiClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GeminiClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeminiClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeminiClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GeminiInstanceConfig. */ - interface IGeminiInstanceConfig { - - /** GeminiInstanceConfig entitled */ - entitled?: (boolean|null); - } - - /** Represents a GeminiInstanceConfig. */ - class GeminiInstanceConfig implements IGeminiInstanceConfig { - - /** - * Constructs a new GeminiInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGeminiInstanceConfig); - - /** GeminiInstanceConfig entitled. */ - public entitled: boolean; - - /** - * Creates a new GeminiInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GeminiInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGeminiInstanceConfig): google.cloud.alloydb.v1beta.GeminiInstanceConfig; - - /** - * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. - * @param message GeminiInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. - * @param message GeminiInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGeminiInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GeminiInstanceConfig; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GeminiInstanceConfig; - - /** - * Verifies a GeminiInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeminiInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GeminiInstanceConfig; - - /** - * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. - * @param message GeminiInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GeminiInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeminiInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeminiInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCAInstanceConfig. */ - interface IGCAInstanceConfig { - - /** GCAInstanceConfig gcaEntitlement */ - gcaEntitlement?: (google.cloud.alloydb.v1beta.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1beta.GCAEntitlementType|null); - } - - /** Represents a GCAInstanceConfig. */ - class GCAInstanceConfig implements IGCAInstanceConfig { - - /** - * Constructs a new GCAInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGCAInstanceConfig); - - /** GCAInstanceConfig gcaEntitlement. */ - public gcaEntitlement: (google.cloud.alloydb.v1beta.GCAEntitlementType|keyof typeof google.cloud.alloydb.v1beta.GCAEntitlementType); - - /** - * Creates a new GCAInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GCAInstanceConfig instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGCAInstanceConfig): google.cloud.alloydb.v1beta.GCAInstanceConfig; - - /** - * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. - * @param message GCAInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. - * @param message GCAInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGCAInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GCAInstanceConfig; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GCAInstanceConfig; - - /** - * Verifies a GCAInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCAInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GCAInstanceConfig; - - /** - * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. - * @param message GCAInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GCAInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCAInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCAInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AlloyDBAdmin */ - class AlloyDBAdmin extends $protobuf.rpc.Service { - - /** - * Constructs a new AlloyDBAdmin service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AlloyDBAdmin; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse - */ - public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback): void; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise - */ - public listClusters(request: google.cloud.alloydb.v1beta.IListClustersRequest): Promise; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster - */ - public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback): void; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise - */ - public getCluster(request: google.cloud.alloydb.v1beta.IGetClusterRequest): Promise; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback): void; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise - */ - public createCluster(request: google.cloud.alloydb.v1beta.ICreateClusterRequest): Promise; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback): void; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @returns Promise - */ - public updateCluster(request: google.cloud.alloydb.v1beta.IUpdateClusterRequest): Promise; - - /** - * Calls ExportCluster. - * @param request ExportClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportCluster(request: google.cloud.alloydb.v1beta.IExportClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportClusterCallback): void; - - /** - * Calls ExportCluster. - * @param request ExportClusterRequest message or plain object - * @returns Promise - */ - public exportCluster(request: google.cloud.alloydb.v1beta.IExportClusterRequest): Promise; - - /** - * Calls ImportCluster. - * @param request ImportClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importCluster(request: google.cloud.alloydb.v1beta.IImportClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportClusterCallback): void; - - /** - * Calls ImportCluster. - * @param request ImportClusterRequest message or plain object - * @returns Promise - */ - public importCluster(request: google.cloud.alloydb.v1beta.IImportClusterRequest): Promise; - - /** - * Calls UpgradeCluster. - * @param request UpgradeClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public upgradeCluster(request: google.cloud.alloydb.v1beta.IUpgradeClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeClusterCallback): void; - - /** - * Calls UpgradeCluster. - * @param request UpgradeClusterRequest message or plain object - * @returns Promise - */ - public upgradeCluster(request: google.cloud.alloydb.v1beta.IUpgradeClusterRequest): Promise; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback): void; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise - */ - public deleteCluster(request: google.cloud.alloydb.v1beta.IDeleteClusterRequest): Promise; - - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback): void; - - /** - * Calls PromoteCluster. - * @param request PromoteClusterRequest message or plain object - * @returns Promise - */ - public promoteCluster(request: google.cloud.alloydb.v1beta.IPromoteClusterRequest): Promise; - - /** - * Calls SwitchoverCluster. - * @param request SwitchoverClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public switchoverCluster(request: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverClusterCallback): void; - - /** - * Calls SwitchoverCluster. - * @param request SwitchoverClusterRequest message or plain object - * @returns Promise - */ - public switchoverCluster(request: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest): Promise; - - /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback): void; - - /** - * Calls RestoreCluster. - * @param request RestoreClusterRequest message or plain object - * @returns Promise - */ - public restoreCluster(request: google.cloud.alloydb.v1beta.IRestoreClusterRequest): Promise; - - /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback): void; - - /** - * Calls CreateSecondaryCluster. - * @param request CreateSecondaryClusterRequest message or plain object - * @returns Promise - */ - public createSecondaryCluster(request: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.cloud.alloydb.v1beta.IListInstancesRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.cloud.alloydb.v1beta.IGetInstanceRequest): Promise; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.cloud.alloydb.v1beta.ICreateInstanceRequest): Promise; - - /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback): void; - - /** - * Calls CreateSecondaryInstance. - * @param request CreateSecondaryInstanceRequest message or plain object - * @returns Promise - */ - public createSecondaryInstance(request: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): Promise; - - /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback): void; - - /** - * Calls BatchCreateInstances. - * @param request BatchCreateInstancesRequest message or plain object - * @returns Promise - */ - public batchCreateInstances(request: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): Promise; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback): void; - - /** - * Calls UpdateInstance. - * @param request UpdateInstanceRequest message or plain object - * @returns Promise - */ - public updateInstance(request: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): Promise; - - /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback): void; - - /** - * Calls FailoverInstance. - * @param request FailoverInstanceRequest message or plain object - * @returns Promise - */ - public failoverInstance(request: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): Promise; - - /** - * Calls InjectFault. - * @param request InjectFaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public injectFault(request: google.cloud.alloydb.v1beta.IInjectFaultRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFaultCallback): void; - - /** - * Calls InjectFault. - * @param request InjectFaultRequest message or plain object - * @returns Promise - */ - public injectFault(request: google.cloud.alloydb.v1beta.IInjectFaultRequest): Promise; - - /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback): void; - - /** - * Calls RestartInstance. - * @param request RestartInstanceRequest message or plain object - * @returns Promise - */ - public restartInstance(request: google.cloud.alloydb.v1beta.IRestartInstanceRequest): Promise; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExecuteSqlResponse - */ - public executeSql(request: google.cloud.alloydb.v1beta.IExecuteSqlRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSqlCallback): void; - - /** - * Calls ExecuteSql. - * @param request ExecuteSqlRequest message or plain object - * @returns Promise - */ - public executeSql(request: google.cloud.alloydb.v1beta.IExecuteSqlRequest): Promise; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse - */ - public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback): void; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise - */ - public listBackups(request: google.cloud.alloydb.v1beta.IListBackupsRequest): Promise; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback): void; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise - */ - public getBackup(request: google.cloud.alloydb.v1beta.IGetBackupRequest): Promise; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback): void; - - /** - * Calls CreateBackup. - * @param request CreateBackupRequest message or plain object - * @returns Promise - */ - public createBackup(request: google.cloud.alloydb.v1beta.ICreateBackupRequest): Promise; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback): void; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise - */ - public updateBackup(request: google.cloud.alloydb.v1beta.IUpdateBackupRequest): Promise; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback): void; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise - */ - public deleteBackup(request: google.cloud.alloydb.v1beta.IDeleteBackupRequest): Promise; - - /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback): void; - - /** - * Calls ListSupportedDatabaseFlags. - * @param request ListSupportedDatabaseFlagsRequest message or plain object - * @returns Promise - */ - public listSupportedDatabaseFlags(request: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): Promise; - - /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - */ - public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback): void; - - /** - * Calls GenerateClientCertificate. - * @param request GenerateClientCertificateRequest message or plain object - * @returns Promise - */ - public generateClientCertificate(request: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): Promise; - - /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ConnectionInfo - */ - public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback): void; - - /** - * Calls GetConnectionInfo. - * @param request GetConnectionInfoRequest message or plain object - * @returns Promise - */ - public getConnectionInfo(request: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): Promise; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListUsersResponse - */ - public listUsers(request: google.cloud.alloydb.v1beta.IListUsersRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsersCallback): void; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @returns Promise - */ - public listUsers(request: google.cloud.alloydb.v1beta.IListUsersRequest): Promise; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public getUser(request: google.cloud.alloydb.v1beta.IGetUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUserCallback): void; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @returns Promise - */ - public getUser(request: google.cloud.alloydb.v1beta.IGetUserRequest): Promise; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public createUser(request: google.cloud.alloydb.v1beta.ICreateUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUserCallback): void; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @returns Promise - */ - public createUser(request: google.cloud.alloydb.v1beta.ICreateUserRequest): Promise; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public updateUser(request: google.cloud.alloydb.v1beta.IUpdateUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUserCallback): void; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @returns Promise - */ - public updateUser(request: google.cloud.alloydb.v1beta.IUpdateUserRequest): Promise; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteUser(request: google.cloud.alloydb.v1beta.IDeleteUserRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUserCallback): void; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @returns Promise - */ - public deleteUser(request: google.cloud.alloydb.v1beta.IDeleteUserRequest): Promise; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatabasesResponse - */ - public listDatabases(request: google.cloud.alloydb.v1beta.IListDatabasesRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabasesCallback): void; - - /** - * Calls ListDatabases. - * @param request ListDatabasesRequest message or plain object - * @returns Promise - */ - public listDatabases(request: google.cloud.alloydb.v1beta.IListDatabasesRequest): Promise; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Database - */ - public createDatabase(request: google.cloud.alloydb.v1beta.ICreateDatabaseRequest, callback: google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabaseCallback): void; - - /** - * Calls CreateDatabase. - * @param request CreateDatabaseRequest message or plain object - * @returns Promise - */ - public createDatabase(request: google.cloud.alloydb.v1beta.ICreateDatabaseRequest): Promise; - } - - namespace AlloyDBAdmin { - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse - */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListClustersResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. - * @param error Error, if any - * @param [response] Cluster - */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Cluster) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|exportCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|importCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|upgradeCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpgradeClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type PromoteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|switchoverCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type SwitchoverClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSecondaryClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Instance) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSecondaryInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchCreateInstancesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type FailoverInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|injectFault}. - * @param error Error, if any - * @param [response] Operation - */ - type InjectFaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|executeSql}. - * @param error Error, if any - * @param [response] ExecuteSqlResponse - */ - type ExecuteSqlCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ExecuteSqlResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse - */ - type ListBackupsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListBackupsResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type GetBackupCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Backup) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @param error Error, if any - * @param [response] ListSupportedDatabaseFlagsResponse - */ - type ListSupportedDatabaseFlagsCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. - * @param error Error, if any - * @param [response] GenerateClientCertificateResponse - */ - type GenerateClientCertificateCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. - * @param error Error, if any - * @param [response] ConnectionInfo - */ - type GetConnectionInfoCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ConnectionInfo) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listUsers}. - * @param error Error, if any - * @param [response] ListUsersResponse - */ - type ListUsersCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListUsersResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getUser}. - * @param error Error, if any - * @param [response] User - */ - type GetUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createUser}. - * @param error Error, if any - * @param [response] User - */ - type CreateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateUser}. - * @param error Error, if any - * @param [response] User - */ - type UpdateUserCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.User) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteUser}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listDatabases}. - * @param error Error, if any - * @param [response] ListDatabasesResponse - */ - type ListDatabasesCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.ListDatabasesResponse) => void; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createDatabase}. - * @param error Error, if any - * @param [response] Database - */ - type CreateDatabaseCallback = (error: (Error|null), response?: google.cloud.alloydb.v1beta.Database) => void; - } - - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { - - /** ListClustersRequest parent */ - parent?: (string|null); - - /** ListClustersRequest pageSize */ - pageSize?: (number|null); - - /** ListClustersRequest pageToken */ - pageToken?: (string|null); - - /** ListClustersRequest filter */ - filter?: (string|null); - - /** ListClustersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { - - /** - * Constructs a new ListClustersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListClustersRequest); - - /** ListClustersRequest parent. */ - public parent: string; - - /** ListClustersRequest pageSize. */ - public pageSize: number; - - /** ListClustersRequest pageToken. */ - public pageToken: string; - - /** ListClustersRequest filter. */ - public filter: string; - - /** ListClustersRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListClustersRequest): google.cloud.alloydb.v1beta.ListClustersRequest; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersRequest; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersRequest; - - /** - * Verifies a ListClustersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersRequest; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { - - /** ListClustersResponse clusters */ - clusters?: (google.cloud.alloydb.v1beta.ICluster[]|null); - - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListClustersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { - - /** - * Constructs a new ListClustersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListClustersResponse); - - /** ListClustersResponse clusters. */ - public clusters: google.cloud.alloydb.v1beta.ICluster[]; - - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListClustersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListClustersResponse): google.cloud.alloydb.v1beta.ListClustersResponse; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListClustersResponse; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListClustersResponse; - - /** - * Verifies a ListClustersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListClustersResponse; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { - - /** GetClusterRequest name */ - name?: (string|null); - - /** GetClusterRequest view */ - view?: (google.cloud.alloydb.v1beta.ClusterView|keyof typeof google.cloud.alloydb.v1beta.ClusterView|null); - } - - /** Represents a GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { - - /** - * Constructs a new GetClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest); - - /** GetClusterRequest name. */ - public name: string; - - /** GetClusterRequest view. */ - public view: (google.cloud.alloydb.v1beta.ClusterView|keyof typeof google.cloud.alloydb.v1beta.ClusterView); - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetClusterRequest): google.cloud.alloydb.v1beta.GetClusterRequest; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetClusterRequest; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetClusterRequest; - - /** - * Verifies a GetClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetClusterRequest; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSecondaryClusterRequest. */ - interface ICreateSecondaryClusterRequest { - - /** CreateSecondaryClusterRequest parent */ - parent?: (string|null); - - /** CreateSecondaryClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateSecondaryClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** CreateSecondaryClusterRequest requestId */ - requestId?: (string|null); - - /** CreateSecondaryClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateSecondaryClusterRequest. */ - class CreateSecondaryClusterRequest implements ICreateSecondaryClusterRequest { - - /** - * Constructs a new CreateSecondaryClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest); - - /** CreateSecondaryClusterRequest parent. */ - public parent: string; - - /** CreateSecondaryClusterRequest clusterId. */ - public clusterId: string; - - /** CreateSecondaryClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** CreateSecondaryClusterRequest requestId. */ - public requestId: string; - - /** CreateSecondaryClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecondaryClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; - - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. - * @param message CreateSecondaryClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; - - /** - * Verifies a CreateSecondaryClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecondaryClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest; - - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { - - /** CreateClusterRequest parent */ - parent?: (string|null); - - /** CreateClusterRequest clusterId */ - clusterId?: (string|null); - - /** CreateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** CreateClusterRequest requestId */ - requestId?: (string|null); - - /** CreateClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { - - /** - * Constructs a new CreateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest); - - /** CreateClusterRequest parent. */ - public parent: string; - - /** CreateClusterRequest clusterId. */ - public clusterId: string; - - /** CreateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** CreateClusterRequest requestId. */ - public requestId: string; - - /** CreateClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateClusterRequest): google.cloud.alloydb.v1beta.CreateClusterRequest; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateClusterRequest; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateClusterRequest; - - /** - * Verifies a CreateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateClusterRequest; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateClusterRequest. */ - interface IUpdateClusterRequest { - - /** UpdateClusterRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** UpdateClusterRequest requestId */ - requestId?: (string|null); - - /** UpdateClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateClusterRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateClusterRequest. */ - class UpdateClusterRequest implements IUpdateClusterRequest { - - /** - * Constructs a new UpdateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest); - - /** UpdateClusterRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** UpdateClusterRequest requestId. */ - public requestId: string; - - /** UpdateClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateClusterRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateClusterRequest): google.cloud.alloydb.v1beta.UpdateClusterRequest; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateClusterRequest; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateClusterRequest; - - /** - * Verifies an UpdateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateClusterRequest; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @param message UpdateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDestination. */ - interface IGcsDestination { - - /** GcsDestination uri */ - uri?: (string|null); - } - - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { - - /** - * Constructs a new GcsDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGcsDestination); - - /** GcsDestination uri. */ - public uri: string; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDestination instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGcsDestination): google.cloud.alloydb.v1beta.GcsDestination; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GcsDestination; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GcsDestination; - - /** - * Verifies a GcsDestination message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDestination - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GcsDestination; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDestination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportClusterRequest. */ - interface IExportClusterRequest { - - /** ExportClusterRequest gcsDestination */ - gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); - - /** ExportClusterRequest csvExportOptions */ - csvExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null); - - /** ExportClusterRequest sqlExportOptions */ - sqlExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null); - - /** ExportClusterRequest name */ - name?: (string|null); - - /** ExportClusterRequest database */ - database?: (string|null); - } - - /** Represents an ExportClusterRequest. */ - class ExportClusterRequest implements IExportClusterRequest { - - /** - * Constructs a new ExportClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IExportClusterRequest); - - /** ExportClusterRequest gcsDestination. */ - public gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); - - /** ExportClusterRequest csvExportOptions. */ - public csvExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null); - - /** ExportClusterRequest sqlExportOptions. */ - public sqlExportOptions?: (google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null); - - /** ExportClusterRequest name. */ - public name: string; - - /** ExportClusterRequest database. */ - public database: string; - - /** ExportClusterRequest destination. */ - public destination?: "gcsDestination"; - - /** ExportClusterRequest exportOptions. */ - public exportOptions?: ("csvExportOptions"|"sqlExportOptions"); - - /** - * Creates a new ExportClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IExportClusterRequest): google.cloud.alloydb.v1beta.ExportClusterRequest; - - /** - * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. - * @param message ExportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. - * @param message ExportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterRequest; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterRequest; - - /** - * Verifies an ExportClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterRequest; - - /** - * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. - * @param message ExportClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExportClusterRequest { - - /** Properties of a CsvExportOptions. */ - interface ICsvExportOptions { - - /** CsvExportOptions selectQuery */ - selectQuery?: (string|null); - - /** CsvExportOptions fieldDelimiter */ - fieldDelimiter?: (string|null); - - /** CsvExportOptions quoteCharacter */ - quoteCharacter?: (string|null); - - /** CsvExportOptions escapeCharacter */ - escapeCharacter?: (string|null); - } - - /** Represents a CsvExportOptions. */ - class CsvExportOptions implements ICsvExportOptions { - - /** - * Constructs a new CsvExportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions); - - /** CsvExportOptions selectQuery. */ - public selectQuery: string; - - /** CsvExportOptions fieldDelimiter. */ - public fieldDelimiter: string; - - /** CsvExportOptions quoteCharacter. */ - public quoteCharacter: string; - - /** CsvExportOptions escapeCharacter. */ - public escapeCharacter: string; - - /** - * Creates a new CsvExportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CsvExportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; - - /** - * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @param message CsvExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @param message CsvExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; - - /** - * Verifies a CsvExportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CsvExportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions; - - /** - * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. - * @param message CsvExportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CsvExportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CsvExportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlExportOptions. */ - interface ISqlExportOptions { - - /** SqlExportOptions tables */ - tables?: (string[]|null); - - /** SqlExportOptions schemaOnly */ - schemaOnly?: (boolean|null); - - /** SqlExportOptions cleanTargetObjects */ - cleanTargetObjects?: (boolean|null); - - /** SqlExportOptions ifExistTargetObjects */ - ifExistTargetObjects?: (boolean|null); - } - - /** Represents a SqlExportOptions. */ - class SqlExportOptions implements ISqlExportOptions { - - /** - * Constructs a new SqlExportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions); - - /** SqlExportOptions tables. */ - public tables: string[]; - - /** SqlExportOptions schemaOnly. */ - public schemaOnly?: (boolean|null); - - /** SqlExportOptions cleanTargetObjects. */ - public cleanTargetObjects?: (boolean|null); - - /** SqlExportOptions ifExistTargetObjects. */ - public ifExistTargetObjects?: (boolean|null); - - /** - * Creates a new SqlExportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlExportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; - - /** - * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @param message SqlExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @param message SqlExportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; - - /** - * Verifies a SqlExportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlExportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions; - - /** - * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. - * @param message SqlExportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlExportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlExportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExportClusterResponse. */ - interface IExportClusterResponse { - - /** ExportClusterResponse gcsDestination */ - gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); - } - - /** Represents an ExportClusterResponse. */ - class ExportClusterResponse implements IExportClusterResponse { - - /** - * Constructs a new ExportClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IExportClusterResponse); - - /** ExportClusterResponse gcsDestination. */ - public gcsDestination?: (google.cloud.alloydb.v1beta.IGcsDestination|null); - - /** ExportClusterResponse destination. */ - public destination?: "gcsDestination"; - - /** - * Creates a new ExportClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IExportClusterResponse): google.cloud.alloydb.v1beta.ExportClusterResponse; - - /** - * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. - * @param message ExportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. - * @param message ExportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExportClusterResponse; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExportClusterResponse; - - /** - * Verifies an ExportClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExportClusterResponse; - - /** - * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. - * @param message ExportClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExportClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportClusterRequest. */ - interface IImportClusterRequest { - - /** ImportClusterRequest sqlImportOptions */ - sqlImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null); - - /** ImportClusterRequest csvImportOptions */ - csvImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null); - - /** ImportClusterRequest name */ - name?: (string|null); - - /** ImportClusterRequest gcsUri */ - gcsUri?: (string|null); - - /** ImportClusterRequest database */ - database?: (string|null); - - /** ImportClusterRequest user */ - user?: (string|null); - } - - /** Represents an ImportClusterRequest. */ - class ImportClusterRequest implements IImportClusterRequest { - - /** - * Constructs a new ImportClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IImportClusterRequest); - - /** ImportClusterRequest sqlImportOptions. */ - public sqlImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null); - - /** ImportClusterRequest csvImportOptions. */ - public csvImportOptions?: (google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null); - - /** ImportClusterRequest name. */ - public name: string; - - /** ImportClusterRequest gcsUri. */ - public gcsUri: string; - - /** ImportClusterRequest database. */ - public database: string; - - /** ImportClusterRequest user. */ - public user: string; - - /** ImportClusterRequest importOptions. */ - public importOptions?: ("sqlImportOptions"|"csvImportOptions"); - - /** - * Creates a new ImportClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IImportClusterRequest): google.cloud.alloydb.v1beta.ImportClusterRequest; - - /** - * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. - * @param message ImportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. - * @param message ImportClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IImportClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterRequest; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterRequest; - - /** - * Verifies an ImportClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterRequest; - - /** - * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. - * @param message ImportClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportClusterRequest { - - /** Properties of a SqlImportOptions. */ - interface ISqlImportOptions { - } - - /** Represents a SqlImportOptions. */ - class SqlImportOptions implements ISqlImportOptions { - - /** - * Constructs a new SqlImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions); - - /** - * Creates a new SqlImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlImportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; - - /** - * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @param message SqlImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @param message SqlImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; - - /** - * Verifies a SqlImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions; - - /** - * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. - * @param message SqlImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CsvImportOptions. */ - interface ICsvImportOptions { - - /** CsvImportOptions table */ - table?: (string|null); - - /** CsvImportOptions columns */ - columns?: (string[]|null); - - /** CsvImportOptions fieldDelimiter */ - fieldDelimiter?: (string|null); - - /** CsvImportOptions quoteCharacter */ - quoteCharacter?: (string|null); - - /** CsvImportOptions escapeCharacter */ - escapeCharacter?: (string|null); - } - - /** Represents a CsvImportOptions. */ - class CsvImportOptions implements ICsvImportOptions { - - /** - * Constructs a new CsvImportOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions); - - /** CsvImportOptions table. */ - public table: string; - - /** CsvImportOptions columns. */ - public columns: string[]; - - /** CsvImportOptions fieldDelimiter. */ - public fieldDelimiter: string; - - /** CsvImportOptions quoteCharacter. */ - public quoteCharacter: string; - - /** CsvImportOptions escapeCharacter. */ - public escapeCharacter: string; - - /** - * Creates a new CsvImportOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CsvImportOptions instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; - - /** - * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @param message CsvImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @param message CsvImportOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; - - /** - * Verifies a CsvImportOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CsvImportOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions; - - /** - * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. - * @param message CsvImportOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CsvImportOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CsvImportOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ImportClusterResponse. */ - interface IImportClusterResponse { - - /** ImportClusterResponse bytesDownloaded */ - bytesDownloaded?: (number|Long|string|null); - } - - /** Represents an ImportClusterResponse. */ - class ImportClusterResponse implements IImportClusterResponse { - - /** - * Constructs a new ImportClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IImportClusterResponse); - - /** ImportClusterResponse bytesDownloaded. */ - public bytesDownloaded: (number|Long|string); - - /** - * Creates a new ImportClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IImportClusterResponse): google.cloud.alloydb.v1beta.ImportClusterResponse; - - /** - * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. - * @param message ImportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. - * @param message ImportClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IImportClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ImportClusterResponse; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ImportClusterResponse; - - /** - * Verifies an ImportClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ImportClusterResponse; - - /** - * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. - * @param message ImportClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ImportClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterRequest. */ - interface IUpgradeClusterRequest { - - /** UpgradeClusterRequest name */ - name?: (string|null); - - /** UpgradeClusterRequest version */ - version?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); - - /** UpgradeClusterRequest requestId */ - requestId?: (string|null); - - /** UpgradeClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpgradeClusterRequest etag */ - etag?: (string|null); - } - - /** Represents an UpgradeClusterRequest. */ - class UpgradeClusterRequest implements IUpgradeClusterRequest { - - /** - * Constructs a new UpgradeClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterRequest); - - /** UpgradeClusterRequest name. */ - public name: string; - - /** UpgradeClusterRequest version. */ - public version: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); - - /** UpgradeClusterRequest requestId. */ - public requestId: string; - - /** UpgradeClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** UpgradeClusterRequest etag. */ - public etag: string; - - /** - * Creates a new UpgradeClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterRequest): google.cloud.alloydb.v1beta.UpgradeClusterRequest; - - /** - * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. - * @param message UpgradeClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. - * @param message UpgradeClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpgradeClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterRequest; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterRequest; - - /** - * Verifies an UpgradeClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterRequest; - - /** - * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. - * @param message UpgradeClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpgradeClusterResponse. */ - interface IUpgradeClusterResponse { - - /** UpgradeClusterResponse status */ - status?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); - - /** UpgradeClusterResponse message */ - message?: (string|null); - - /** UpgradeClusterResponse clusterUpgradeDetails */ - clusterUpgradeDetails?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails[]|null); - } - - /** Represents an UpgradeClusterResponse. */ - class UpgradeClusterResponse implements IUpgradeClusterResponse { - - /** - * Constructs a new UpgradeClusterResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterResponse); - - /** UpgradeClusterResponse status. */ - public status: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); - - /** UpgradeClusterResponse message. */ - public message: string; - - /** UpgradeClusterResponse clusterUpgradeDetails. */ - public clusterUpgradeDetails: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails[]; - - /** - * Creates a new UpgradeClusterResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterResponse): google.cloud.alloydb.v1beta.UpgradeClusterResponse; - - /** - * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. - * @param message UpgradeClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. - * @param message UpgradeClusterResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpgradeClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse; - - /** - * Verifies an UpgradeClusterResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse; - - /** - * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. - * @param message UpgradeClusterResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpgradeClusterResponse { - - /** Properties of a StageInfo. */ - interface IStageInfo { - - /** StageInfo stage */ - stage?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null); - - /** StageInfo status */ - status?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); - - /** StageInfo logsUrl */ - logsUrl?: (string|null); - } - - /** Represents a StageInfo. */ - class StageInfo implements IStageInfo { - - /** - * Constructs a new StageInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo); - - /** StageInfo stage. */ - public stage: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage); - - /** StageInfo status. */ - public status: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); - - /** StageInfo logsUrl. */ - public logsUrl: string; - - /** - * Creates a new StageInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns StageInfo instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; - - /** - * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @param message StageInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @param message StageInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; - - /** - * Decodes a StageInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; - - /** - * Verifies a StageInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo; - - /** - * Creates a plain object from a StageInfo message. Also converts values to other types if specified. - * @param message StageInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceUpgradeDetails. */ - interface IInstanceUpgradeDetails { - - /** InstanceUpgradeDetails name */ - name?: (string|null); - - /** InstanceUpgradeDetails upgradeStatus */ - upgradeStatus?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); - - /** InstanceUpgradeDetails instanceType */ - instanceType?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); - } - - /** Represents an InstanceUpgradeDetails. */ - class InstanceUpgradeDetails implements IInstanceUpgradeDetails { - - /** - * Constructs a new InstanceUpgradeDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails); - - /** InstanceUpgradeDetails name. */ - public name: string; - - /** InstanceUpgradeDetails upgradeStatus. */ - public upgradeStatus: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); - - /** InstanceUpgradeDetails instanceType. */ - public instanceType: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); - - /** - * Creates a new InstanceUpgradeDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceUpgradeDetails instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @param message InstanceUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @param message InstanceUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Verifies an InstanceUpgradeDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceUpgradeDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails; - - /** - * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. - * @param message InstanceUpgradeDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceUpgradeDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceUpgradeDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterUpgradeDetails. */ - interface IClusterUpgradeDetails { - - /** ClusterUpgradeDetails name */ - name?: (string|null); - - /** ClusterUpgradeDetails upgradeStatus */ - upgradeStatus?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); - - /** ClusterUpgradeDetails clusterType */ - clusterType?: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType|null); - - /** ClusterUpgradeDetails databaseVersion */ - databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); - - /** ClusterUpgradeDetails stageInfo */ - stageInfo?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo[]|null); - - /** ClusterUpgradeDetails instanceUpgradeDetails */ - instanceUpgradeDetails?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails[]|null); - } - - /** Represents a ClusterUpgradeDetails. */ - class ClusterUpgradeDetails implements IClusterUpgradeDetails { - - /** - * Constructs a new ClusterUpgradeDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails); - - /** ClusterUpgradeDetails name. */ - public name: string; - - /** ClusterUpgradeDetails upgradeStatus. */ - public upgradeStatus: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); - - /** ClusterUpgradeDetails clusterType. */ - public clusterType: (google.cloud.alloydb.v1beta.Cluster.ClusterType|keyof typeof google.cloud.alloydb.v1beta.Cluster.ClusterType); - - /** ClusterUpgradeDetails databaseVersion. */ - public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); - - /** ClusterUpgradeDetails stageInfo. */ - public stageInfo: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo[]; - - /** ClusterUpgradeDetails instanceUpgradeDetails. */ - public instanceUpgradeDetails: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails[]; - - /** - * Creates a new ClusterUpgradeDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterUpgradeDetails instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @param message ClusterUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @param message ClusterUpgradeDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Verifies a ClusterUpgradeDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterUpgradeDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails; - - /** - * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. - * @param message ClusterUpgradeDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterUpgradeDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterUpgradeDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, - NOT_STARTED = 4, - IN_PROGRESS = 5, - SUCCESS = 1, - FAILED = 2, - PARTIAL_SUCCESS = 3, - CANCEL_IN_PROGRESS = 6, - CANCELLED = 7 - } - - /** Stage enum. */ - enum Stage { - STAGE_UNSPECIFIED = 0, - ALLOYDB_PRECHECK = 1, - PG_UPGRADE_CHECK = 2, - PREPARE_FOR_UPGRADE = 5, - PRIMARY_INSTANCE_UPGRADE = 3, - READ_POOL_INSTANCES_UPGRADE = 4, - ROLLBACK = 6, - CLEANUP = 7 - } - } - - /** Properties of a DeleteClusterRequest. */ - interface IDeleteClusterRequest { - - /** DeleteClusterRequest name */ - name?: (string|null); - - /** DeleteClusterRequest requestId */ - requestId?: (string|null); - - /** DeleteClusterRequest etag */ - etag?: (string|null); - - /** DeleteClusterRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteClusterRequest force */ - force?: (boolean|null); - } - - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { - - /** - * Constructs a new DeleteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest); - - /** DeleteClusterRequest name. */ - public name: string; - - /** DeleteClusterRequest requestId. */ - public requestId: string; - - /** DeleteClusterRequest etag. */ - public etag: string; - - /** DeleteClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteClusterRequest force. */ - public force: boolean; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteClusterRequest): google.cloud.alloydb.v1beta.DeleteClusterRequest; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteClusterRequest; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteClusterRequest; - - /** - * Verifies a DeleteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteClusterRequest; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SwitchoverClusterRequest. */ - interface ISwitchoverClusterRequest { - - /** SwitchoverClusterRequest name */ - name?: (string|null); - - /** SwitchoverClusterRequest requestId */ - requestId?: (string|null); - - /** SwitchoverClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a SwitchoverClusterRequest. */ - class SwitchoverClusterRequest implements ISwitchoverClusterRequest { - - /** - * Constructs a new SwitchoverClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest); - - /** SwitchoverClusterRequest name. */ - public name: string; - - /** SwitchoverClusterRequest requestId. */ - public requestId: string; - - /** SwitchoverClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new SwitchoverClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SwitchoverClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; - - /** - * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. - * @param message SwitchoverClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. - * @param message SwitchoverClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; - - /** - * Verifies a SwitchoverClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SwitchoverClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SwitchoverClusterRequest; - - /** - * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. - * @param message SwitchoverClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SwitchoverClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SwitchoverClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SwitchoverClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PromoteClusterRequest. */ - interface IPromoteClusterRequest { - - /** PromoteClusterRequest name */ - name?: (string|null); - - /** PromoteClusterRequest requestId */ - requestId?: (string|null); - - /** PromoteClusterRequest etag */ - etag?: (string|null); - - /** PromoteClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a PromoteClusterRequest. */ - class PromoteClusterRequest implements IPromoteClusterRequest { - - /** - * Constructs a new PromoteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest); - - /** PromoteClusterRequest name. */ - public name: string; - - /** PromoteClusterRequest requestId. */ - public requestId: string; - - /** PromoteClusterRequest etag. */ - public etag: string; - - /** PromoteClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new PromoteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PromoteClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IPromoteClusterRequest): google.cloud.alloydb.v1beta.PromoteClusterRequest; - - /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. - * @param message PromoteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IPromoteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.PromoteClusterRequest; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.PromoteClusterRequest; - - /** - * Verifies a PromoteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromoteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.PromoteClusterRequest; - - /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @param message PromoteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.PromoteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromoteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromoteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreClusterRequest. */ - interface IRestoreClusterRequest { - - /** RestoreClusterRequest backupSource */ - backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource */ - continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent */ - parent?: (string|null); - - /** RestoreClusterRequest clusterId */ - clusterId?: (string|null); - - /** RestoreClusterRequest cluster */ - cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** RestoreClusterRequest requestId */ - requestId?: (string|null); - - /** RestoreClusterRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a RestoreClusterRequest. */ - class RestoreClusterRequest implements IRestoreClusterRequest { - - /** - * Constructs a new RestoreClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest); - - /** RestoreClusterRequest backupSource. */ - public backupSource?: (google.cloud.alloydb.v1beta.IBackupSource|null); - - /** RestoreClusterRequest continuousBackupSource. */ - public continuousBackupSource?: (google.cloud.alloydb.v1beta.IContinuousBackupSource|null); - - /** RestoreClusterRequest parent. */ - public parent: string; - - /** RestoreClusterRequest clusterId. */ - public clusterId: string; - - /** RestoreClusterRequest cluster. */ - public cluster?: (google.cloud.alloydb.v1beta.ICluster|null); - - /** RestoreClusterRequest requestId. */ - public requestId: string; - - /** RestoreClusterRequest validateOnly. */ - public validateOnly: boolean; - - /** RestoreClusterRequest source. */ - public source?: ("backupSource"|"continuousBackupSource"); - - /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreClusterRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IRestoreClusterRequest): google.cloud.alloydb.v1beta.RestoreClusterRequest; - - /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. - * @param message RestoreClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestoreClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestoreClusterRequest; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestoreClusterRequest; - - /** - * Verifies a RestoreClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestoreClusterRequest; - - /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @param message RestoreClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.RestoreClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest filter */ - filter?: (string|null); - - /** ListInstancesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest filter. */ - public filter: string; - - /** ListInstancesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesRequest): google.cloud.alloydb.v1beta.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1beta.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListInstancesResponse): google.cloud.alloydb.v1beta.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - - /** GetInstanceRequest view */ - view?: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** GetInstanceRequest view. */ - public view: (google.cloud.alloydb.v1beta.InstanceView|keyof typeof google.cloud.alloydb.v1beta.InstanceView); - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetInstanceRequest): google.cloud.alloydb.v1beta.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** CreateInstanceRequest requestId */ - requestId?: (string|null); - - /** CreateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** CreateInstanceRequest requestId. */ - public requestId: string; - - /** CreateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequest): google.cloud.alloydb.v1beta.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateSecondaryInstanceRequest. */ - interface ICreateSecondaryInstanceRequest { - - /** CreateSecondaryInstanceRequest parent */ - parent?: (string|null); - - /** CreateSecondaryInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateSecondaryInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId */ - requestId?: (string|null); - - /** CreateSecondaryInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateSecondaryInstanceRequest. */ - class CreateSecondaryInstanceRequest implements ICreateSecondaryInstanceRequest { - - /** - * Constructs a new CreateSecondaryInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest); - - /** CreateSecondaryInstanceRequest parent. */ - public parent: string; - - /** CreateSecondaryInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateSecondaryInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** CreateSecondaryInstanceRequest requestId. */ - public requestId: string; - - /** CreateSecondaryInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSecondaryInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. - * @param message CreateSecondaryInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; - - /** - * Verifies a CreateSecondaryInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSecondaryInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest; - - /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @param message CreateSecondaryInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSecondaryInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSecondaryInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateInstanceRequests. */ - interface ICreateInstanceRequests { - - /** CreateInstanceRequests createInstanceRequests */ - createInstanceRequests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequest[]|null); - } - - /** Represents a CreateInstanceRequests. */ - class CreateInstanceRequests implements ICreateInstanceRequests { - - /** - * Constructs a new CreateInstanceRequests. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests); - - /** CreateInstanceRequests createInstanceRequests. */ - public createInstanceRequests: google.cloud.alloydb.v1beta.ICreateInstanceRequest[]; - - /** - * Creates a new CreateInstanceRequests instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequests instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateInstanceRequests): google.cloud.alloydb.v1beta.CreateInstanceRequests; - - /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. - * @param message CreateInstanceRequests message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateInstanceRequests, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateInstanceRequests; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateInstanceRequests; - - /** - * Verifies a CreateInstanceRequests message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequests - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateInstanceRequests; - - /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @param message CreateInstanceRequests - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateInstanceRequests, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequests to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequests - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesRequest. */ - interface IBatchCreateInstancesRequest { - - /** BatchCreateInstancesRequest parent */ - parent?: (string|null); - - /** BatchCreateInstancesRequest requests */ - requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); - - /** BatchCreateInstancesRequest requestId */ - requestId?: (string|null); - } - - /** Represents a BatchCreateInstancesRequest. */ - class BatchCreateInstancesRequest implements IBatchCreateInstancesRequest { - - /** - * Constructs a new BatchCreateInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest); - - /** BatchCreateInstancesRequest parent. */ - public parent: string; - - /** BatchCreateInstancesRequest requests. */ - public requests?: (google.cloud.alloydb.v1beta.ICreateInstanceRequests|null); - - /** BatchCreateInstancesRequest requestId. */ - public requestId: string; - - /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; - - /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. - * @param message BatchCreateInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; - - /** - * Verifies a BatchCreateInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesRequest; - - /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @param message BatchCreateInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesResponse. */ - interface IBatchCreateInstancesResponse { - - /** BatchCreateInstancesResponse instances */ - instances?: (google.cloud.alloydb.v1beta.IInstance[]|null); - } - - /** Represents a BatchCreateInstancesResponse. */ - class BatchCreateInstancesResponse implements IBatchCreateInstancesResponse { - - /** - * Constructs a new BatchCreateInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse); - - /** BatchCreateInstancesResponse instances. */ - public instances: google.cloud.alloydb.v1beta.IInstance[]; - - /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; - - /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. - * @param message BatchCreateInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; - - /** - * Verifies a BatchCreateInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesResponse; - - /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @param message BatchCreateInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstancesMetadata. */ - interface IBatchCreateInstancesMetadata { - - /** BatchCreateInstancesMetadata instanceTargets */ - instanceTargets?: (string[]|null); - - /** BatchCreateInstancesMetadata instanceStatuses */ - instanceStatuses?: ({ [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }|null); - } - - /** Represents a BatchCreateInstancesMetadata. */ - class BatchCreateInstancesMetadata implements IBatchCreateInstancesMetadata { - - /** - * Constructs a new BatchCreateInstancesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata); - - /** BatchCreateInstancesMetadata instanceTargets. */ - public instanceTargets: string[]; - - /** BatchCreateInstancesMetadata instanceStatuses. */ - public instanceStatuses: { [k: string]: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus }; - - /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstancesMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; - - /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. - * @param message BatchCreateInstancesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; - - /** - * Verifies a BatchCreateInstancesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstancesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata; - - /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @param message BatchCreateInstancesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstancesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstancesMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchCreateInstanceStatus. */ - interface IBatchCreateInstanceStatus { - - /** BatchCreateInstanceStatus state */ - state?: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null); - - /** BatchCreateInstanceStatus errorMsg */ - errorMsg?: (string|null); - - /** BatchCreateInstanceStatus error */ - error?: (google.rpc.IStatus|null); - - /** BatchCreateInstanceStatus type */ - type?: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType|null); - } - - /** Represents a BatchCreateInstanceStatus. */ - class BatchCreateInstanceStatus implements IBatchCreateInstanceStatus { - - /** - * Constructs a new BatchCreateInstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus); - - /** BatchCreateInstanceStatus state. */ - public state: (google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|keyof typeof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State); - - /** BatchCreateInstanceStatus errorMsg. */ - public errorMsg: string; - - /** BatchCreateInstanceStatus error. */ - public error?: (google.rpc.IStatus|null); - - /** BatchCreateInstanceStatus type. */ - public type: (google.cloud.alloydb.v1beta.Instance.InstanceType|keyof typeof google.cloud.alloydb.v1beta.Instance.InstanceType); - - /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateInstanceStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; - - /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. - * @param message BatchCreateInstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; - - /** - * Verifies a BatchCreateInstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateInstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.BatchCreateInstanceStatus; - - /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @param message BatchCreateInstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.BatchCreateInstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchCreateInstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchCreateInstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchCreateInstanceStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING_CREATE = 1, - READY = 2, - CREATING = 3, - DELETING = 4, - FAILED = 5, - ROLLED_BACK = 6 - } - } - - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { - - /** UpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance */ - instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** UpdateInstanceRequest requestId */ - requestId?: (string|null); - - /** UpdateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateInstanceRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { - - /** - * Constructs a new UpdateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest); - - /** UpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateInstanceRequest instance. */ - public instance?: (google.cloud.alloydb.v1beta.IInstance|null); - - /** UpdateInstanceRequest requestId. */ - public requestId: string; - - /** UpdateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateInstanceRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateInstanceRequest): google.cloud.alloydb.v1beta.UpdateInstanceRequest; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. - * @param message UpdateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateInstanceRequest; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateInstanceRequest; - - /** - * Verifies an UpdateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateInstanceRequest; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @param message UpdateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - - /** DeleteInstanceRequest requestId */ - requestId?: (string|null); - - /** DeleteInstanceRequest etag */ - etag?: (string|null); - - /** DeleteInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** DeleteInstanceRequest requestId. */ - public requestId: string; - - /** DeleteInstanceRequest etag. */ - public etag: string; - - /** DeleteInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteInstanceRequest): google.cloud.alloydb.v1beta.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FailoverInstanceRequest. */ - interface IFailoverInstanceRequest { - - /** FailoverInstanceRequest name */ - name?: (string|null); - - /** FailoverInstanceRequest requestId */ - requestId?: (string|null); - - /** FailoverInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a FailoverInstanceRequest. */ - class FailoverInstanceRequest implements IFailoverInstanceRequest { - - /** - * Constructs a new FailoverInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest); - - /** FailoverInstanceRequest name. */ - public name: string; - - /** FailoverInstanceRequest requestId. */ - public requestId: string; - - /** FailoverInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FailoverInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IFailoverInstanceRequest): google.cloud.alloydb.v1beta.FailoverInstanceRequest; - - /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. - * @param message FailoverInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IFailoverInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.FailoverInstanceRequest; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.FailoverInstanceRequest; - - /** - * Verifies a FailoverInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FailoverInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.FailoverInstanceRequest; - - /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @param message FailoverInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.FailoverInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FailoverInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FailoverInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InjectFaultRequest. */ - interface IInjectFaultRequest { - - /** InjectFaultRequest faultType */ - faultType?: (google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|null); - - /** InjectFaultRequest name */ - name?: (string|null); - - /** InjectFaultRequest requestId */ - requestId?: (string|null); - - /** InjectFaultRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an InjectFaultRequest. */ - class InjectFaultRequest implements IInjectFaultRequest { - - /** - * Constructs a new InjectFaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IInjectFaultRequest); - - /** InjectFaultRequest faultType. */ - public faultType: (google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|keyof typeof google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType); - - /** InjectFaultRequest name. */ - public name: string; - - /** InjectFaultRequest requestId. */ - public requestId: string; - - /** InjectFaultRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new InjectFaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InjectFaultRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IInjectFaultRequest): google.cloud.alloydb.v1beta.InjectFaultRequest; - - /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. - * @param message InjectFaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. - * @param message InjectFaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IInjectFaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.InjectFaultRequest; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.InjectFaultRequest; - - /** - * Verifies an InjectFaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InjectFaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.InjectFaultRequest; - - /** - * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. - * @param message InjectFaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.InjectFaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InjectFaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InjectFaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InjectFaultRequest { - - /** FaultType enum. */ - enum FaultType { - FAULT_TYPE_UNSPECIFIED = 0, - STOP_VM = 1 - } - } - - /** Properties of a RestartInstanceRequest. */ - interface IRestartInstanceRequest { - - /** RestartInstanceRequest name */ - name?: (string|null); - - /** RestartInstanceRequest requestId */ - requestId?: (string|null); - - /** RestartInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** RestartInstanceRequest nodeIds */ - nodeIds?: (string[]|null); - } - - /** Represents a RestartInstanceRequest. */ - class RestartInstanceRequest implements IRestartInstanceRequest { - - /** - * Constructs a new RestartInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest); - - /** RestartInstanceRequest name. */ - public name: string; - - /** RestartInstanceRequest requestId. */ - public requestId: string; - - /** RestartInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** RestartInstanceRequest nodeIds. */ - public nodeIds: string[]; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestartInstanceRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IRestartInstanceRequest): google.cloud.alloydb.v1beta.RestartInstanceRequest; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. - * @param message RestartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.RestartInstanceRequest; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.RestartInstanceRequest; - - /** - * Verifies a RestartInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestartInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.RestartInstanceRequest; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @param message RestartInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestartInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlRequest. */ - interface IExecuteSqlRequest { - - /** ExecuteSqlRequest password */ - password?: (string|null); - - /** ExecuteSqlRequest instance */ - instance?: (string|null); - - /** ExecuteSqlRequest database */ - database?: (string|null); - - /** ExecuteSqlRequest user */ - user?: (string|null); - - /** ExecuteSqlRequest sqlStatement */ - sqlStatement?: (string|null); - - /** ExecuteSqlRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents an ExecuteSqlRequest. */ - class ExecuteSqlRequest implements IExecuteSqlRequest { - - /** - * Constructs a new ExecuteSqlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IExecuteSqlRequest); - - /** ExecuteSqlRequest password. */ - public password?: (string|null); - - /** ExecuteSqlRequest instance. */ - public instance: string; - - /** ExecuteSqlRequest database. */ - public database: string; - - /** ExecuteSqlRequest user. */ - public user: string; - - /** ExecuteSqlRequest sqlStatement. */ - public sqlStatement: string; - - /** ExecuteSqlRequest validateOnly. */ - public validateOnly: boolean; - - /** ExecuteSqlRequest userCredential. */ - public userCredential?: "password"; - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IExecuteSqlRequest): google.cloud.alloydb.v1beta.ExecuteSqlRequest; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. - * @param message ExecuteSqlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExecuteSqlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExecuteSqlRequest; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExecuteSqlRequest; - - /** - * Verifies an ExecuteSqlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExecuteSqlRequest; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @param message ExecuteSqlRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExecuteSqlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlResponse. */ - interface IExecuteSqlResponse { - - /** ExecuteSqlResponse sqlResults */ - sqlResults?: (google.cloud.alloydb.v1beta.ISqlResult[]|null); - - /** ExecuteSqlResponse metadata */ - metadata?: (google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null); - } - - /** Represents an ExecuteSqlResponse. */ - class ExecuteSqlResponse implements IExecuteSqlResponse { - - /** - * Constructs a new ExecuteSqlResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IExecuteSqlResponse); - - /** ExecuteSqlResponse sqlResults. */ - public sqlResults: google.cloud.alloydb.v1beta.ISqlResult[]; - - /** ExecuteSqlResponse metadata. */ - public metadata?: (google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null); - - /** - * Creates a new ExecuteSqlResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IExecuteSqlResponse): google.cloud.alloydb.v1beta.ExecuteSqlResponse; - - /** - * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. - * @param message ExecuteSqlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. - * @param message ExecuteSqlResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExecuteSqlResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExecuteSqlResponse; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExecuteSqlResponse; - - /** - * Verifies an ExecuteSqlResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExecuteSqlResponse; - - /** - * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. - * @param message ExecuteSqlResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExecuteSqlResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecuteSqlMetadata. */ - interface IExecuteSqlMetadata { - - /** ExecuteSqlMetadata message */ - message?: (string|null); - - /** ExecuteSqlMetadata partialResult */ - partialResult?: (boolean|null); - - /** ExecuteSqlMetadata sqlStatementExecutionDuration */ - sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); - - /** ExecuteSqlMetadata status */ - status?: (google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|null); - } - - /** Represents an ExecuteSqlMetadata. */ - class ExecuteSqlMetadata implements IExecuteSqlMetadata { - - /** - * Constructs a new ExecuteSqlMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IExecuteSqlMetadata); - - /** ExecuteSqlMetadata message. */ - public message: string; - - /** ExecuteSqlMetadata partialResult. */ - public partialResult: boolean; - - /** ExecuteSqlMetadata sqlStatementExecutionDuration. */ - public sqlStatementExecutionDuration?: (google.protobuf.IDuration|null); - - /** ExecuteSqlMetadata status. */ - public status: (google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|keyof typeof google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status); - - /** - * Creates a new ExecuteSqlMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecuteSqlMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IExecuteSqlMetadata): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; - - /** - * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. - * @param message ExecuteSqlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. - * @param message ExecuteSqlMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IExecuteSqlMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; - - /** - * Verifies an ExecuteSqlMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecuteSqlMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ExecuteSqlMetadata; - - /** - * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. - * @param message ExecuteSqlMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ExecuteSqlMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecuteSqlMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecuteSqlMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecuteSqlMetadata { - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, - OK = 1, - PARTIAL = 2, - ERROR = 3 - } - } - - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { - - /** - * Constructs a new ListBackupsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; - - /** ListBackupsRequest pageToken. */ - public pageToken: string; - - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsRequest): google.cloud.alloydb.v1beta.ListBackupsRequest; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsRequest; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsRequest; - - /** - * Verifies a ListBackupsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsRequest; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.cloud.alloydb.v1beta.IBackup[]|null); - - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { - - /** - * Constructs a new ListBackupsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse); - - /** ListBackupsResponse backups. */ - public backups: google.cloud.alloydb.v1beta.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListBackupsResponse): google.cloud.alloydb.v1beta.ListBackupsResponse; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListBackupsResponse; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListBackupsResponse; - - /** - * Verifies a ListBackupsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListBackupsResponse; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { - - /** GetBackupRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { - - /** - * Constructs a new GetBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest); - - /** GetBackupRequest name. */ - public name: string; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetBackupRequest): google.cloud.alloydb.v1beta.GetBackupRequest; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetBackupRequest; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetBackupRequest; - - /** - * Verifies a GetBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetBackupRequest; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { - - /** CreateBackupRequest parent */ - parent?: (string|null); - - /** CreateBackupRequest backupId */ - backupId?: (string|null); - - /** CreateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1beta.IBackup|null); - - /** CreateBackupRequest requestId */ - requestId?: (string|null); - - /** CreateBackupRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { - - /** - * Constructs a new CreateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest); - - /** CreateBackupRequest parent. */ - public parent: string; - - /** CreateBackupRequest backupId. */ - public backupId: string; - - /** CreateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1beta.IBackup|null); - - /** CreateBackupRequest requestId. */ - public requestId: string; - - /** CreateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateBackupRequest): google.cloud.alloydb.v1beta.CreateBackupRequest; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateBackupRequest; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateBackupRequest; - - /** - * Verifies a CreateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateBackupRequest; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup */ - backup?: (google.cloud.alloydb.v1beta.IBackup|null); - - /** UpdateBackupRequest requestId */ - requestId?: (string|null); - - /** UpdateBackupRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateBackupRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { - - /** - * Constructs a new UpdateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.alloydb.v1beta.IBackup|null); - - /** UpdateBackupRequest requestId. */ - public requestId: string; - - /** UpdateBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateBackupRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateBackupRequest): google.cloud.alloydb.v1beta.UpdateBackupRequest; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateBackupRequest; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateBackupRequest; - - /** - * Verifies an UpdateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateBackupRequest; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { - - /** DeleteBackupRequest name */ - name?: (string|null); - - /** DeleteBackupRequest requestId */ - requestId?: (string|null); - - /** DeleteBackupRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteBackupRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { - - /** - * Constructs a new DeleteBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** DeleteBackupRequest requestId. */ - public requestId: string; - - /** DeleteBackupRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteBackupRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteBackupRequest): google.cloud.alloydb.v1beta.DeleteBackupRequest; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteBackupRequest; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteBackupRequest; - - /** - * Verifies a DeleteBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteBackupRequest; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSupportedDatabaseFlagsRequest. */ - interface IListSupportedDatabaseFlagsRequest { - - /** ListSupportedDatabaseFlagsRequest parent */ - parent?: (string|null); - - /** ListSupportedDatabaseFlagsRequest pageSize */ - pageSize?: (number|null); - - /** ListSupportedDatabaseFlagsRequest pageToken */ - pageToken?: (string|null); - - /** ListSupportedDatabaseFlagsRequest scope */ - scope?: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null); - } - - /** Represents a ListSupportedDatabaseFlagsRequest. */ - class ListSupportedDatabaseFlagsRequest implements IListSupportedDatabaseFlagsRequest { - - /** - * Constructs a new ListSupportedDatabaseFlagsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest); - - /** ListSupportedDatabaseFlagsRequest parent. */ - public parent: string; - - /** ListSupportedDatabaseFlagsRequest pageSize. */ - public pageSize: number; - - /** ListSupportedDatabaseFlagsRequest pageToken. */ - public pageToken: string; - - /** ListSupportedDatabaseFlagsRequest scope. */ - public scope: (google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|keyof typeof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope); - - /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; - - /** - * Verifies a ListSupportedDatabaseFlagsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSupportedDatabaseFlagsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSupportedDatabaseFlagsResponse. */ - interface IListSupportedDatabaseFlagsResponse { - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags */ - supportedDatabaseFlags?: (google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]|null); - - /** ListSupportedDatabaseFlagsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSupportedDatabaseFlagsResponse. */ - class ListSupportedDatabaseFlagsResponse implements IListSupportedDatabaseFlagsResponse { - - /** - * Constructs a new ListSupportedDatabaseFlagsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse); - - /** ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. */ - public supportedDatabaseFlags: google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]; - - /** ListSupportedDatabaseFlagsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSupportedDatabaseFlagsResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @param message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; - - /** - * Verifies a ListSupportedDatabaseFlagsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSupportedDatabaseFlagsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @param message ListSupportedDatabaseFlagsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateClientCertificateRequest. */ - interface IGenerateClientCertificateRequest { - - /** GenerateClientCertificateRequest parent */ - parent?: (string|null); - - /** GenerateClientCertificateRequest requestId */ - requestId?: (string|null); - - /** GenerateClientCertificateRequest pemCsr */ - pemCsr?: (string|null); - - /** GenerateClientCertificateRequest certDuration */ - certDuration?: (google.protobuf.IDuration|null); - - /** GenerateClientCertificateRequest publicKey */ - publicKey?: (string|null); - - /** GenerateClientCertificateRequest useMetadataExchange */ - useMetadataExchange?: (boolean|null); - } - - /** Represents a GenerateClientCertificateRequest. */ - class GenerateClientCertificateRequest implements IGenerateClientCertificateRequest { - - /** - * Constructs a new GenerateClientCertificateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest); - - /** GenerateClientCertificateRequest parent. */ - public parent: string; - - /** GenerateClientCertificateRequest requestId. */ - public requestId: string; - - /** GenerateClientCertificateRequest pemCsr. */ - public pemCsr: string; - - /** GenerateClientCertificateRequest certDuration. */ - public certDuration?: (google.protobuf.IDuration|null); - - /** GenerateClientCertificateRequest publicKey. */ - public publicKey: string; - - /** GenerateClientCertificateRequest useMetadataExchange. */ - public useMetadataExchange: boolean; - - /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateClientCertificateRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; - - /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. - * @param message GenerateClientCertificateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; - - /** - * Verifies a GenerateClientCertificateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateClientCertificateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateRequest; - - /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @param message GenerateClientCertificateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateClientCertificateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateClientCertificateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenerateClientCertificateResponse. */ - interface IGenerateClientCertificateResponse { - - /** GenerateClientCertificateResponse pemCertificate */ - pemCertificate?: (string|null); - - /** GenerateClientCertificateResponse pemCertificateChain */ - pemCertificateChain?: (string[]|null); - - /** GenerateClientCertificateResponse caCert */ - caCert?: (string|null); - } - - /** Represents a GenerateClientCertificateResponse. */ - class GenerateClientCertificateResponse implements IGenerateClientCertificateResponse { - - /** - * Constructs a new GenerateClientCertificateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse); - - /** GenerateClientCertificateResponse pemCertificate. */ - public pemCertificate: string; - - /** GenerateClientCertificateResponse pemCertificateChain. */ - public pemCertificateChain: string[]; - - /** GenerateClientCertificateResponse caCert. */ - public caCert: string; - - /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GenerateClientCertificateResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; - - /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. - * @param message GenerateClientCertificateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; - - /** - * Verifies a GenerateClientCertificateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenerateClientCertificateResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GenerateClientCertificateResponse; - - /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @param message GenerateClientCertificateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenerateClientCertificateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenerateClientCertificateResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetConnectionInfoRequest. */ - interface IGetConnectionInfoRequest { - - /** GetConnectionInfoRequest parent */ - parent?: (string|null); - - /** GetConnectionInfoRequest requestId */ - requestId?: (string|null); - } - - /** Represents a GetConnectionInfoRequest. */ - class GetConnectionInfoRequest implements IGetConnectionInfoRequest { - - /** - * Constructs a new GetConnectionInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest); - - /** GetConnectionInfoRequest parent. */ - public parent: string; - - /** GetConnectionInfoRequest requestId. */ - public requestId: string; - - /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetConnectionInfoRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; - - /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. - * @param message GetConnectionInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; - - /** - * Verifies a GetConnectionInfoRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetConnectionInfoRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetConnectionInfoRequest; - - /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @param message GetConnectionInfoRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GetConnectionInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetConnectionInfoRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetConnectionInfoRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata batchCreateInstancesMetadata */ - batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata promoteClusterStatus */ - promoteClusterStatus?: (google.cloud.alloydb.v1beta.IPromoteClusterStatus|null); - - /** OperationMetadata upgradeClusterStatus */ - upgradeClusterStatus?: (google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null); - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IOperationMetadata); - - /** OperationMetadata batchCreateInstancesMetadata. */ - public batchCreateInstancesMetadata?: (google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null); - - /** OperationMetadata promoteClusterStatus. */ - public promoteClusterStatus?: (google.cloud.alloydb.v1beta.IPromoteClusterStatus|null); - - /** OperationMetadata upgradeClusterStatus. */ - public upgradeClusterStatus?: (google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** OperationMetadata requestSpecific. */ - public requestSpecific?: ("batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"); - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IOperationMetadata): google.cloud.alloydb.v1beta.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PromoteClusterStatus. */ - interface IPromoteClusterStatus { - - /** PromoteClusterStatus state */ - state?: (google.cloud.alloydb.v1beta.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1beta.PromoteClusterStatus.State|null); - } - - /** Represents a PromoteClusterStatus. */ - class PromoteClusterStatus implements IPromoteClusterStatus { - - /** - * Constructs a new PromoteClusterStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IPromoteClusterStatus); - - /** PromoteClusterStatus state. */ - public state: (google.cloud.alloydb.v1beta.PromoteClusterStatus.State|keyof typeof google.cloud.alloydb.v1beta.PromoteClusterStatus.State); - - /** - * Creates a new PromoteClusterStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns PromoteClusterStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IPromoteClusterStatus): google.cloud.alloydb.v1beta.PromoteClusterStatus; - - /** - * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. - * @param message PromoteClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. - * @param message PromoteClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IPromoteClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.PromoteClusterStatus; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.PromoteClusterStatus; - - /** - * Verifies a PromoteClusterStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PromoteClusterStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.PromoteClusterStatus; - - /** - * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. - * @param message PromoteClusterStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.PromoteClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PromoteClusterStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PromoteClusterStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PromoteClusterStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PROMOTE_CLUSTER_AVAILABLE_FOR_READ = 1, - PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE = 2, - PROMOTE_CLUSTER_COMPLETED = 3 - } - } - - /** Properties of an UpgradeClusterStatus. */ - interface IUpgradeClusterStatus { - - /** UpgradeClusterStatus state */ - state?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); - - /** UpgradeClusterStatus cancellable */ - cancellable?: (boolean|null); - - /** UpgradeClusterStatus sourceVersion */ - sourceVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); - - /** UpgradeClusterStatus targetVersion */ - targetVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); - - /** UpgradeClusterStatus stages */ - stages?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus[]|null); - } - - /** Represents an UpgradeClusterStatus. */ - class UpgradeClusterStatus implements IUpgradeClusterStatus { - - /** - * Constructs a new UpgradeClusterStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterStatus); - - /** UpgradeClusterStatus state. */ - public state: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); - - /** UpgradeClusterStatus cancellable. */ - public cancellable: boolean; - - /** UpgradeClusterStatus sourceVersion. */ - public sourceVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); - - /** UpgradeClusterStatus targetVersion. */ - public targetVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); - - /** UpgradeClusterStatus stages. */ - public stages: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus[]; - - /** - * Creates a new UpgradeClusterStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns UpgradeClusterStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpgradeClusterStatus): google.cloud.alloydb.v1beta.UpgradeClusterStatus; - - /** - * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. - * @param message UpgradeClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. - * @param message UpgradeClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpgradeClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus; - - /** - * Verifies an UpgradeClusterStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeClusterStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus; - - /** - * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. - * @param message UpgradeClusterStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeClusterStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpgradeClusterStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UpgradeClusterStatus { - - /** Properties of a StageStatus. */ - interface IStageStatus { - - /** StageStatus readPoolInstancesUpgrade */ - readPoolInstancesUpgrade?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); - - /** StageStatus stage */ - stage?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null); - - /** StageStatus state */ - state?: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null); - - /** StageStatus schedule */ - schedule?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null); - } - - /** Represents a StageStatus. */ - class StageStatus implements IStageStatus { - - /** - * Constructs a new StageStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus); - - /** StageStatus readPoolInstancesUpgrade. */ - public readPoolInstancesUpgrade?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null); - - /** StageStatus stage. */ - public stage: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage); - - /** StageStatus state. */ - public state: (google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|keyof typeof google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status); - - /** StageStatus schedule. */ - public schedule?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null); - - /** StageStatus stageSpecificStatus. */ - public stageSpecificStatus?: "readPoolInstancesUpgrade"; - - /** - * Creates a new StageStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns StageStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; - - /** - * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @param message StageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @param message StageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; - - /** - * Decodes a StageStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; - - /** - * Verifies a StageStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus; - - /** - * Creates a plain object from a StageStatus message. Also converts values to other types if specified. - * @param message StageStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StageStatus { - - /** Properties of a StageSchedule. */ - interface IStageSchedule { - - /** StageSchedule estimatedStartTime */ - estimatedStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualStartTime */ - actualStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule estimatedEndTime */ - estimatedEndTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualEndTime */ - actualEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a StageSchedule. */ - class StageSchedule implements IStageSchedule { - - /** - * Constructs a new StageSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule); - - /** StageSchedule estimatedStartTime. */ - public estimatedStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualStartTime. */ - public actualStartTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule estimatedEndTime. */ - public estimatedEndTime?: (google.protobuf.ITimestamp|null); - - /** StageSchedule actualEndTime. */ - public actualEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new StageSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns StageSchedule instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @param message StageSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @param message StageSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StageSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Decodes a StageSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Verifies a StageSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StageSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule; - - /** - * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. - * @param message StageSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StageSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StageSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReadPoolInstancesUpgradeStageStatus. */ - interface IReadPoolInstancesUpgradeStageStatus { - - /** ReadPoolInstancesUpgradeStageStatus upgradeStats */ - upgradeStats?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); - } - - /** Represents a ReadPoolInstancesUpgradeStageStatus. */ - class ReadPoolInstancesUpgradeStageStatus implements IReadPoolInstancesUpgradeStageStatus { - - /** - * Constructs a new ReadPoolInstancesUpgradeStageStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus); - - /** ReadPoolInstancesUpgradeStageStatus upgradeStats. */ - public upgradeStats?: (google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null); - - /** - * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadPoolInstancesUpgradeStageStatus instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @param message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Verifies a ReadPoolInstancesUpgradeStageStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadPoolInstancesUpgradeStageStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus; - - /** - * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. - * @param message ReadPoolInstancesUpgradeStageStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadPoolInstancesUpgradeStageStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadPoolInstancesUpgradeStageStatus { - - /** Properties of a Stats. */ - interface IStats { - - /** Stats notStarted */ - notStarted?: (number|null); - - /** Stats ongoing */ - ongoing?: (number|null); - - /** Stats success */ - success?: (number|null); - - /** Stats failed */ - failed?: (number|null); - } - - /** Represents a Stats. */ - class Stats implements IStats { - - /** - * Constructs a new Stats. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats); - - /** Stats notStarted. */ - public notStarted: number; - - /** Stats ongoing. */ - public ongoing: number; - - /** Stats success. */ - public success: number; - - /** Stats failed. */ - public failed: number; - - /** - * Creates a new Stats instance using the specified properties. - * @param [properties] Properties to set - * @returns Stats instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @param message Stats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Verifies a Stats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Stats - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @param message Stats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Stats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Stats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a ListUsersRequest. */ - interface IListUsersRequest { - - /** ListUsersRequest parent */ - parent?: (string|null); - - /** ListUsersRequest pageSize */ - pageSize?: (number|null); - - /** ListUsersRequest pageToken */ - pageToken?: (string|null); - - /** ListUsersRequest filter */ - filter?: (string|null); - - /** ListUsersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListUsersRequest. */ - class ListUsersRequest implements IListUsersRequest { - - /** - * Constructs a new ListUsersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListUsersRequest); - - /** ListUsersRequest parent. */ - public parent: string; - - /** ListUsersRequest pageSize. */ - public pageSize: number; - - /** ListUsersRequest pageToken. */ - public pageToken: string; - - /** ListUsersRequest filter. */ - public filter: string; - - /** ListUsersRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListUsersRequest): google.cloud.alloydb.v1beta.ListUsersRequest; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListUsersRequest; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListUsersRequest; - - /** - * Verifies a ListUsersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListUsersRequest; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @param message ListUsersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListUsersResponse. */ - interface IListUsersResponse { - - /** ListUsersResponse users */ - users?: (google.cloud.alloydb.v1beta.IUser[]|null); - - /** ListUsersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListUsersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListUsersResponse. */ - class ListUsersResponse implements IListUsersResponse { - - /** - * Constructs a new ListUsersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListUsersResponse); - - /** ListUsersResponse users. */ - public users: google.cloud.alloydb.v1beta.IUser[]; - - /** ListUsersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListUsersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListUsersResponse): google.cloud.alloydb.v1beta.ListUsersResponse; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListUsersResponse; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListUsersResponse; - - /** - * Verifies a ListUsersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListUsersResponse; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @param message ListUsersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetUserRequest. */ - interface IGetUserRequest { - - /** GetUserRequest name */ - name?: (string|null); - } - - /** Represents a GetUserRequest. */ - class GetUserRequest implements IGetUserRequest { - - /** - * Constructs a new GetUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IGetUserRequest); - - /** GetUserRequest name. */ - public name: string; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IGetUserRequest): google.cloud.alloydb.v1beta.GetUserRequest; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.GetUserRequest; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.GetUserRequest; - - /** - * Verifies a GetUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.GetUserRequest; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @param message GetUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateUserRequest. */ - interface ICreateUserRequest { - - /** CreateUserRequest parent */ - parent?: (string|null); - - /** CreateUserRequest userId */ - userId?: (string|null); - - /** CreateUserRequest user */ - user?: (google.cloud.alloydb.v1beta.IUser|null); - - /** CreateUserRequest requestId */ - requestId?: (string|null); - - /** CreateUserRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateUserRequest. */ - class CreateUserRequest implements ICreateUserRequest { - - /** - * Constructs a new CreateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateUserRequest); - - /** CreateUserRequest parent. */ - public parent: string; - - /** CreateUserRequest userId. */ - public userId: string; - - /** CreateUserRequest user. */ - public user?: (google.cloud.alloydb.v1beta.IUser|null); - - /** CreateUserRequest requestId. */ - public requestId: string; - - /** CreateUserRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateUserRequest): google.cloud.alloydb.v1beta.CreateUserRequest; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateUserRequest; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateUserRequest; - - /** - * Verifies a CreateUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateUserRequest; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @param message CreateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateUserRequest. */ - interface IUpdateUserRequest { - - /** UpdateUserRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateUserRequest user */ - user?: (google.cloud.alloydb.v1beta.IUser|null); - - /** UpdateUserRequest requestId */ - requestId?: (string|null); - - /** UpdateUserRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateUserRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateUserRequest. */ - class UpdateUserRequest implements IUpdateUserRequest { - - /** - * Constructs a new UpdateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IUpdateUserRequest); - - /** UpdateUserRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateUserRequest user. */ - public user?: (google.cloud.alloydb.v1beta.IUser|null); - - /** UpdateUserRequest requestId. */ - public requestId: string; - - /** UpdateUserRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateUserRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IUpdateUserRequest): google.cloud.alloydb.v1beta.UpdateUserRequest; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.UpdateUserRequest; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.UpdateUserRequest; - - /** - * Verifies an UpdateUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.UpdateUserRequest; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @param message UpdateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteUserRequest. */ - interface IDeleteUserRequest { - - /** DeleteUserRequest name */ - name?: (string|null); - - /** DeleteUserRequest requestId */ - requestId?: (string|null); - - /** DeleteUserRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a DeleteUserRequest. */ - class DeleteUserRequest implements IDeleteUserRequest { - - /** - * Constructs a new DeleteUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IDeleteUserRequest); - - /** DeleteUserRequest name. */ - public name: string; - - /** DeleteUserRequest requestId. */ - public requestId: string; - - /** DeleteUserRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteUserRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IDeleteUserRequest): google.cloud.alloydb.v1beta.DeleteUserRequest; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.DeleteUserRequest; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.DeleteUserRequest; - - /** - * Verifies a DeleteUserRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.DeleteUserRequest; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @param message DeleteUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesRequest. */ - interface IListDatabasesRequest { - - /** ListDatabasesRequest parent */ - parent?: (string|null); - - /** ListDatabasesRequest pageSize */ - pageSize?: (number|null); - - /** ListDatabasesRequest pageToken */ - pageToken?: (string|null); - - /** ListDatabasesRequest filter */ - filter?: (string|null); - } - - /** Represents a ListDatabasesRequest. */ - class ListDatabasesRequest implements IListDatabasesRequest { - - /** - * Constructs a new ListDatabasesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListDatabasesRequest); - - /** ListDatabasesRequest parent. */ - public parent: string; - - /** ListDatabasesRequest pageSize. */ - public pageSize: number; - - /** ListDatabasesRequest pageToken. */ - public pageToken: string; - - /** ListDatabasesRequest filter. */ - public filter: string; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListDatabasesRequest): google.cloud.alloydb.v1beta.ListDatabasesRequest; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. - * @param message ListDatabasesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListDatabasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListDatabasesRequest; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListDatabasesRequest; - - /** - * Verifies a ListDatabasesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListDatabasesRequest; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @param message ListDatabasesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListDatabasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDatabasesResponse. */ - interface IListDatabasesResponse { - - /** ListDatabasesResponse databases */ - databases?: (google.cloud.alloydb.v1beta.IDatabase[]|null); - - /** ListDatabasesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListDatabasesResponse. */ - class ListDatabasesResponse implements IListDatabasesResponse { - - /** - * Constructs a new ListDatabasesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.IListDatabasesResponse); - - /** ListDatabasesResponse databases. */ - public databases: google.cloud.alloydb.v1beta.IDatabase[]; - - /** ListDatabasesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDatabasesResponse instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.IListDatabasesResponse): google.cloud.alloydb.v1beta.ListDatabasesResponse; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. - * @param message ListDatabasesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.IListDatabasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.ListDatabasesResponse; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.ListDatabasesResponse; - - /** - * Verifies a ListDatabasesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatabasesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.ListDatabasesResponse; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @param message ListDatabasesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.ListDatabasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDatabasesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateDatabaseRequest. */ - interface ICreateDatabaseRequest { - - /** CreateDatabaseRequest parent */ - parent?: (string|null); - - /** CreateDatabaseRequest databaseId */ - databaseId?: (string|null); - - /** CreateDatabaseRequest database */ - database?: (google.cloud.alloydb.v1beta.IDatabase|null); - } - - /** Represents a CreateDatabaseRequest. */ - class CreateDatabaseRequest implements ICreateDatabaseRequest { - - /** - * Constructs a new CreateDatabaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ICreateDatabaseRequest); - - /** CreateDatabaseRequest parent. */ - public parent: string; - - /** CreateDatabaseRequest databaseId. */ - public databaseId: string; - - /** CreateDatabaseRequest database. */ - public database?: (google.cloud.alloydb.v1beta.IDatabase|null); - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDatabaseRequest instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ICreateDatabaseRequest): google.cloud.alloydb.v1beta.CreateDatabaseRequest; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. - * @param message CreateDatabaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ICreateDatabaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.CreateDatabaseRequest; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.CreateDatabaseRequest; - - /** - * Verifies a CreateDatabaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDatabaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.CreateDatabaseRequest; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @param message CreateDatabaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.CreateDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResult. */ - interface ISqlResult { - - /** SqlResult columns */ - columns?: (google.cloud.alloydb.v1beta.ISqlResultColumn[]|null); - - /** SqlResult rows */ - rows?: (google.cloud.alloydb.v1beta.ISqlResultRow[]|null); - } - - /** Represents a SqlResult. */ - class SqlResult implements ISqlResult { - - /** - * Constructs a new SqlResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISqlResult); - - /** SqlResult columns. */ - public columns: google.cloud.alloydb.v1beta.ISqlResultColumn[]; - - /** SqlResult rows. */ - public rows: google.cloud.alloydb.v1beta.ISqlResultRow[]; - - /** - * Creates a new SqlResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResult instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISqlResult): google.cloud.alloydb.v1beta.SqlResult; - - /** - * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. - * @param message SqlResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. - * @param message SqlResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResult; - - /** - * Decodes a SqlResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResult; - - /** - * Verifies a SqlResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResult; - - /** - * Creates a plain object from a SqlResult message. Also converts values to other types if specified. - * @param message SqlResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SqlResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultColumn. */ - interface ISqlResultColumn { - - /** SqlResultColumn name */ - name?: (string|null); - - /** SqlResultColumn type */ - type?: (string|null); - } - - /** Represents a SqlResultColumn. */ - class SqlResultColumn implements ISqlResultColumn { - - /** - * Constructs a new SqlResultColumn. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISqlResultColumn); - - /** SqlResultColumn name. */ - public name: string; - - /** SqlResultColumn type. */ - public type: string; - - /** - * Creates a new SqlResultColumn instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultColumn instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISqlResultColumn): google.cloud.alloydb.v1beta.SqlResultColumn; - - /** - * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. - * @param message SqlResultColumn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. - * @param message SqlResultColumn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResultColumn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResultColumn; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResultColumn; - - /** - * Verifies a SqlResultColumn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultColumn - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResultColumn; - - /** - * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. - * @param message SqlResultColumn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SqlResultColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultColumn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultColumn - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultRow. */ - interface ISqlResultRow { - - /** SqlResultRow values */ - values?: (google.cloud.alloydb.v1beta.ISqlResultValue[]|null); - } - - /** Represents a SqlResultRow. */ - class SqlResultRow implements ISqlResultRow { - - /** - * Constructs a new SqlResultRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISqlResultRow); - - /** SqlResultRow values. */ - public values: google.cloud.alloydb.v1beta.ISqlResultValue[]; - - /** - * Creates a new SqlResultRow instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultRow instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISqlResultRow): google.cloud.alloydb.v1beta.SqlResultRow; - - /** - * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. - * @param message SqlResultRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. - * @param message SqlResultRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResultRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResultRow; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResultRow; - - /** - * Verifies a SqlResultRow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResultRow; - - /** - * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. - * @param message SqlResultRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SqlResultRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultRow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SqlResultValue. */ - interface ISqlResultValue { - - /** SqlResultValue value */ - value?: (string|null); - - /** SqlResultValue nullValue */ - nullValue?: (boolean|null); - } - - /** Represents a SqlResultValue. */ - class SqlResultValue implements ISqlResultValue { - - /** - * Constructs a new SqlResultValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.alloydb.v1beta.ISqlResultValue); - - /** SqlResultValue value. */ - public value?: (string|null); - - /** SqlResultValue nullValue. */ - public nullValue?: (boolean|null); - - /** - * Creates a new SqlResultValue instance using the specified properties. - * @param [properties] Properties to set - * @returns SqlResultValue instance - */ - public static create(properties?: google.cloud.alloydb.v1beta.ISqlResultValue): google.cloud.alloydb.v1beta.SqlResultValue; - - /** - * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. - * @param message SqlResultValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.alloydb.v1beta.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. - * @param message SqlResultValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.alloydb.v1beta.ISqlResultValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.SqlResultValue; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.SqlResultValue; - - /** - * Verifies a SqlResultValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SqlResultValue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.SqlResultValue; - - /** - * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. - * @param message SqlResultValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.alloydb.v1beta.SqlResultValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SqlResultValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SqlResultValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; - - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - - /** - * Verifies an Int64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; - - /** - * Verifies a UInt64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; - - /** - * Verifies an Int32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; - - /** - * Verifies a UInt32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; - - /** - * Verifies a BoolValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; - - /** - * Verifies a StringValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; - - /** - * Verifies a BytesValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a Date. */ - interface IDate { - - /** Date year */ - year?: (number|null); - - /** Date month */ - month?: (number|null); - - /** Date day */ - day?: (number|null); - } - - /** Represents a Date. */ - class Date implements IDate { - - /** - * Constructs a new Date. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IDate); - - /** Date year. */ - public year: number; - - /** Date month. */ - public month: number; - - /** Date day. */ - public day: number; - - /** - * Creates a new Date instance using the specified properties. - * @param [properties] Properties to set - * @returns Date instance - */ - public static create(properties?: google.type.IDate): google.type.Date; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Date message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; - - /** - * Verifies a Date message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Date message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Date - */ - public static fromObject(object: { [k: string]: any }): google.type.Date; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @param message Date - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Date to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Date - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** DayOfWeek enum. */ - enum DayOfWeek { - DAY_OF_WEEK_UNSPECIFIED = 0, - MONDAY = 1, - TUESDAY = 2, - WEDNESDAY = 3, - THURSDAY = 4, - FRIDAY = 5, - SATURDAY = 6, - SUNDAY = 7 - } - - /** Properties of a TimeOfDay. */ - interface ITimeOfDay { - - /** TimeOfDay hours */ - hours?: (number|null); - - /** TimeOfDay minutes */ - minutes?: (number|null); - - /** TimeOfDay seconds */ - seconds?: (number|null); - - /** TimeOfDay nanos */ - nanos?: (number|null); - } - - /** Represents a TimeOfDay. */ - class TimeOfDay implements ITimeOfDay { - - /** - * Constructs a new TimeOfDay. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ITimeOfDay); - - /** TimeOfDay hours. */ - public hours: number; - - /** TimeOfDay minutes. */ - public minutes: number; - - /** TimeOfDay seconds. */ - public seconds: number; - - /** TimeOfDay nanos. */ - public nanos: number; - - /** - * Creates a new TimeOfDay instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeOfDay instance - */ - public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; - - /** - * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. - * @param message TimeOfDay message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. - * @param message TimeOfDay message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeOfDay message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeOfDay - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; - - /** - * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeOfDay - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; - - /** - * Verifies a TimeOfDay message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeOfDay - */ - public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; - - /** - * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. - * @param message TimeOfDay - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeOfDay to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeOfDay - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/protos/protos.js deleted file mode 100644 index 0af3beae285..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/protos.js +++ /dev/null @@ -1,142445 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_alloydb_protos || ($protobuf.roots._google_cloud_alloydb_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.alloydb = (function() { - - /** - * Namespace alloydb. - * @memberof google.cloud - * @namespace - */ - var alloydb = {}; - - alloydb.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1 = {}; - - v1.CloudSQLBackupRunSource = (function() { - - /** - * Properties of a CloudSQLBackupRunSource. - * @memberof google.cloud.alloydb.v1 - * @interface ICloudSQLBackupRunSource - * @property {string|null} [project] CloudSQLBackupRunSource project - * @property {string|null} [instanceId] CloudSQLBackupRunSource instanceId - * @property {number|Long|null} [backupRunId] CloudSQLBackupRunSource backupRunId - */ - - /** - * Constructs a new CloudSQLBackupRunSource. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CloudSQLBackupRunSource. - * @implements ICloudSQLBackupRunSource - * @constructor - * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource=} [properties] Properties to set - */ - function CloudSQLBackupRunSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSQLBackupRunSource project. - * @member {string} project - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.project = ""; - - /** - * CloudSQLBackupRunSource instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.instanceId = ""; - - /** - * CloudSQLBackupRunSource backupRunId. - * @member {number|Long} backupRunId - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.backupRunId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CloudSQLBackupRunSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource instance - */ - CloudSQLBackupRunSource.create = function create(properties) { - return new CloudSQLBackupRunSource(properties); - }; - - /** - * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSQLBackupRunSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.backupRunId); - return writer; - }; - - /** - * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSQLBackupRunSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSQLBackupRunSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupRunId = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSQLBackupRunSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSQLBackupRunSource message. - * @function verify - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSQLBackupRunSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) - return "backupRunId: integer|Long expected"; - return null; - }; - - /** - * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CloudSQLBackupRunSource} CloudSQLBackupRunSource - */ - CloudSQLBackupRunSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource) - return object; - var message = new $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource(); - if (object.project != null) - message.project = String(object.project); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupRunId != null) - if ($util.Long) - (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; - else if (typeof object.backupRunId === "string") - message.backupRunId = parseInt(object.backupRunId, 10); - else if (typeof object.backupRunId === "number") - message.backupRunId = object.backupRunId; - else if (typeof object.backupRunId === "object") - message.backupRunId = new $util.LongBits(object.backupRunId.low >>> 0, object.backupRunId.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1.CloudSQLBackupRunSource} message CloudSQLBackupRunSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSQLBackupRunSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.instanceId = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backupRunId = options.longs === String ? "0" : 0; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (typeof message.backupRunId === "number") - object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; - else - object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; - return object; - }; - - /** - * Converts this CloudSQLBackupRunSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @instance - * @returns {Object.} JSON object - */ - CloudSQLBackupRunSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSQLBackupRunSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CloudSQLBackupRunSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSQLBackupRunSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CloudSQLBackupRunSource"; - }; - - return CloudSQLBackupRunSource; - })(); - - v1.AlloyDBCSQLAdmin = (function() { - - /** - * Constructs a new AlloyDBCSQLAdmin service. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an AlloyDBCSQLAdmin - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AlloyDBCSQLAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBCSQLAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBCSQLAdmin; - - /** - * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AlloyDBCSQLAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBCSQLAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBCSQLAdmin|restoreFromCloudSQL}. - * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin - * @typedef RestoreFromCloudSQLCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreFromCloudSQL. - * @function restoreFromCloudSQL - * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBCSQLAdmin.prototype.restoreFromCloudSQL = function restoreFromCloudSQL(request, callback) { - return this.rpcCall(restoreFromCloudSQL, $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreFromCloudSQL" }); - - /** - * Calls RestoreFromCloudSQL. - * @function restoreFromCloudSQL - * @memberof google.cloud.alloydb.v1.AlloyDBCSQLAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBCSQLAdmin; - })(); - - v1.RestoreFromCloudSQLRequest = (function() { - - /** - * Properties of a RestoreFromCloudSQLRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IRestoreFromCloudSQLRequest - * @property {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] RestoreFromCloudSQLRequest cloudsqlBackupRunSource - * @property {string|null} [parent] RestoreFromCloudSQLRequest parent - * @property {string|null} [clusterId] RestoreFromCloudSQLRequest clusterId - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] RestoreFromCloudSQLRequest cluster - */ - - /** - * Constructs a new RestoreFromCloudSQLRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestoreFromCloudSQLRequest. - * @implements IRestoreFromCloudSQLRequest - * @constructor - * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest=} [properties] Properties to set - */ - function RestoreFromCloudSQLRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreFromCloudSQLRequest cloudsqlBackupRunSource. - * @member {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.cloudsqlBackupRunSource = null; - - /** - * RestoreFromCloudSQLRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.parent = ""; - - /** - * RestoreFromCloudSQLRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.clusterId = ""; - - /** - * RestoreFromCloudSQLRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.cluster = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreFromCloudSQLRequest source. - * @member {"cloudsqlBackupRunSource"|undefined} source - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @instance - */ - Object.defineProperty(RestoreFromCloudSQLRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["cloudsqlBackupRunSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest instance - */ - RestoreFromCloudSQLRequest.create = function create(properties) { - return new RestoreFromCloudSQLRequest(properties); - }; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreFromCloudSQLRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) - $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreFromCloudSQLRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreFromCloudSQLRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 101: { - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreFromCloudSQLRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreFromCloudSQLRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreFromCloudSQLRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); - if (error) - return "cloudsqlBackupRunSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - return null; - }; - - /** - * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - */ - RestoreFromCloudSQLRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest(); - if (object.cloudsqlBackupRunSource != null) { - if (typeof object.cloudsqlBackupRunSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.cloudsqlBackupRunSource: object expected"); - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreFromCloudSQLRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - return message; - }; - - /** - * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1.RestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreFromCloudSQLRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); - if (options.oneofs) - object.source = "cloudsqlBackupRunSource"; - } - return object; - }; - - /** - * Converts this RestoreFromCloudSQLRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreFromCloudSQLRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreFromCloudSQLRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestoreFromCloudSQLRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreFromCloudSQLRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreFromCloudSQLRequest"; - }; - - return RestoreFromCloudSQLRequest; - })(); - - /** - * InstanceView enum. - * @name google.cloud.alloydb.v1.InstanceView - * @enum {number} - * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value - * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value - * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value - */ - v1.InstanceView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; - values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; - return values; - })(); - - /** - * ClusterView enum. - * @name google.cloud.alloydb.v1.ClusterView - * @enum {number} - * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value - * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value - * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value - */ - v1.ClusterView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; - values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; - return values; - })(); - - /** - * DatabaseVersion enum. - * @name google.cloud.alloydb.v1.DatabaseVersion - * @enum {number} - * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value - * @property {number} POSTGRES_13=1 POSTGRES_13 value - * @property {number} POSTGRES_14=2 POSTGRES_14 value - * @property {number} POSTGRES_15=3 POSTGRES_15 value - * @property {number} POSTGRES_16=4 POSTGRES_16 value - * @property {number} POSTGRES_17=5 POSTGRES_17 value - */ - v1.DatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "POSTGRES_13"] = 1; - values[valuesById[2] = "POSTGRES_14"] = 2; - values[valuesById[3] = "POSTGRES_15"] = 3; - values[valuesById[4] = "POSTGRES_16"] = 4; - values[valuesById[5] = "POSTGRES_17"] = 5; - return values; - })(); - - /** - * SubscriptionType enum. - * @name google.cloud.alloydb.v1.SubscriptionType - * @enum {number} - * @property {number} SUBSCRIPTION_TYPE_UNSPECIFIED=0 SUBSCRIPTION_TYPE_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} TRIAL=2 TRIAL value - */ - v1.SubscriptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SUBSCRIPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "TRIAL"] = 2; - return values; - })(); - - v1.UserPassword = (function() { - - /** - * Properties of a UserPassword. - * @memberof google.cloud.alloydb.v1 - * @interface IUserPassword - * @property {string|null} [user] UserPassword user - * @property {string|null} [password] UserPassword password - */ - - /** - * Constructs a new UserPassword. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a UserPassword. - * @implements IUserPassword - * @constructor - * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set - */ - function UserPassword(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UserPassword user. - * @member {string} user - * @memberof google.cloud.alloydb.v1.UserPassword - * @instance - */ - UserPassword.prototype.user = ""; - - /** - * UserPassword password. - * @member {string} password - * @memberof google.cloud.alloydb.v1.UserPassword - * @instance - */ - UserPassword.prototype.password = ""; - - /** - * Creates a new UserPassword instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword instance - */ - UserPassword.create = function create(properties) { - return new UserPassword(properties); - }; - - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {google.cloud.alloydb.v1.IUserPassword} message UserPassword message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserPassword.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); - return writer; - }; - - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {google.cloud.alloydb.v1.IUserPassword} message UserPassword message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserPassword.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserPassword.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UserPassword(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.user = reader.string(); - break; - } - case 2: { - message.password = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserPassword.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserPassword message. - * @function verify - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserPassword.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - return null; - }; - - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword - */ - UserPassword.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UserPassword) - return object; - var message = new $root.google.cloud.alloydb.v1.UserPassword(); - if (object.user != null) - message.user = String(object.user); - if (object.password != null) - message.password = String(object.password); - return message; - }; - - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {google.cloud.alloydb.v1.UserPassword} message UserPassword - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserPassword.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.user = ""; - object.password = ""; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - return object; - }; - - /** - * Converts this UserPassword to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UserPassword - * @instance - * @returns {Object.} JSON object - */ - UserPassword.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserPassword - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UserPassword - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UserPassword"; - }; - - return UserPassword; - })(); - - v1.MigrationSource = (function() { - - /** - * Properties of a MigrationSource. - * @memberof google.cloud.alloydb.v1 - * @interface IMigrationSource - * @property {string|null} [hostPort] MigrationSource hostPort - * @property {string|null} [referenceId] MigrationSource referenceId - * @property {google.cloud.alloydb.v1.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType - */ - - /** - * Constructs a new MigrationSource. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a MigrationSource. - * @implements IMigrationSource - * @constructor - * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set - */ - function MigrationSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MigrationSource hostPort. - * @member {string} hostPort - * @memberof google.cloud.alloydb.v1.MigrationSource - * @instance - */ - MigrationSource.prototype.hostPort = ""; - - /** - * MigrationSource referenceId. - * @member {string} referenceId - * @memberof google.cloud.alloydb.v1.MigrationSource - * @instance - */ - MigrationSource.prototype.referenceId = ""; - - /** - * MigrationSource sourceType. - * @member {google.cloud.alloydb.v1.MigrationSource.MigrationSourceType} sourceType - * @memberof google.cloud.alloydb.v1.MigrationSource - * @instance - */ - MigrationSource.prototype.sourceType = 0; - - /** - * Creates a new MigrationSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource instance - */ - MigrationSource.create = function create(properties) { - return new MigrationSource(properties); - }; - - /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {google.cloud.alloydb.v1.IMigrationSource} message MigrationSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); - if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); - return writer; - }; - - /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {google.cloud.alloydb.v1.IMigrationSource} message MigrationSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MigrationSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MigrationSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.hostPort = reader.string(); - break; - } - case 2: { - message.referenceId = reader.string(); - break; - } - case 3: { - message.sourceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MigrationSource message. - * @function verify - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - if (!$util.isString(message.hostPort)) - return "hostPort: string expected"; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - if (!$util.isString(message.referenceId)) - return "referenceId: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource - */ - MigrationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.MigrationSource) - return object; - var message = new $root.google.cloud.alloydb.v1.MigrationSource(); - if (object.hostPort != null) - message.hostPort = String(object.hostPort); - if (object.referenceId != null) - message.referenceId = String(object.referenceId); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "DMS": - case 1: - message.sourceType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {google.cloud.alloydb.v1.MigrationSource} message MigrationSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.hostPort = ""; - object.referenceId = ""; - object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; - } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - object.hostPort = message.hostPort; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - object.referenceId = message.referenceId; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; - return object; - }; - - /** - * Converts this MigrationSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.MigrationSource - * @instance - * @returns {Object.} JSON object - */ - MigrationSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MigrationSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.MigrationSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.MigrationSource"; - }; - - /** - * MigrationSourceType enum. - * @name google.cloud.alloydb.v1.MigrationSource.MigrationSourceType - * @enum {number} - * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value - * @property {number} DMS=1 DMS value - */ - MigrationSource.MigrationSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DMS"] = 1; - return values; - })(); - - return MigrationSource; - })(); - - v1.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.alloydb.v1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.cloud.alloydb.v1.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyName = ""; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kmsKeyName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.EncryptionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1.EncryptionInfo = (function() { - - /** - * Properties of an EncryptionInfo. - * @memberof google.cloud.alloydb.v1 - * @interface IEncryptionInfo - * @property {google.cloud.alloydb.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions - */ - - /** - * Constructs a new EncryptionInfo. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo - * @constructor - * @param {google.cloud.alloydb.v1.IEncryptionInfo=} [properties] Properties to set - */ - function EncryptionInfo(properties) { - this.kmsKeyVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionInfo encryptionType. - * @member {google.cloud.alloydb.v1.EncryptionInfo.Type} encryptionType - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionType = 0; - - /** - * EncryptionInfo kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1.IEncryptionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo instance - */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); - }; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); - return writer; - }; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.EncryptionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { - if (!Array.isArray(message.kmsKeyVersions)) - return "kmsKeyVersions: array expected"; - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - if (!$util.isString(message.kmsKeyVersions[i])) - return "kmsKeyVersions: string[] expected"; - } - return null; - }; - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo - */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.EncryptionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - } - if (object.kmsKeyVersions) { - if (!Array.isArray(object.kmsKeyVersions)) - throw TypeError(".google.cloud.alloydb.v1.EncryptionInfo.kmsKeyVersions: array expected"); - message.kmsKeyVersions = []; - for (var i = 0; i < object.kmsKeyVersions.length; ++i) - message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); - } - return message; - }; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1.EncryptionInfo} message EncryptionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyVersions = []; - if (options.defaults) - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.kmsKeyVersions && message.kmsKeyVersions.length) { - object.kmsKeyVersions = []; - for (var j = 0; j < message.kmsKeyVersions.length; ++j) - object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; - } - return object; - }; - - /** - * Converts this EncryptionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @instance - * @returns {Object.} JSON object - */ - EncryptionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.EncryptionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.EncryptionInfo"; - }; - - /** - * Type enum. - * @name google.cloud.alloydb.v1.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; - })(); - - v1.SslConfig = (function() { - - /** - * Properties of a SslConfig. - * @memberof google.cloud.alloydb.v1 - * @interface ISslConfig - * @property {google.cloud.alloydb.v1.SslConfig.SslMode|null} [sslMode] SslConfig sslMode - * @property {google.cloud.alloydb.v1.SslConfig.CaSource|null} [caSource] SslConfig caSource - */ - - /** - * Constructs a new SslConfig. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SslConfig. - * @implements ISslConfig - * @constructor - * @param {google.cloud.alloydb.v1.ISslConfig=} [properties] Properties to set - */ - function SslConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SslConfig sslMode. - * @member {google.cloud.alloydb.v1.SslConfig.SslMode} sslMode - * @memberof google.cloud.alloydb.v1.SslConfig - * @instance - */ - SslConfig.prototype.sslMode = 0; - - /** - * SslConfig caSource. - * @member {google.cloud.alloydb.v1.SslConfig.CaSource} caSource - * @memberof google.cloud.alloydb.v1.SslConfig - * @instance - */ - SslConfig.prototype.caSource = 0; - - /** - * Creates a new SslConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {google.cloud.alloydb.v1.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig instance - */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); - }; - - /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {google.cloud.alloydb.v1.ISslConfig} message SslConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SslConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); - if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); - return writer; - }; - - /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {google.cloud.alloydb.v1.ISslConfig} message SslConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SslConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SslConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SslConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sslMode = reader.int32(); - break; - } - case 2: { - message.caSource = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SslConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SslConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - switch (message.sslMode) { - default: - return "sslMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.caSource != null && message.hasOwnProperty("caSource")) - switch (message.caSource) { - default: - return "caSource: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig - */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SslConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.SslConfig(); - switch (object.sslMode) { - default: - if (typeof object.sslMode === "number") { - message.sslMode = object.sslMode; - break; - } - break; - case "SSL_MODE_UNSPECIFIED": - case 0: - message.sslMode = 0; - break; - case "SSL_MODE_ALLOW": - case 1: - message.sslMode = 1; - break; - case "SSL_MODE_REQUIRE": - case 2: - message.sslMode = 2; - break; - case "SSL_MODE_VERIFY_CA": - case 3: - message.sslMode = 3; - break; - case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": - case 4: - message.sslMode = 4; - break; - case "ENCRYPTED_ONLY": - case 5: - message.sslMode = 5; - break; - } - switch (object.caSource) { - default: - if (typeof object.caSource === "number") { - message.caSource = object.caSource; - break; - } - break; - case "CA_SOURCE_UNSPECIFIED": - case 0: - message.caSource = 0; - break; - case "CA_SOURCE_MANAGED": - case 1: - message.caSource = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {google.cloud.alloydb.v1.SslConfig} message SslConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SslConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; - object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; - } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1.SslConfig.SslMode[message.sslMode] : message.sslMode; - if (message.caSource != null && message.hasOwnProperty("caSource")) - object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1.SslConfig.CaSource[message.caSource] : message.caSource; - return object; - }; - - /** - * Converts this SslConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SslConfig - * @instance - * @returns {Object.} JSON object - */ - SslConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SslConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SslConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SslConfig"; - }; - - /** - * SslMode enum. - * @name google.cloud.alloydb.v1.SslConfig.SslMode - * @enum {number} - * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value - * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value - * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value - * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value - * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value - * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value - */ - SslConfig.SslMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; - values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; - values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; - values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; - values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; - return values; - })(); - - /** - * CaSource enum. - * @name google.cloud.alloydb.v1.SslConfig.CaSource - * @enum {number} - * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value - * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value - */ - SslConfig.CaSource = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; - return values; - })(); - - return SslConfig; - })(); - - v1.AutomatedBackupPolicy = (function() { - - /** - * Properties of an AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1 - * @interface IAutomatedBackupPolicy - * @property {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule - * @property {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention - * @property {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention - * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled - * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow - * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig - * @property {string|null} [location] AutomatedBackupPolicy location - * @property {Object.|null} [labels] AutomatedBackupPolicy labels - */ - - /** - * Constructs a new AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an AutomatedBackupPolicy. - * @implements IAutomatedBackupPolicy - * @constructor - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy=} [properties] Properties to set - */ - function AutomatedBackupPolicy(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutomatedBackupPolicy weeklySchedule. - * @member {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.weeklySchedule = null; - - /** - * AutomatedBackupPolicy timeBasedRetention. - * @member {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.timeBasedRetention = null; - - /** - * AutomatedBackupPolicy quantityBasedRetention. - * @member {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.quantityBasedRetention = null; - - /** - * AutomatedBackupPolicy enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.enabled = null; - - /** - * AutomatedBackupPolicy backupWindow. - * @member {google.protobuf.IDuration|null|undefined} backupWindow - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.backupWindow = null; - - /** - * AutomatedBackupPolicy encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.encryptionConfig = null; - - /** - * AutomatedBackupPolicy location. - * @member {string} location - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.location = ""; - - /** - * AutomatedBackupPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutomatedBackupPolicy schedule. - * @member {"weeklySchedule"|undefined} schedule - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { - get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutomatedBackupPolicy retention. - * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { - get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy instance - */ - AutomatedBackupPolicy.create = function create(properties) { - return new AutomatedBackupPolicy(properties); - }; - - /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutomatedBackupPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) - $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) - $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) - $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) - $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutomatedBackupPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.weeklySchedule = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); - break; - } - case 4: { - message.timeBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); - break; - } - case 5: { - message.quantityBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); - break; - } - case 1: { - message.enabled = reader.bool(); - break; - } - case 3: { - message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 8: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.location = reader.string(); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutomatedBackupPolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutomatedBackupPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - properties.schedule = 1; - { - var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); - if (error) - return "weeklySchedule." + error; - } - } - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); - if (error) - return "timeBasedRetention." + error; - } - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - if (properties.retention === 1) - return "retention: multiple values"; - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); - if (error) - return "quantityBasedRetention." + error; - } - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { - var error = $root.google.protobuf.Duration.verify(message.backupWindow); - if (error) - return "backupWindow." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy - */ - AutomatedBackupPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy) - return object; - var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy(); - if (object.weeklySchedule != null) { - if (typeof object.weeklySchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.weeklySchedule: object expected"); - message.weeklySchedule = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); - } - if (object.timeBasedRetention != null) { - if (typeof object.timeBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.timeBasedRetention: object expected"); - message.timeBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); - } - if (object.quantityBasedRetention != null) { - if (typeof object.quantityBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.quantityBasedRetention: object expected"); - message.quantityBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); - } - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.backupWindow != null) { - if (typeof object.backupWindow !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.backupWindow: object expected"); - message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy} message AutomatedBackupPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutomatedBackupPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.backupWindow = null; - object.location = ""; - object.encryptionConfig = null; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - object.weeklySchedule = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); - if (options.oneofs) - object.schedule = "weeklySchedule"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) - object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - object.timeBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); - if (options.oneofs) - object.retention = "timeBasedRetention"; - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - object.quantityBasedRetention = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); - if (options.oneofs) - object.retention = "quantityBasedRetention"; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this AutomatedBackupPolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - * @returns {Object.} JSON object - */ - AutomatedBackupPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutomatedBackupPolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy"; - }; - - AutomatedBackupPolicy.WeeklySchedule = (function() { - - /** - * Properties of a WeeklySchedule. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @interface IWeeklySchedule - * @property {Array.|null} [startTimes] WeeklySchedule startTimes - * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek - */ - - /** - * Constructs a new WeeklySchedule. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @classdesc Represents a WeeklySchedule. - * @implements IWeeklySchedule - * @constructor - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - */ - function WeeklySchedule(properties) { - this.startTimes = []; - this.daysOfWeek = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeeklySchedule startTimes. - * @member {Array.} startTimes - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.startTimes = $util.emptyArray; - - /** - * WeeklySchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance - */ - WeeklySchedule.create = function create(properties) { - return new WeeklySchedule(properties); - }; - - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimes != null && message.startTimes.length) - for (var i = 0; i < message.startTimes.length; ++i) - $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.startTimes && message.startTimes.length)) - message.startTimes = []; - message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.daysOfWeek && message.daysOfWeek.length)) - message.daysOfWeek = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfWeek.push(reader.int32()); - } else - message.daysOfWeek.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeeklySchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeeklySchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimes != null && message.hasOwnProperty("startTimes")) { - if (!Array.isArray(message.startTimes)) - return "startTimes: array expected"; - for (var i = 0; i < message.startTimes.length; ++i) { - var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); - if (error) - return "startTimes." + error; - } - } - if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { - if (!Array.isArray(message.daysOfWeek)) - return "daysOfWeek: array expected"; - for (var i = 0; i < message.daysOfWeek.length; ++i) - switch (message.daysOfWeek[i]) { - default: - return "daysOfWeek: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; - - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - */ - WeeklySchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) - return object; - var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule(); - if (object.startTimes) { - if (!Array.isArray(object.startTimes)) - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); - message.startTimes = []; - for (var i = 0; i < object.startTimes.length; ++i) { - if (typeof object.startTimes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); - message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); - } - } - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - switch (object.daysOfWeek[i]) { - default: - if (typeof object.daysOfWeek[i] === "number") { - message.daysOfWeek[i] = object.daysOfWeek[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.daysOfWeek[i] = 0; - break; - case "MONDAY": - case 1: - message.daysOfWeek[i] = 1; - break; - case "TUESDAY": - case 2: - message.daysOfWeek[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.daysOfWeek[i] = 3; - break; - case "THURSDAY": - case 4: - message.daysOfWeek[i] = 4; - break; - case "FRIDAY": - case 5: - message.daysOfWeek[i] = 5; - break; - case "SATURDAY": - case 6: - message.daysOfWeek[i] = 6; - break; - case "SUNDAY": - case 7: - message.daysOfWeek[i] = 7; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeeklySchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startTimes = []; - object.daysOfWeek = []; - } - if (message.startTimes && message.startTimes.length) { - object.startTimes = []; - for (var j = 0; j < message.startTimes.length; ++j) - object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); - } - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; - } - return object; - }; - - /** - * Converts this WeeklySchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @instance - * @returns {Object.} JSON object - */ - WeeklySchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WeeklySchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule"; - }; - - return WeeklySchedule; - })(); - - AutomatedBackupPolicy.TimeBasedRetention = (function() { - - /** - * Properties of a TimeBasedRetention. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @interface ITimeBasedRetention - * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod - */ - - /** - * Constructs a new TimeBasedRetention. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @classdesc Represents a TimeBasedRetention. - * @implements ITimeBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - */ - function TimeBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimeBasedRetention retentionPeriod. - * @member {google.protobuf.IDuration|null|undefined} retentionPeriod - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @instance - */ - TimeBasedRetention.prototype.retentionPeriod = null; - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance - */ - TimeBasedRetention.create = function create(properties) { - return new TimeBasedRetention(properties); - }; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) - $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); - if (error) - return "retentionPeriod." + error; - } - return null; - }; - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - */ - TimeBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention(); - if (object.retentionPeriod != null) { - if (typeof object.retentionPeriod !== "object") - throw TypeError(".google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); - message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); - } - return message; - }; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.retentionPeriod = null; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) - object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); - return object; - }; - - /** - * Converts this TimeBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @instance - * @returns {Object.} JSON object - */ - TimeBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention"; - }; - - return TimeBasedRetention; - })(); - - AutomatedBackupPolicy.QuantityBasedRetention = (function() { - - /** - * Properties of a QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @interface IQuantityBasedRetention - * @property {number|null} [count] QuantityBasedRetention count - */ - - /** - * Constructs a new QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @classdesc Represents a QuantityBasedRetention. - * @implements IQuantityBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - */ - function QuantityBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedRetention count. - * @member {number} count - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - */ - QuantityBasedRetention.prototype.count = 0; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance - */ - QuantityBasedRetention.create = function create(properties) { - return new QuantityBasedRetention(properties); - }; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - return writer; - }; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - */ - QuantityBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention(); - if (object.count != null) - message.count = object.count | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention"; - }; - - return QuantityBasedRetention; - })(); - - return AutomatedBackupPolicy; - })(); - - v1.ContinuousBackupConfig = (function() { - - /** - * Properties of a ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1 - * @interface IContinuousBackupConfig - * @property {boolean|null} [enabled] ContinuousBackupConfig enabled - * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays - * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig - */ - - /** - * Constructs a new ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ContinuousBackupConfig. - * @implements IContinuousBackupConfig - * @constructor - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set - */ - function ContinuousBackupConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.enabled = null; - - /** - * ContinuousBackupConfig recoveryWindowDays. - * @member {number} recoveryWindowDays - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.recoveryWindowDays = 0; - - /** - * ContinuousBackupConfig encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig instance - */ - ContinuousBackupConfig.create = function create(properties) { - return new ContinuousBackupConfig(properties); - }; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 4: { - message.recoveryWindowDays = reader.int32(); - break; - } - case 3: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - if (!$util.isInteger(message.recoveryWindowDays)) - return "recoveryWindowDays: integer expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig - */ - ContinuousBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.ContinuousBackupConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.recoveryWindowDays != null) - message.recoveryWindowDays = object.recoveryWindowDays | 0; - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1.ContinuousBackupConfig} message ContinuousBackupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.encryptionConfig = null; - object.recoveryWindowDays = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - object.recoveryWindowDays = message.recoveryWindowDays; - return object; - }; - - /** - * Converts this ContinuousBackupConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupConfig"; - }; - - return ContinuousBackupConfig; - })(); - - v1.ContinuousBackupInfo = (function() { - - /** - * Properties of a ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1 - * @interface IContinuousBackupInfo - * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo - * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime - * @property {Array.|null} [schedule] ContinuousBackupInfo schedule - * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime - */ - - /** - * Constructs a new ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ContinuousBackupInfo. - * @implements IContinuousBackupInfo - * @constructor - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set - */ - function ContinuousBackupInfo(properties) { - this.schedule = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupInfo encryptionInfo. - * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.encryptionInfo = null; - - /** - * ContinuousBackupInfo enabledTime. - * @member {google.protobuf.ITimestamp|null|undefined} enabledTime - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.enabledTime = null; - - /** - * ContinuousBackupInfo schedule. - * @member {Array.} schedule - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.schedule = $util.emptyArray; - - /** - * ContinuousBackupInfo earliestRestorableTime. - * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.earliestRestorableTime = null; - - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo instance - */ - ContinuousBackupInfo.create = function create(properties) { - return new ContinuousBackupInfo(properties); - }; - - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) - $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.schedule != null && message.schedule.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.schedule.length; ++i) - writer.int32(message.schedule[i]); - writer.ldelim(); - } - if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) - $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 2: { - message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.schedule && message.schedule.length)) - message.schedule = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.schedule.push(reader.int32()); - } else - message.schedule.push(reader.int32()); - break; - } - case 4: { - message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); - if (error) - return "enabledTime." + error; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - if (!Array.isArray(message.schedule)) - return "schedule: array expected"; - for (var i = 0; i < message.schedule.length; ++i) - switch (message.schedule[i]) { - default: - return "schedule: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); - if (error) - return "earliestRestorableTime." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo - */ - ContinuousBackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupInfo) - return object; - var message = new $root.google.cloud.alloydb.v1.ContinuousBackupInfo(); - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.enabledTime != null) { - if (typeof object.enabledTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.enabledTime: object expected"); - message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); - } - if (object.schedule) { - if (!Array.isArray(object.schedule)) - throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.schedule: array expected"); - message.schedule = []; - for (var i = 0; i < object.schedule.length; ++i) - switch (object.schedule[i]) { - default: - if (typeof object.schedule[i] === "number") { - message.schedule[i] = object.schedule[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.schedule[i] = 0; - break; - case "MONDAY": - case 1: - message.schedule[i] = 1; - break; - case "TUESDAY": - case 2: - message.schedule[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.schedule[i] = 3; - break; - case "THURSDAY": - case 4: - message.schedule[i] = 4; - break; - case "FRIDAY": - case 5: - message.schedule[i] = 5; - break; - case "SATURDAY": - case 6: - message.schedule[i] = 6; - break; - case "SUNDAY": - case 7: - message.schedule[i] = 7; - break; - } - } - if (object.earliestRestorableTime != null) { - if (typeof object.earliestRestorableTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupInfo.earliestRestorableTime: object expected"); - message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1.ContinuousBackupInfo} message ContinuousBackupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schedule = []; - if (options.defaults) { - object.encryptionInfo = null; - object.enabledTime = null; - object.earliestRestorableTime = null; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) - object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); - if (message.schedule && message.schedule.length) { - object.schedule = []; - for (var j = 0; j < message.schedule.length; ++j) - object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; - } - if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) - object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); - return object; - }; - - /** - * Converts this ContinuousBackupInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupInfo"; - }; - - return ContinuousBackupInfo; - })(); - - v1.BackupSource = (function() { - - /** - * Properties of a BackupSource. - * @memberof google.cloud.alloydb.v1 - * @interface IBackupSource - * @property {string|null} [backupUid] BackupSource backupUid - * @property {string|null} [backupName] BackupSource backupName - */ - - /** - * Constructs a new BackupSource. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BackupSource. - * @implements IBackupSource - * @constructor - * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set - */ - function BackupSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1.BackupSource - * @instance - */ - BackupSource.prototype.backupUid = ""; - - /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1.BackupSource - * @instance - */ - BackupSource.prototype.backupName = ""; - - /** - * Creates a new BackupSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {google.cloud.alloydb.v1.IBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource instance - */ - BackupSource.create = function create(properties) { - return new BackupSource(properties); - }; - - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); - if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); - return writer; - }; - - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BackupSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {google.cloud.alloydb.v1.IBackupSource} message BackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BackupSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.backupUid = reader.string(); - break; - } - case 1: { - message.backupName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupSource message. - * @function verify - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - if (!$util.isString(message.backupUid)) - return "backupUid: string expected"; - if (message.backupName != null && message.hasOwnProperty("backupName")) - if (!$util.isString(message.backupName)) - return "backupName: string expected"; - return null; - }; - - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BackupSource} BackupSource - */ - BackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BackupSource) - return object; - var message = new $root.google.cloud.alloydb.v1.BackupSource(); - if (object.backupUid != null) - message.backupUid = String(object.backupUid); - if (object.backupName != null) - message.backupName = String(object.backupName); - return message; - }; - - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {google.cloud.alloydb.v1.BackupSource} message BackupSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupName = ""; - object.backupUid = ""; - } - if (message.backupName != null && message.hasOwnProperty("backupName")) - object.backupName = message.backupName; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - object.backupUid = message.backupUid; - return object; - }; - - /** - * Converts this BackupSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.BackupSource - * @instance - * @returns {Object.} JSON object - */ - BackupSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BackupSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BackupSource"; - }; - - return BackupSource; - })(); - - v1.ContinuousBackupSource = (function() { - - /** - * Properties of a ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1 - * @interface IContinuousBackupSource - * @property {string|null} [cluster] ContinuousBackupSource cluster - * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime - */ - - /** - * Constructs a new ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ContinuousBackupSource. - * @implements IContinuousBackupSource - * @constructor - * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set - */ - function ContinuousBackupSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupSource cluster. - * @member {string} cluster - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @instance - */ - ContinuousBackupSource.prototype.cluster = ""; - - /** - * ContinuousBackupSource pointInTime. - * @member {google.protobuf.ITimestamp|null|undefined} pointInTime - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @instance - */ - ContinuousBackupSource.prototype.pointInTime = null; - - /** - * Creates a new ContinuousBackupSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource instance - */ - ContinuousBackupSource.create = function create(properties) { - return new ContinuousBackupSource(properties); - }; - - /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); - if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ContinuousBackupSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cluster = reader.string(); - break; - } - case 2: { - message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupSource message. - * @function verify - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) - if (!$util.isString(message.cluster)) - return "cluster: string expected"; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); - if (error) - return "pointInTime." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource - */ - ContinuousBackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupSource) - return object; - var message = new $root.google.cloud.alloydb.v1.ContinuousBackupSource(); - if (object.cluster != null) - message.cluster = String(object.cluster); - if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.ContinuousBackupSource.pointInTime: object expected"); - message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1.ContinuousBackupSource} message ContinuousBackupSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cluster = ""; - object.pointInTime = null; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = message.cluster; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - return object; - }; - - /** - * Converts this ContinuousBackupSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupSource"; - }; - - return ContinuousBackupSource; - })(); - - v1.MaintenanceUpdatePolicy = (function() { - - /** - * Properties of a MaintenanceUpdatePolicy. - * @memberof google.cloud.alloydb.v1 - * @interface IMaintenanceUpdatePolicy - * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows - * @property {Array.|null} [denyMaintenancePeriods] MaintenanceUpdatePolicy denyMaintenancePeriods - */ - - /** - * Constructs a new MaintenanceUpdatePolicy. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a MaintenanceUpdatePolicy. - * @implements IMaintenanceUpdatePolicy - * @constructor - * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy=} [properties] Properties to set - */ - function MaintenanceUpdatePolicy(properties) { - this.maintenanceWindows = []; - this.denyMaintenancePeriods = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceUpdatePolicy maintenanceWindows. - * @member {Array.} maintenanceWindows - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @instance - */ - MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; - - /** - * MaintenanceUpdatePolicy denyMaintenancePeriods. - * @member {Array.} denyMaintenancePeriods - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @instance - */ - MaintenanceUpdatePolicy.prototype.denyMaintenancePeriods = $util.emptyArray; - - /** - * Creates a new MaintenanceUpdatePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance - */ - MaintenanceUpdatePolicy.create = function create(properties) { - return new MaintenanceUpdatePolicy(properties); - }; - - /** - * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceUpdatePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maintenanceWindows != null && message.maintenanceWindows.length) - for (var i = 0; i < message.maintenanceWindows.length; ++i) - $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) - for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) - $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceUpdatePolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.maintenanceWindows && message.maintenanceWindows.length)) - message.maintenanceWindows = []; - message.maintenanceWindows.push($root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.denyMaintenancePeriods && message.denyMaintenancePeriods.length)) - message.denyMaintenancePeriods = []; - message.denyMaintenancePeriods.push($root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceUpdatePolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceUpdatePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { - if (!Array.isArray(message.maintenanceWindows)) - return "maintenanceWindows: array expected"; - for (var i = 0; i < message.maintenanceWindows.length; ++i) { - var error = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); - if (error) - return "maintenanceWindows." + error; - } - } - if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { - if (!Array.isArray(message.denyMaintenancePeriods)) - return "denyMaintenancePeriods: array expected"; - for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { - var error = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify(message.denyMaintenancePeriods[i]); - if (error) - return "denyMaintenancePeriods." + error; - } - } - return null; - }; - - /** - * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - */ - MaintenanceUpdatePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy) - return object; - var message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy(); - if (object.maintenanceWindows) { - if (!Array.isArray(object.maintenanceWindows)) - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); - message.maintenanceWindows = []; - for (var i = 0; i < object.maintenanceWindows.length; ++i) { - if (typeof object.maintenanceWindows[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); - message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); - } - } - if (object.denyMaintenancePeriods) { - if (!Array.isArray(object.denyMaintenancePeriods)) - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.denyMaintenancePeriods: array expected"); - message.denyMaintenancePeriods = []; - for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { - if (typeof object.denyMaintenancePeriods[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.denyMaintenancePeriods: object expected"); - message.denyMaintenancePeriods[i] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceUpdatePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.maintenanceWindows = []; - object.denyMaintenancePeriods = []; - } - if (message.maintenanceWindows && message.maintenanceWindows.length) { - object.maintenanceWindows = []; - for (var j = 0; j < message.maintenanceWindows.length; ++j) - object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); - } - if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { - object.denyMaintenancePeriods = []; - for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) - object.denyMaintenancePeriods[j] = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); - } - return object; - }; - - /** - * Converts this MaintenanceUpdatePolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @instance - * @returns {Object.} JSON object - */ - MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceUpdatePolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy"; - }; - - MaintenanceUpdatePolicy.MaintenanceWindow = (function() { - - /** - * Properties of a MaintenanceWindow. - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @interface IMaintenanceWindow - * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day - * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime - */ - - /** - * Constructs a new MaintenanceWindow. - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @classdesc Represents a MaintenanceWindow. - * @implements IMaintenanceWindow - * @constructor - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set - */ - function MaintenanceWindow(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceWindow day. - * @member {google.type.DayOfWeek} day - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.day = 0; - - /** - * MaintenanceWindow startTime. - * @member {google.type.ITimeOfDay|null|undefined} startTime - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.startTime = null; - - /** - * Creates a new MaintenanceWindow instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance - */ - MaintenanceWindow.create = function create(properties) { - return new MaintenanceWindow(properties); - }; - - /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceWindow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.day = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceWindow message. - * @function verify - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceWindow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.day != null && message.hasOwnProperty("day")) - switch (message.day) { - default: - return "day: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.type.TimeOfDay.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - */ - MaintenanceWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow) - return object; - var message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow(); - switch (object.day) { - default: - if (typeof object.day === "number") { - message.day = object.day; - break; - } - break; - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.day = 0; - break; - case "MONDAY": - case 1: - message.day = 1; - break; - case "TUESDAY": - case 2: - message.day = 2; - break; - case "WEDNESDAY": - case 3: - message.day = 3; - break; - case "THURSDAY": - case 4: - message.day = 4; - break; - case "FRIDAY": - case 5: - message.day = 5; - break; - case "SATURDAY": - case 6: - message.day = 6; - break; - case "SUNDAY": - case 7: - message.day = 7; - break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); - message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceWindow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; - object.startTime = null; - } - if (message.day != null && message.hasOwnProperty("day")) - object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this MaintenanceWindow to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - * @returns {Object.} JSON object - */ - MaintenanceWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceWindow - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow"; - }; - - return MaintenanceWindow; - })(); - - MaintenanceUpdatePolicy.DenyMaintenancePeriod = (function() { - - /** - * Properties of a DenyMaintenancePeriod. - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @interface IDenyMaintenancePeriod - * @property {google.type.IDate|null} [startDate] DenyMaintenancePeriod startDate - * @property {google.type.IDate|null} [endDate] DenyMaintenancePeriod endDate - * @property {google.type.ITimeOfDay|null} [time] DenyMaintenancePeriod time - */ - - /** - * Constructs a new DenyMaintenancePeriod. - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy - * @classdesc Represents a DenyMaintenancePeriod. - * @implements IDenyMaintenancePeriod - * @constructor - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set - */ - function DenyMaintenancePeriod(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenyMaintenancePeriod startDate. - * @member {google.type.IDate|null|undefined} startDate - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.startDate = null; - - /** - * DenyMaintenancePeriod endDate. - * @member {google.type.IDate|null|undefined} endDate - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.endDate = null; - - /** - * DenyMaintenancePeriod time. - * @member {google.type.ITimeOfDay|null|undefined} time - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.time = null; - - /** - * Creates a new DenyMaintenancePeriod instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod instance - */ - DenyMaintenancePeriod.create = function create(properties) { - return new DenyMaintenancePeriod(properties); - }; - - /** - * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenyMaintenancePeriod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) - $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) - $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenyMaintenancePeriod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 3: { - message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenyMaintenancePeriod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenyMaintenancePeriod message. - * @function verify - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenyMaintenancePeriod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startDate != null && message.hasOwnProperty("startDate")) { - var error = $root.google.type.Date.verify(message.startDate); - if (error) - return "startDate." + error; - } - if (message.endDate != null && message.hasOwnProperty("endDate")) { - var error = $root.google.type.Date.verify(message.endDate); - if (error) - return "endDate." + error; - } - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.type.TimeOfDay.verify(message.time); - if (error) - return "time." + error; - } - return null; - }; - - /** - * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - */ - DenyMaintenancePeriod.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod) - return object; - var message = new $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); - if (object.startDate != null) { - if (typeof object.startDate !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.startDate: object expected"); - message.startDate = $root.google.type.Date.fromObject(object.startDate); - } - if (object.endDate != null) { - if (typeof object.endDate !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.endDate: object expected"); - message.endDate = $root.google.type.Date.fromObject(object.endDate); - } - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod.time: object expected"); - message.time = $root.google.type.TimeOfDay.fromObject(object.time); - } - return message; - }; - - /** - * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod} message DenyMaintenancePeriod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenyMaintenancePeriod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startDate = null; - object.endDate = null; - object.time = null; - } - if (message.startDate != null && message.hasOwnProperty("startDate")) - object.startDate = $root.google.type.Date.toObject(message.startDate, options); - if (message.endDate != null && message.hasOwnProperty("endDate")) - object.endDate = $root.google.type.Date.toObject(message.endDate, options); - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.type.TimeOfDay.toObject(message.time, options); - return object; - }; - - /** - * Converts this DenyMaintenancePeriod to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - * @returns {Object.} JSON object - */ - DenyMaintenancePeriod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DenyMaintenancePeriod - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DenyMaintenancePeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy.DenyMaintenancePeriod"; - }; - - return DenyMaintenancePeriod; - })(); - - return MaintenanceUpdatePolicy; - })(); - - v1.MaintenanceSchedule = (function() { - - /** - * Properties of a MaintenanceSchedule. - * @memberof google.cloud.alloydb.v1 - * @interface IMaintenanceSchedule - * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime - */ - - /** - * Constructs a new MaintenanceSchedule. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a MaintenanceSchedule. - * @implements IMaintenanceSchedule - * @constructor - * @param {google.cloud.alloydb.v1.IMaintenanceSchedule=} [properties] Properties to set - */ - function MaintenanceSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceSchedule startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @instance - */ - MaintenanceSchedule.prototype.startTime = null; - - /** - * Creates a new MaintenanceSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1.IMaintenanceSchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule instance - */ - MaintenanceSchedule.create = function create(properties) { - return new MaintenanceSchedule(properties); - }; - - /** - * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.MaintenanceSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceSchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule - */ - MaintenanceSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceSchedule) - return object; - var message = new $root.google.cloud.alloydb.v1.MaintenanceSchedule(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.MaintenanceSchedule.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1.MaintenanceSchedule} message MaintenanceSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.startTime = null; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this MaintenanceSchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @instance - * @returns {Object.} JSON object - */ - MaintenanceSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceSchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.MaintenanceSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceSchedule"; - }; - - return MaintenanceSchedule; - })(); - - v1.Cluster = (function() { - - /** - * Properties of a Cluster. - * @memberof google.cloud.alloydb.v1 - * @interface ICluster - * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] Cluster backupSource - * @property {google.cloud.alloydb.v1.IMigrationSource|null} [migrationSource] Cluster migrationSource - * @property {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] Cluster cloudsqlBackupRunSource - * @property {string|null} [name] Cluster name - * @property {string|null} [displayName] Cluster displayName - * @property {string|null} [uid] Cluster uid - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.alloydb.v1.Cluster.State|null} [state] Cluster state - * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] Cluster clusterType - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion - * @property {google.cloud.alloydb.v1.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig - * @property {string|null} [network] Cluster network - * @property {string|null} [etag] Cluster etag - * @property {Object.|null} [annotations] Cluster annotations - * @property {boolean|null} [reconciling] Cluster reconciling - * @property {google.cloud.alloydb.v1.IUserPassword|null} [initialUser] Cluster initialUser - * @property {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy - * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] Cluster sslConfig - * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig - * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo - * @property {google.cloud.alloydb.v1.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig - * @property {google.cloud.alloydb.v1.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo - * @property {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig - * @property {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig - * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs - * @property {google.cloud.alloydb.v1.Cluster.IPscConfig|null} [pscConfig] Cluster pscConfig - * @property {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy - * @property {google.cloud.alloydb.v1.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule - * @property {google.cloud.alloydb.v1.SubscriptionType|null} [subscriptionType] Cluster subscriptionType - * @property {google.cloud.alloydb.v1.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata - * @property {Object.|null} [tags] Cluster tags - * @property {google.cloud.alloydb.v1.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig - */ - - /** - * Constructs a new Cluster. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a Cluster. - * @implements ICluster - * @constructor - * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set - */ - function Cluster(properties) { - this.labels = {}; - this.annotations = {}; - this.tags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Cluster backupSource. - * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.backupSource = null; - - /** - * Cluster migrationSource. - * @member {google.cloud.alloydb.v1.IMigrationSource|null|undefined} migrationSource - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.migrationSource = null; - - /** - * Cluster cloudsqlBackupRunSource. - * @member {google.cloud.alloydb.v1.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.cloudsqlBackupRunSource = null; - - /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.name = ""; - - /** - * Cluster displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.displayName = ""; - - /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.uid = ""; - - /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.createTime = null; - - /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.updateTime = null; - - /** - * Cluster deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.deleteTime = null; - - /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.labels = $util.emptyObject; - - /** - * Cluster state. - * @member {google.cloud.alloydb.v1.Cluster.State} state - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.state = 0; - - /** - * Cluster clusterType. - * @member {google.cloud.alloydb.v1.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.clusterType = 0; - - /** - * Cluster databaseVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.databaseVersion = 0; - - /** - * Cluster networkConfig. - * @member {google.cloud.alloydb.v1.Cluster.INetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.networkConfig = null; - - /** - * Cluster network. - * @member {string} network - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.network = ""; - - /** - * Cluster etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.etag = ""; - - /** - * Cluster annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.annotations = $util.emptyObject; - - /** - * Cluster reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.reconciling = false; - - /** - * Cluster initialUser. - * @member {google.cloud.alloydb.v1.IUserPassword|null|undefined} initialUser - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.initialUser = null; - - /** - * Cluster automatedBackupPolicy. - * @member {google.cloud.alloydb.v1.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.automatedBackupPolicy = null; - - /** - * Cluster sslConfig. - * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.sslConfig = null; - - /** - * Cluster encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.encryptionConfig = null; - - /** - * Cluster encryptionInfo. - * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.encryptionInfo = null; - - /** - * Cluster continuousBackupConfig. - * @member {google.cloud.alloydb.v1.IContinuousBackupConfig|null|undefined} continuousBackupConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.continuousBackupConfig = null; - - /** - * Cluster continuousBackupInfo. - * @member {google.cloud.alloydb.v1.IContinuousBackupInfo|null|undefined} continuousBackupInfo - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.continuousBackupInfo = null; - - /** - * Cluster secondaryConfig. - * @member {google.cloud.alloydb.v1.Cluster.ISecondaryConfig|null|undefined} secondaryConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.secondaryConfig = null; - - /** - * Cluster primaryConfig. - * @member {google.cloud.alloydb.v1.Cluster.IPrimaryConfig|null|undefined} primaryConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.primaryConfig = null; - - /** - * Cluster satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.satisfiesPzs = false; - - /** - * Cluster pscConfig. - * @member {google.cloud.alloydb.v1.Cluster.IPscConfig|null|undefined} pscConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.pscConfig = null; - - /** - * Cluster maintenanceUpdatePolicy. - * @member {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.maintenanceUpdatePolicy = null; - - /** - * Cluster maintenanceSchedule. - * @member {google.cloud.alloydb.v1.IMaintenanceSchedule|null|undefined} maintenanceSchedule - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.maintenanceSchedule = null; - - /** - * Cluster subscriptionType. - * @member {google.cloud.alloydb.v1.SubscriptionType} subscriptionType - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.subscriptionType = 0; - - /** - * Cluster trialMetadata. - * @member {google.cloud.alloydb.v1.Cluster.ITrialMetadata|null|undefined} trialMetadata - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.trialMetadata = null; - - /** - * Cluster tags. - * @member {Object.} tags - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.tags = $util.emptyObject; - - /** - * Cluster dataplexConfig. - * @member {google.cloud.alloydb.v1.Cluster.IDataplexConfig|null|undefined} dataplexConfig - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Cluster.prototype.dataplexConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|"cloudsqlBackupRunSource"|undefined} source - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource", "cloudsqlBackupRunSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Cluster instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {google.cloud.alloydb.v1.ICluster=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster} Cluster instance - */ - Cluster.create = function create(properties) { - return new Cluster(properties); - }; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); - if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) - $root.google.cloud.alloydb.v1.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) - $root.google.cloud.alloydb.v1.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) - $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) - $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) - $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); - if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) - $root.google.cloud.alloydb.v1.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) - $root.google.cloud.alloydb.v1.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); - if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) - $root.google.cloud.alloydb.v1.Cluster.PscConfig.encode(message.pscConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) - $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) - $root.google.cloud.alloydb.v1.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.subscriptionType != null && Object.hasOwnProperty.call(message, "subscriptionType")) - writer.uint32(/* id 38, wireType 0 =*/304).int32(message.subscriptionType); - if (message.trialMetadata != null && Object.hasOwnProperty.call(message, "trialMetadata")) - $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.encode(message.trialMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); - if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) - $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) - $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {google.cloud.alloydb.v1.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 15: { - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); - break; - } - case 16: { - message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.decode(reader, reader.uint32()); - break; - } - case 42: { - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 24: { - message.clusterType = reader.int32(); - break; - } - case 9: { - message.databaseVersion = reader.int32(); - break; - } - case 29: { - message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.network = reader.string(); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 12: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 13: { - message.reconciling = reader.bool(); - break; - } - case 14: { - message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.decode(reader, reader.uint32()); - break; - } - case 17: { - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.decode(reader, reader.uint32()); - break; - } - case 18: { - message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 27: { - message.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.decode(reader, reader.uint32()); - break; - } - case 28: { - message.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.decode(reader, reader.uint32()); - break; - } - case 22: { - message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.decode(reader, reader.uint32()); - break; - } - case 23: { - message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.decode(reader, reader.uint32()); - break; - } - case 30: { - message.satisfiesPzs = reader.bool(); - break; - } - case 31: { - message.pscConfig = $root.google.cloud.alloydb.v1.Cluster.PscConfig.decode(reader, reader.uint32()); - break; - } - case 32: { - message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); - break; - } - case 37: { - message.maintenanceSchedule = $root.google.cloud.alloydb.v1.MaintenanceSchedule.decode(reader, reader.uint32()); - break; - } - case 38: { - message.subscriptionType = reader.int32(); - break; - } - case 39: { - message.trialMetadata = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.decode(reader, reader.uint32()); - break; - } - case 41: { - if (message.tags === $util.emptyObject) - message.tags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.tags[key] = value; - break; - } - case 47: { - message.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cluster message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cluster.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.MigrationSource.verify(message.migrationSource); - if (error) - return "migrationSource." + error; - } - } - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); - if (error) - return "cloudsqlBackupRunSource." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) { - var error = $root.google.cloud.alloydb.v1.UserPassword.verify(message.initialUser); - if (error) - return "initialUser." + error; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { - var error = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); - if (error) - return "automatedBackupPolicy." + error; - } - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { - var error = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.verify(message.continuousBackupConfig); - if (error) - return "continuousBackupConfig." + error; - } - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { - var error = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.verify(message.continuousBackupInfo); - if (error) - return "continuousBackupInfo." + error; - } - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify(message.secondaryConfig); - if (error) - return "secondaryConfig." + error; - } - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify(message.primaryConfig); - if (error) - return "primaryConfig." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.PscConfig.verify(message.pscConfig); - if (error) - return "pscConfig." + error; - } - if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { - var error = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); - if (error) - return "maintenanceUpdatePolicy." + error; - } - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { - var error = $root.google.cloud.alloydb.v1.MaintenanceSchedule.verify(message.maintenanceSchedule); - if (error) - return "maintenanceSchedule." + error; - } - if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) - switch (message.subscriptionType) { - default: - return "subscriptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) { - var error = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.verify(message.trialMetadata); - if (error) - return "trialMetadata." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!$util.isObject(message.tags)) - return "tags: object expected"; - var key = Object.keys(message.tags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.tags[key[i]])) - return "tags: string{k:string} expected"; - } - if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { - var error = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.verify(message.dataplexConfig); - if (error) - return "dataplexConfig." + error; - } - return null; - }; - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster} Cluster - */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); - } - if (object.migrationSource != null) { - if (typeof object.migrationSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.migrationSource: object expected"); - message.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.fromObject(object.migrationSource); - } - if (object.cloudsqlBackupRunSource != null) { - if (typeof object.cloudsqlBackupRunSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.cloudsqlBackupRunSource: object expected"); - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "EMPTY": - case 3: - message.state = 3; - break; - case "CREATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 7: - message.state = 7; - break; - case "MAINTENANCE": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.fromObject(object.networkConfig); - } - if (object.network != null) - message.network = String(object.network); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.initialUser != null) { - if (typeof object.initialUser !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.initialUser: object expected"); - message.initialUser = $root.google.cloud.alloydb.v1.UserPassword.fromObject(object.initialUser); - } - if (object.automatedBackupPolicy != null) { - if (typeof object.automatedBackupPolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.automatedBackupPolicy: object expected"); - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); - } - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.continuousBackupConfig != null) { - if (typeof object.continuousBackupConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.continuousBackupConfig: object expected"); - message.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); - } - if (object.continuousBackupInfo != null) { - if (typeof object.continuousBackupInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.continuousBackupInfo: object expected"); - message.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); - } - if (object.secondaryConfig != null) { - if (typeof object.secondaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.secondaryConfig: object expected"); - message.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); - } - if (object.primaryConfig != null) { - if (typeof object.primaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.primaryConfig: object expected"); - message.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.fromObject(object.primaryConfig); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.pscConfig != null) { - if (typeof object.pscConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.pscConfig: object expected"); - message.pscConfig = $root.google.cloud.alloydb.v1.Cluster.PscConfig.fromObject(object.pscConfig); - } - if (object.maintenanceUpdatePolicy != null) { - if (typeof object.maintenanceUpdatePolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.maintenanceUpdatePolicy: object expected"); - message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); - } - if (object.maintenanceSchedule != null) { - if (typeof object.maintenanceSchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.maintenanceSchedule: object expected"); - message.maintenanceSchedule = $root.google.cloud.alloydb.v1.MaintenanceSchedule.fromObject(object.maintenanceSchedule); - } - switch (object.subscriptionType) { - default: - if (typeof object.subscriptionType === "number") { - message.subscriptionType = object.subscriptionType; - break; - } - break; - case "SUBSCRIPTION_TYPE_UNSPECIFIED": - case 0: - message.subscriptionType = 0; - break; - case "STANDARD": - case 1: - message.subscriptionType = 1; - break; - case "TRIAL": - case 2: - message.subscriptionType = 2; - break; - } - if (object.trialMetadata != null) { - if (typeof object.trialMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.trialMetadata: object expected"); - message.trialMetadata = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.fromObject(object.trialMetadata); - } - if (object.tags) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.tags: object expected"); - message.tags = {}; - for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) - message.tags[keys[i]] = String(object.tags[keys[i]]); - } - if (object.dataplexConfig != null) { - if (typeof object.dataplexConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.dataplexConfig: object expected"); - message.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.fromObject(object.dataplexConfig); - } - return message; - }; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {google.cloud.alloydb.v1.Cluster} message Cluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cluster.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - object.tags = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.network = ""; - object.etag = ""; - object.reconciling = false; - object.initialUser = null; - object.automatedBackupPolicy = null; - object.sslConfig = null; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.secondaryConfig = null; - object.primaryConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.continuousBackupConfig = null; - object.continuousBackupInfo = null; - object.networkConfig = null; - object.satisfiesPzs = false; - object.pscConfig = null; - object.maintenanceUpdatePolicy = null; - object.maintenanceSchedule = null; - object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; - object.trialMetadata = null; - object.dataplexConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Cluster.State[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) - object.initialUser = $root.google.cloud.alloydb.v1.UserPassword.toObject(message.initialUser, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - object.migrationSource = $root.google.cloud.alloydb.v1.MigrationSource.toObject(message.migrationSource, options); - if (options.oneofs) - object.source = "migrationSource"; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) - object.automatedBackupPolicy = $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) - object.secondaryConfig = $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) - object.primaryConfig = $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) - object.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) - object.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.toObject(message.networkConfig, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) - object.pscConfig = $root.google.cloud.alloydb.v1.Cluster.PscConfig.toObject(message.pscConfig, options); - if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) - object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) - object.maintenanceSchedule = $root.google.cloud.alloydb.v1.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); - if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) - object.subscriptionType = options.enums === String ? $root.google.cloud.alloydb.v1.SubscriptionType[message.subscriptionType] === undefined ? message.subscriptionType : $root.google.cloud.alloydb.v1.SubscriptionType[message.subscriptionType] : message.subscriptionType; - if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) - object.trialMetadata = $root.google.cloud.alloydb.v1.Cluster.TrialMetadata.toObject(message.trialMetadata, options); - if (message.tags && (keys2 = Object.keys(message.tags)).length) { - object.tags = {}; - for (var j = 0; j < keys2.length; ++j) - object.tags[keys2[j]] = message.tags[keys2[j]]; - } - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); - if (options.oneofs) - object.source = "cloudsqlBackupRunSource"; - } - if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) - object.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); - return object; - }; - - /** - * Converts this Cluster to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - * @returns {Object.} JSON object - */ - Cluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cluster - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster"; - }; - - Cluster.NetworkConfig = (function() { - - /** - * Properties of a NetworkConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface INetworkConfig - * @property {string|null} [network] NetworkConfig network - * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange - */ - - /** - * Constructs a new NetworkConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a NetworkConfig. - * @implements INetworkConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set - */ - function NetworkConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkConfig network. - * @member {string} network - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @instance - */ - NetworkConfig.prototype.network = ""; - - /** - * NetworkConfig allocatedIpRange. - * @member {string} allocatedIpRange - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @instance - */ - NetworkConfig.prototype.allocatedIpRange = ""; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig instance - */ - NetworkConfig.create = function create(properties) { - return new NetworkConfig(properties); - }; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); - return writer; - }; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.allocatedIpRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) - if (!$util.isString(message.allocatedIpRange)) - return "allocatedIpRange: string expected"; - return null; - }; - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig - */ - NetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.NetworkConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); - if (object.network != null) - message.network = String(object.network); - if (object.allocatedIpRange != null) - message.allocatedIpRange = String(object.allocatedIpRange); - return message; - }; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.NetworkConfig} message NetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.allocatedIpRange = ""; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) - object.allocatedIpRange = message.allocatedIpRange; - return object; - }; - - /** - * Converts this NetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @instance - * @returns {Object.} JSON object - */ - NetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.NetworkConfig"; - }; - - return NetworkConfig; - })(); - - Cluster.SecondaryConfig = (function() { - - /** - * Properties of a SecondaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface ISecondaryConfig - * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName - */ - - /** - * Constructs a new SecondaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a SecondaryConfig. - * @implements ISecondaryConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set - */ - function SecondaryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecondaryConfig primaryClusterName. - * @member {string} primaryClusterName - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @instance - */ - SecondaryConfig.prototype.primaryClusterName = ""; - - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig instance - */ - SecondaryConfig.create = function create(properties) { - return new SecondaryConfig(properties); - }; - - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); - return writer; - }; - - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.SecondaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.primaryClusterName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecondaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecondaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - if (!$util.isString(message.primaryClusterName)) - return "primaryClusterName: string expected"; - return null; - }; - - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.SecondaryConfig} SecondaryConfig - */ - SecondaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.SecondaryConfig(); - if (object.primaryClusterName != null) - message.primaryClusterName = String(object.primaryClusterName); - return message; - }; - - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.SecondaryConfig} message SecondaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecondaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.primaryClusterName = ""; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - object.primaryClusterName = message.primaryClusterName; - return object; - }; - - /** - * Converts this SecondaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @instance - * @returns {Object.} JSON object - */ - SecondaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecondaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.SecondaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.SecondaryConfig"; - }; - - return SecondaryConfig; - })(); - - Cluster.PrimaryConfig = (function() { - - /** - * Properties of a PrimaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface IPrimaryConfig - * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames - */ - - /** - * Constructs a new PrimaryConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a PrimaryConfig. - * @implements IPrimaryConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set - */ - function PrimaryConfig(properties) { - this.secondaryClusterNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PrimaryConfig secondaryClusterNames. - * @member {Array.} secondaryClusterNames - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @instance - */ - PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; - - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig instance - */ - PrimaryConfig.create = function create(properties) { - return new PrimaryConfig(properties); - }; - - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); - return writer; - }; - - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PrimaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) - message.secondaryClusterNames = []; - message.secondaryClusterNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PrimaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrimaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { - if (!Array.isArray(message.secondaryClusterNames)) - return "secondaryClusterNames: array expected"; - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - if (!$util.isString(message.secondaryClusterNames[i])) - return "secondaryClusterNames: string[] expected"; - } - return null; - }; - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.PrimaryConfig} PrimaryConfig - */ - PrimaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.PrimaryConfig(); - if (object.secondaryClusterNames) { - if (!Array.isArray(object.secondaryClusterNames)) - throw TypeError(".google.cloud.alloydb.v1.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); - message.secondaryClusterNames = []; - for (var i = 0; i < object.secondaryClusterNames.length; ++i) - message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.PrimaryConfig} message PrimaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrimaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.secondaryClusterNames = []; - if (message.secondaryClusterNames && message.secondaryClusterNames.length) { - object.secondaryClusterNames = []; - for (var j = 0; j < message.secondaryClusterNames.length; ++j) - object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; - } - return object; - }; - - /** - * Converts this PrimaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @instance - * @returns {Object.} JSON object - */ - PrimaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PrimaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.PrimaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.PrimaryConfig"; - }; - - return PrimaryConfig; - })(); - - Cluster.PscConfig = (function() { - - /** - * Properties of a PscConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface IPscConfig - * @property {boolean|null} [pscEnabled] PscConfig pscEnabled - * @property {number|Long|null} [serviceOwnedProjectNumber] PscConfig serviceOwnedProjectNumber - */ - - /** - * Constructs a new PscConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a PscConfig. - * @implements IPscConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.IPscConfig=} [properties] Properties to set - */ - function PscConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscConfig pscEnabled. - * @member {boolean} pscEnabled - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @instance - */ - PscConfig.prototype.pscEnabled = false; - - /** - * PscConfig serviceOwnedProjectNumber. - * @member {number|Long} serviceOwnedProjectNumber - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @instance - */ - PscConfig.prototype.serviceOwnedProjectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PscConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPscConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig instance - */ - PscConfig.create = function create(properties) { - return new PscConfig(properties); - }; - - /** - * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPscConfig} message PscConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); - if (message.serviceOwnedProjectNumber != null && Object.hasOwnProperty.call(message, "serviceOwnedProjectNumber")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.serviceOwnedProjectNumber); - return writer; - }; - - /** - * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.PscConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IPscConfig} message PscConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.PscConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pscEnabled = reader.bool(); - break; - } - case 3: { - message.serviceOwnedProjectNumber = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - if (typeof message.pscEnabled !== "boolean") - return "pscEnabled: boolean expected"; - if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) - if (!$util.isInteger(message.serviceOwnedProjectNumber) && !(message.serviceOwnedProjectNumber && $util.isInteger(message.serviceOwnedProjectNumber.low) && $util.isInteger(message.serviceOwnedProjectNumber.high))) - return "serviceOwnedProjectNumber: integer|Long expected"; - return null; - }; - - /** - * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.PscConfig} PscConfig - */ - PscConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.PscConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.PscConfig(); - if (object.pscEnabled != null) - message.pscEnabled = Boolean(object.pscEnabled); - if (object.serviceOwnedProjectNumber != null) - if ($util.Long) - (message.serviceOwnedProjectNumber = $util.Long.fromValue(object.serviceOwnedProjectNumber)).unsigned = false; - else if (typeof object.serviceOwnedProjectNumber === "string") - message.serviceOwnedProjectNumber = parseInt(object.serviceOwnedProjectNumber, 10); - else if (typeof object.serviceOwnedProjectNumber === "number") - message.serviceOwnedProjectNumber = object.serviceOwnedProjectNumber; - else if (typeof object.serviceOwnedProjectNumber === "object") - message.serviceOwnedProjectNumber = new $util.LongBits(object.serviceOwnedProjectNumber.low >>> 0, object.serviceOwnedProjectNumber.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PscConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.PscConfig} message PscConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pscEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.serviceOwnedProjectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.serviceOwnedProjectNumber = options.longs === String ? "0" : 0; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) - if (typeof message.serviceOwnedProjectNumber === "number") - object.serviceOwnedProjectNumber = options.longs === String ? String(message.serviceOwnedProjectNumber) : message.serviceOwnedProjectNumber; - else - object.serviceOwnedProjectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.serviceOwnedProjectNumber) : options.longs === Number ? new $util.LongBits(message.serviceOwnedProjectNumber.low >>> 0, message.serviceOwnedProjectNumber.high >>> 0).toNumber() : message.serviceOwnedProjectNumber; - return object; - }; - - /** - * Converts this PscConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @instance - * @returns {Object.} JSON object - */ - PscConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.PscConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.PscConfig"; - }; - - return PscConfig; - })(); - - Cluster.TrialMetadata = (function() { - - /** - * Properties of a TrialMetadata. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface ITrialMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] TrialMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TrialMetadata endTime - * @property {google.protobuf.ITimestamp|null} [upgradeTime] TrialMetadata upgradeTime - * @property {google.protobuf.ITimestamp|null} [graceEndTime] TrialMetadata graceEndTime - */ - - /** - * Constructs a new TrialMetadata. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a TrialMetadata. - * @implements ITrialMetadata - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata=} [properties] Properties to set - */ - function TrialMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrialMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.startTime = null; - - /** - * TrialMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.endTime = null; - - /** - * TrialMetadata upgradeTime. - * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.upgradeTime = null; - - /** - * TrialMetadata graceEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} graceEndTime - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.graceEndTime = null; - - /** - * Creates a new TrialMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata instance - */ - TrialMetadata.create = function create(properties) { - return new TrialMetadata(properties); - }; - - /** - * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrialMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) - $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.graceEndTime != null && Object.hasOwnProperty.call(message, "graceEndTime")) - $root.google.protobuf.Timestamp.encode(message.graceEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.TrialMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrialMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrialMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.TrialMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.graceEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrialMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrialMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrialMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); - if (error) - return "upgradeTime." + error; - } - if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.graceEndTime); - if (error) - return "graceEndTime." + error; - } - return null; - }; - - /** - * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.TrialMetadata} TrialMetadata - */ - TrialMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.TrialMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.TrialMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.upgradeTime != null) { - if (typeof object.upgradeTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.upgradeTime: object expected"); - message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); - } - if (object.graceEndTime != null) { - if (typeof object.graceEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Cluster.TrialMetadata.graceEndTime: object expected"); - message.graceEndTime = $root.google.protobuf.Timestamp.fromObject(object.graceEndTime); - } - return message; - }; - - /** - * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1.Cluster.TrialMetadata} message TrialMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrialMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.upgradeTime = null; - object.graceEndTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) - object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); - if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) - object.graceEndTime = $root.google.protobuf.Timestamp.toObject(message.graceEndTime, options); - return object; - }; - - /** - * Converts this TrialMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @instance - * @returns {Object.} JSON object - */ - TrialMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrialMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.TrialMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrialMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.TrialMetadata"; - }; - - return TrialMetadata; - })(); - - Cluster.DataplexConfig = (function() { - - /** - * Properties of a DataplexConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @interface IDataplexConfig - * @property {boolean|null} [enabled] DataplexConfig enabled - */ - - /** - * Constructs a new DataplexConfig. - * @memberof google.cloud.alloydb.v1.Cluster - * @classdesc Represents a DataplexConfig. - * @implements IDataplexConfig - * @constructor - * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig=} [properties] Properties to set - */ - function DataplexConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataplexConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @instance - */ - DataplexConfig.prototype.enabled = false; - - /** - * Creates a new DataplexConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig instance - */ - DataplexConfig.create = function create(properties) { - return new DataplexConfig(properties); - }; - - /** - * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataplexConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - return writer; - }; - - /** - * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataplexConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.DataplexConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataplexConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataplexConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataplexConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - return null; - }; - - /** - * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig - */ - DataplexConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Cluster.DataplexConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Cluster.DataplexConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - return message; - }; - - /** - * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1.Cluster.DataplexConfig} message DataplexConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataplexConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enabled = false; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - return object; - }; - - /** - * Converts this DataplexConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @instance - * @returns {Object.} JSON object - */ - DataplexConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataplexConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.DataplexConfig"; - }; - - return DataplexConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1.Cluster.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} EMPTY=3 EMPTY value - * @property {number} CREATING=4 CREATING value - * @property {number} DELETING=5 DELETING value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value - * @property {number} MAINTENANCE=8 MAINTENANCE value - * @property {number} PROMOTING=9 PROMOTING value - */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "EMPTY"] = 3; - values[valuesById[4] = "CREATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "BOOTSTRAPPING"] = 7; - values[valuesById[8] = "MAINTENANCE"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * ClusterType enum. - * @name google.cloud.alloydb.v1.Cluster.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} SECONDARY=2 SECONDARY value - */ - Cluster.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "SECONDARY"] = 2; - return values; - })(); - - return Cluster; - })(); - - v1.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.cloud.alloydb.v1 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {string|null} [uid] Instance uid - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {Object.|null} [labels] Instance labels - * @property {google.cloud.alloydb.v1.Instance.State|null} [state] Instance state - * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {google.cloud.alloydb.v1.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig - * @property {google.cloud.alloydb.v1.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType - * @property {string|null} [gceZone] Instance gceZone - * @property {Object.|null} [databaseFlags] Instance databaseFlags - * @property {google.cloud.alloydb.v1.Instance.INode|null} [writableNode] Instance writableNode - * @property {Array.|null} [nodes] Instance nodes - * @property {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig - * @property {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null} [observabilityConfig] Instance observabilityConfig - * @property {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig - * @property {string|null} [ipAddress] Instance ipAddress - * @property {string|null} [publicIpAddress] Instance publicIpAddress - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - * @property {Object.|null} [annotations] Instance annotations - * @property {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig - * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs - * @property {google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig - * @property {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig - * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses - * @property {google.cloud.alloydb.v1.Instance.ActivationPolicy|null} [activationPolicy] Instance activationPolicy - * @property {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null} [connectionPoolConfig] Instance connectionPoolConfig - */ - - /** - * Constructs a new Instance. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.labels = {}; - this.databaseFlags = {}; - this.nodes = []; - this.annotations = {}; - this.outboundPublicIpAddresses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Instance name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.displayName = ""; - - /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.uid = ""; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.deleteTime = null; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance state. - * @member {google.cloud.alloydb.v1.Instance.State} state - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance instanceType. - * @member {google.cloud.alloydb.v1.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.instanceType = 0; - - /** - * Instance machineConfig. - * @member {google.cloud.alloydb.v1.Instance.IMachineConfig|null|undefined} machineConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.machineConfig = null; - - /** - * Instance availabilityType. - * @member {google.cloud.alloydb.v1.Instance.AvailabilityType} availabilityType - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.availabilityType = 0; - - /** - * Instance gceZone. - * @member {string} gceZone - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.gceZone = ""; - - /** - * Instance databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.databaseFlags = $util.emptyObject; - - /** - * Instance writableNode. - * @member {google.cloud.alloydb.v1.Instance.INode|null|undefined} writableNode - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.writableNode = null; - - /** - * Instance nodes. - * @member {Array.} nodes - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.nodes = $util.emptyArray; - - /** - * Instance queryInsightsConfig. - * @member {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.queryInsightsConfig = null; - - /** - * Instance observabilityConfig. - * @member {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig|null|undefined} observabilityConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.observabilityConfig = null; - - /** - * Instance readPoolConfig. - * @member {google.cloud.alloydb.v1.Instance.IReadPoolConfig|null|undefined} readPoolConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.readPoolConfig = null; - - /** - * Instance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.ipAddress = ""; - - /** - * Instance publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.publicIpAddress = ""; - - /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.reconciling = false; - - /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.etag = ""; - - /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.annotations = $util.emptyObject; - - /** - * Instance clientConnectionConfig. - * @member {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.clientConnectionConfig = null; - - /** - * Instance satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.satisfiesPzs = false; - - /** - * Instance pscInstanceConfig. - * @member {google.cloud.alloydb.v1.Instance.IPscInstanceConfig|null|undefined} pscInstanceConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.pscInstanceConfig = null; - - /** - * Instance networkConfig. - * @member {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.networkConfig = null; - - /** - * Instance outboundPublicIpAddresses. - * @member {Array.} outboundPublicIpAddresses - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; - - /** - * Instance activationPolicy. - * @member {google.cloud.alloydb.v1.Instance.ActivationPolicy} activationPolicy - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.activationPolicy = 0; - - /** - * Instance connectionPoolConfig. - * @member {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig|null|undefined} connectionPoolConfig - * @memberof google.cloud.alloydb.v1.Instance - * @instance - */ - Instance.prototype.connectionPoolConfig = null; - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {google.cloud.alloydb.v1.IInstance=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {google.cloud.alloydb.v1.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); - if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) - $root.google.cloud.alloydb.v1.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); - if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) - $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) - $root.google.cloud.alloydb.v1.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.alloydb.v1.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) - $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) - $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); - if (message.observabilityConfig != null && Object.hasOwnProperty.call(message, "observabilityConfig")) - $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.encode(message.observabilityConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.publicIpAddress); - if (message.pscInstanceConfig != null && Object.hasOwnProperty.call(message, "pscInstanceConfig")) - $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) - for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); - if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) - writer.uint32(/* id 35, wireType 0 =*/280).int32(message.activationPolicy); - if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) - $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {google.cloud.alloydb.v1.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 9: { - message.instanceType = reader.int32(); - break; - } - case 10: { - message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.availabilityType = reader.int32(); - break; - } - case 12: { - message.gceZone = reader.string(); - break; - } - case 13: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.databaseFlags[key] = value; - break; - } - case 19: { - message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32()); - break; - } - case 20: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.alloydb.v1.Instance.Node.decode(reader, reader.uint32())); - break; - } - case 21: { - message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 26: { - message.observabilityConfig = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 14: { - message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.ipAddress = reader.string(); - break; - } - case 27: { - message.publicIpAddress = reader.string(); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { - message.etag = reader.string(); - break; - } - case 18: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 23: { - message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); - break; - } - case 24: { - message.satisfiesPzs = reader.bool(); - break; - } - case 28: { - message.pscInstanceConfig = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 29: { - message.networkConfig = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); - break; - } - case 34: { - if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) - message.outboundPublicIpAddresses = []; - message.outboundPublicIpAddresses.push(reader.string()); - break; - } - case 35: { - message.activationPolicy = reader.int32(); - break; - } - case 37: { - message.connectionPoolConfig = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.MachineConfig.verify(message.machineConfig); - if (error) - return "machineConfig." + error; - } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - switch (message.availabilityType) { - default: - return "availabilityType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - if (!$util.isString(message.gceZone)) - return "gceZone: string expected"; - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) { - var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.writableNode); - if (error) - return "writableNode." + error; - } - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); - if (error) - return "queryInsightsConfig." + error; - } - if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify(message.observabilityConfig); - if (error) - return "observabilityConfig." + error; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify(message.readPoolConfig); - if (error) - return "readPoolConfig." + error; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); - if (error) - return "clientConnectionConfig." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify(message.pscInstanceConfig); - if (error) - return "pscInstanceConfig." + error; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { - if (!Array.isArray(message.outboundPublicIpAddresses)) - return "outboundPublicIpAddresses: array expected"; - for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) - if (!$util.isString(message.outboundPublicIpAddresses[i])) - return "outboundPublicIpAddresses: string[] expected"; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - switch (message.activationPolicy) { - default: - return "activationPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { - var error = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify(message.connectionPoolConfig); - if (error) - return "connectionPoolConfig." + error; - } - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "MAINTENANCE": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - if (object.machineConfig != null) { - if (typeof object.machineConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.machineConfig: object expected"); - message.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.fromObject(object.machineConfig); - } - switch (object.availabilityType) { - default: - if (typeof object.availabilityType === "number") { - message.availabilityType = object.availabilityType; - break; - } - break; - case "AVAILABILITY_TYPE_UNSPECIFIED": - case 0: - message.availabilityType = 0; - break; - case "ZONAL": - case 1: - message.availabilityType = 1; - break; - case "REGIONAL": - case 2: - message.availabilityType = 2; - break; - } - if (object.gceZone != null) - message.gceZone = String(object.gceZone); - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - if (object.writableNode != null) { - if (typeof object.writableNode !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.writableNode: object expected"); - message.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.writableNode); - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.nodes: object expected"); - message.nodes[i] = $root.google.cloud.alloydb.v1.Instance.Node.fromObject(object.nodes[i]); - } - } - if (object.queryInsightsConfig != null) { - if (typeof object.queryInsightsConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.queryInsightsConfig: object expected"); - message.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); - } - if (object.observabilityConfig != null) { - if (typeof object.observabilityConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.observabilityConfig: object expected"); - message.observabilityConfig = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.fromObject(object.observabilityConfig); - } - if (object.readPoolConfig != null) { - if (typeof object.readPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.readPoolConfig: object expected"); - message.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); - } - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.clientConnectionConfig != null) { - if (typeof object.clientConnectionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.clientConnectionConfig: object expected"); - message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.pscInstanceConfig != null) { - if (typeof object.pscInstanceConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.pscInstanceConfig: object expected"); - message.pscInstanceConfig = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.fromObject(object.pscInstanceConfig); - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); - } - if (object.outboundPublicIpAddresses) { - if (!Array.isArray(object.outboundPublicIpAddresses)) - throw TypeError(".google.cloud.alloydb.v1.Instance.outboundPublicIpAddresses: array expected"); - message.outboundPublicIpAddresses = []; - for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) - message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); - } - switch (object.activationPolicy) { - default: - if (typeof object.activationPolicy === "number") { - message.activationPolicy = object.activationPolicy; - break; - } - break; - case "ACTIVATION_POLICY_UNSPECIFIED": - case 0: - message.activationPolicy = 0; - break; - case "ALWAYS": - case 1: - message.activationPolicy = 1; - break; - case "NEVER": - case 2: - message.activationPolicy = 2; - break; - } - if (object.connectionPoolConfig != null) { - if (typeof object.connectionPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.connectionPoolConfig: object expected"); - message.connectionPoolConfig = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.fromObject(object.connectionPoolConfig); - } - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {google.cloud.alloydb.v1.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.nodes = []; - object.outboundPublicIpAddresses = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.databaseFlags = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.machineConfig = null; - object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; - object.gceZone = ""; - object.readPoolConfig = null; - object.ipAddress = ""; - object.reconciling = false; - object.etag = ""; - object.writableNode = null; - object.queryInsightsConfig = null; - object.clientConnectionConfig = null; - object.satisfiesPzs = false; - object.observabilityConfig = null; - object.publicIpAddress = ""; - object.pscInstanceConfig = null; - object.networkConfig = null; - object.activationPolicy = options.enums === String ? "ACTIVATION_POLICY_UNSPECIFIED" : 0; - object.connectionPoolConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Instance.State[message.state] : message.state; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) - object.machineConfig = $root.google.cloud.alloydb.v1.Instance.MachineConfig.toObject(message.machineConfig, options); - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - object.gceZone = message.gceZone; - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) - object.readPoolConfig = $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) - object.writableNode = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.writableNode, options); - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.alloydb.v1.Instance.Node.toObject(message.nodes[j], options); - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) - object.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); - if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) - object.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) - object.observabilityConfig = $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.toObject(message.observabilityConfig, options); - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) - object.pscInstanceConfig = $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); - if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { - object.outboundPublicIpAddresses = []; - for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) - object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - object.activationPolicy = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.ActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.alloydb.v1.Instance.ActivationPolicy[message.activationPolicy] : message.activationPolicy; - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) - object.connectionPoolConfig = $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance"; - }; - - Instance.MachineConfig = (function() { - - /** - * Properties of a MachineConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IMachineConfig - * @property {number|null} [cpuCount] MachineConfig cpuCount - * @property {string|null} [machineType] MachineConfig machineType - */ - - /** - * Constructs a new MachineConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a MachineConfig. - * @implements IMachineConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set - */ - function MachineConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MachineConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.cpuCount = 0; - - /** - * MachineConfig machineType. - * @member {string} machineType - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.machineType = ""; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig instance - */ - MachineConfig.create = function create(properties) { - return new MachineConfig(properties); - }; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineType); - return writer; - }; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.MachineConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - break; - } - case 4: { - message.machineType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MachineConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MachineConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - return null; - }; - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.MachineConfig} MachineConfig - */ - MachineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.MachineConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.MachineConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; - if (object.machineType != null) - message.machineType = String(object.machineType); - return message; - }; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.MachineConfig} message MachineConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MachineConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpuCount = 0; - object.machineType = ""; - } - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - return object; - }; - - /** - * Converts this MachineConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @instance - * @returns {Object.} JSON object - */ - MachineConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MachineConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.MachineConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.MachineConfig"; - }; - - return MachineConfig; - })(); - - Instance.Node = (function() { - - /** - * Properties of a Node. - * @memberof google.cloud.alloydb.v1.Instance - * @interface INode - * @property {string|null} [zoneId] Node zoneId - * @property {string|null} [id] Node id - * @property {string|null} [ip] Node ip - * @property {string|null} [state] Node state - */ - - /** - * Constructs a new Node. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Node zoneId. - * @member {string} zoneId - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.zoneId = ""; - - /** - * Node id. - * @member {string} id - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.id = ""; - - /** - * Node ip. - * @member {string} ip - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.ip = ""; - - /** - * Node state. - * @member {string} state - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - */ - Node.prototype.state = ""; - - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {google.cloud.alloydb.v1.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); - return writer; - }; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {google.cloud.alloydb.v1.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.zoneId = reader.string(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.ip = reader.string(); - break; - } - case 4: { - message.state = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - if (!$util.isString(message.zoneId)) - return "zoneId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.ip != null && message.hasOwnProperty("ip")) - if (!$util.isString(message.ip)) - return "ip: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; - return null; - }; - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.Node) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.Node(); - if (object.zoneId != null) - message.zoneId = String(object.zoneId); - if (object.id != null) - message.id = String(object.id); - if (object.ip != null) - message.ip = String(object.ip); - if (object.state != null) - message.state = String(object.state); - return message; - }; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {google.cloud.alloydb.v1.Instance.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.zoneId = ""; - object.id = ""; - object.ip = ""; - object.state = ""; - } - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - object.zoneId = message.zoneId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.ip != null && message.hasOwnProperty("ip")) - object.ip = message.ip; - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - return object; - }; - - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.Node - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.Node"; - }; - - return Node; - })(); - - Instance.QueryInsightsInstanceConfig = (function() { - - /** - * Properties of a QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IQueryInsightsInstanceConfig - * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags - * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress - * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength - * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute - */ - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a QueryInsightsInstanceConfig. - * @implements IQueryInsightsInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - */ - function QueryInsightsInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInsightsInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - - /** - * QueryInsightsInstanceConfig recordClientAddress. - * @member {boolean|null|undefined} recordClientAddress - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordClientAddress = null; - - /** - * QueryInsightsInstanceConfig queryStringLength. - * @member {number} queryStringLength - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryStringLength = 0; - - /** - * QueryInsightsInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance - */ - QueryInsightsInstanceConfig.create = function create(properties) { - return new QueryInsightsInstanceConfig(properties); - }; - - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); - if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); - if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); - return writer; - }; - - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.recordApplicationTags = reader.bool(); - break; - } - case 3: { - message.recordClientAddress = reader.bool(); - break; - } - case 4: { - message.queryStringLength = reader.uint32(); - break; - } - case 5: { - message.queryPlansPerMinute = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInsightsInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInsightsInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - properties._recordClientAddress = 1; - if (typeof message.recordClientAddress !== "boolean") - return "recordClientAddress: boolean expected"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - if (!$util.isInteger(message.queryStringLength)) - return "queryStringLength: integer expected"; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - return null; - }; - - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - */ - QueryInsightsInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig(); - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.recordClientAddress != null) - message.recordClientAddress = Boolean(object.recordClientAddress); - if (object.queryStringLength != null) - message.queryStringLength = object.queryStringLength >>> 0; - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; - return message; - }; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInsightsInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.queryStringLength = 0; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - object.recordClientAddress = message.recordClientAddress; - if (options.oneofs) - object._recordClientAddress = "recordClientAddress"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = message.queryStringLength; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - return object; - }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig"; - }; - - return QueryInsightsInstanceConfig; - })(); - - Instance.ObservabilityInstanceConfig = (function() { - - /** - * Properties of an ObservabilityInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IObservabilityInstanceConfig - * @property {boolean|null} [enabled] ObservabilityInstanceConfig enabled - * @property {boolean|null} [preserveComments] ObservabilityInstanceConfig preserveComments - * @property {boolean|null} [trackWaitEvents] ObservabilityInstanceConfig trackWaitEvents - * @property {boolean|null} [trackWaitEventTypes] ObservabilityInstanceConfig trackWaitEventTypes - * @property {number|null} [maxQueryStringLength] ObservabilityInstanceConfig maxQueryStringLength - * @property {boolean|null} [recordApplicationTags] ObservabilityInstanceConfig recordApplicationTags - * @property {number|null} [queryPlansPerMinute] ObservabilityInstanceConfig queryPlansPerMinute - * @property {boolean|null} [trackActiveQueries] ObservabilityInstanceConfig trackActiveQueries - */ - - /** - * Constructs a new ObservabilityInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents an ObservabilityInstanceConfig. - * @implements IObservabilityInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig=} [properties] Properties to set - */ - function ObservabilityInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ObservabilityInstanceConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.enabled = null; - - /** - * ObservabilityInstanceConfig preserveComments. - * @member {boolean|null|undefined} preserveComments - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.preserveComments = null; - - /** - * ObservabilityInstanceConfig trackWaitEvents. - * @member {boolean|null|undefined} trackWaitEvents - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackWaitEvents = null; - - /** - * ObservabilityInstanceConfig trackWaitEventTypes. - * @member {boolean|null|undefined} trackWaitEventTypes - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackWaitEventTypes = null; - - /** - * ObservabilityInstanceConfig maxQueryStringLength. - * @member {number|null|undefined} maxQueryStringLength - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.maxQueryStringLength = null; - - /** - * ObservabilityInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.recordApplicationTags = null; - - /** - * ObservabilityInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.queryPlansPerMinute = null; - - /** - * ObservabilityInstanceConfig trackActiveQueries. - * @member {boolean|null|undefined} trackActiveQueries - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackActiveQueries = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_preserveComments", { - get: $util.oneOfGetter($oneOfFields = ["preserveComments"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEvents", { - get: $util.oneOfGetter($oneOfFields = ["trackWaitEvents"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEventTypes", { - get: $util.oneOfGetter($oneOfFields = ["trackWaitEventTypes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_maxQueryStringLength", { - get: $util.oneOfGetter($oneOfFields = ["maxQueryStringLength"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackActiveQueries", { - get: $util.oneOfGetter($oneOfFields = ["trackActiveQueries"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ObservabilityInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig instance - */ - ObservabilityInstanceConfig.create = function create(properties) { - return new ObservabilityInstanceConfig(properties); - }; - - /** - * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservabilityInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.preserveComments != null && Object.hasOwnProperty.call(message, "preserveComments")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.preserveComments); - if (message.trackWaitEvents != null && Object.hasOwnProperty.call(message, "trackWaitEvents")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trackWaitEvents); - if (message.trackWaitEventTypes != null && Object.hasOwnProperty.call(message, "trackWaitEventTypes")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.trackWaitEventTypes); - if (message.maxQueryStringLength != null && Object.hasOwnProperty.call(message, "maxQueryStringLength")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxQueryStringLength); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recordApplicationTags); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryPlansPerMinute); - if (message.trackActiveQueries != null && Object.hasOwnProperty.call(message, "trackActiveQueries")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.trackActiveQueries); - return writer; - }; - - /** - * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservabilityInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservabilityInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 2: { - message.preserveComments = reader.bool(); - break; - } - case 3: { - message.trackWaitEvents = reader.bool(); - break; - } - case 4: { - message.trackWaitEventTypes = reader.bool(); - break; - } - case 5: { - message.maxQueryStringLength = reader.int32(); - break; - } - case 6: { - message.recordApplicationTags = reader.bool(); - break; - } - case 7: { - message.queryPlansPerMinute = reader.int32(); - break; - } - case 8: { - message.trackActiveQueries = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservabilityInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObservabilityInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObservabilityInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { - properties._preserveComments = 1; - if (typeof message.preserveComments !== "boolean") - return "preserveComments: boolean expected"; - } - if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { - properties._trackWaitEvents = 1; - if (typeof message.trackWaitEvents !== "boolean") - return "trackWaitEvents: boolean expected"; - } - if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { - properties._trackWaitEventTypes = 1; - if (typeof message.trackWaitEventTypes !== "boolean") - return "trackWaitEventTypes: boolean expected"; - } - if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { - properties._maxQueryStringLength = 1; - if (!$util.isInteger(message.maxQueryStringLength)) - return "maxQueryStringLength: integer expected"; - } - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { - properties._trackActiveQueries = 1; - if (typeof message.trackActiveQueries !== "boolean") - return "trackActiveQueries: boolean expected"; - } - return null; - }; - - /** - * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - */ - ObservabilityInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.preserveComments != null) - message.preserveComments = Boolean(object.preserveComments); - if (object.trackWaitEvents != null) - message.trackWaitEvents = Boolean(object.trackWaitEvents); - if (object.trackWaitEventTypes != null) - message.trackWaitEventTypes = Boolean(object.trackWaitEventTypes); - if (object.maxQueryStringLength != null) - message.maxQueryStringLength = object.maxQueryStringLength | 0; - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute | 0; - if (object.trackActiveQueries != null) - message.trackActiveQueries = Boolean(object.trackActiveQueries); - return message; - }; - - /** - * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig} message ObservabilityInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObservabilityInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { - object.preserveComments = message.preserveComments; - if (options.oneofs) - object._preserveComments = "preserveComments"; - } - if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { - object.trackWaitEvents = message.trackWaitEvents; - if (options.oneofs) - object._trackWaitEvents = "trackWaitEvents"; - } - if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { - object.trackWaitEventTypes = message.trackWaitEventTypes; - if (options.oneofs) - object._trackWaitEventTypes = "trackWaitEventTypes"; - } - if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { - object.maxQueryStringLength = message.maxQueryStringLength; - if (options.oneofs) - object._maxQueryStringLength = "maxQueryStringLength"; - } - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { - object.trackActiveQueries = message.trackActiveQueries; - if (options.oneofs) - object._trackActiveQueries = "trackActiveQueries"; - } - return object; - }; - - /** - * Converts this ObservabilityInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - ObservabilityInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ObservabilityInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ObservabilityInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ObservabilityInstanceConfig"; - }; - - return ObservabilityInstanceConfig; - })(); - - Instance.ReadPoolConfig = (function() { - - /** - * Properties of a ReadPoolConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount - */ - - /** - * Constructs a new ReadPoolConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set - */ - function ReadPoolConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @instance - */ - ReadPoolConfig.prototype.nodeCount = 0; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig instance - */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); - }; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); - return writer; - }; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - return null; - }; - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig - */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.ReadPoolConfig} message ReadPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeCount = 0; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - return object; - }; - - /** - * Converts this ReadPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ReadPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ReadPoolConfig"; - }; - - return ReadPoolConfig; - })(); - - Instance.ClientConnectionConfig = (function() { - - /** - * Properties of a ClientConnectionConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IClientConnectionConfig - * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors - * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig - */ - - /** - * Constructs a new ClientConnectionConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a ClientConnectionConfig. - * @implements IClientConnectionConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set - */ - function ClientConnectionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientConnectionConfig requireConnectors. - * @member {boolean} requireConnectors - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @instance - */ - ClientConnectionConfig.prototype.requireConnectors = false; - - /** - * ClientConnectionConfig sslConfig. - * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @instance - */ - ClientConnectionConfig.prototype.sslConfig = null; - - /** - * Creates a new ClientConnectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig instance - */ - ClientConnectionConfig.create = function create(properties) { - return new ClientConnectionConfig(properties); - }; - - /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConnectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConnectionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requireConnectors = reader.bool(); - break; - } - case 2: { - message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientConnectionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientConnectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) - if (typeof message.requireConnectors !== "boolean") - return "requireConnectors: boolean expected"; - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - return null; - }; - - /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig - */ - ClientConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); - if (object.requireConnectors != null) - message.requireConnectors = Boolean(object.requireConnectors); - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.ClientConnectionConfig.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); - } - return message; - }; - - /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} message ClientConnectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientConnectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.requireConnectors = false; - object.sslConfig = null; - } - if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) - object.requireConnectors = message.requireConnectors; - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); - return object; - }; - - /** - * Converts this ClientConnectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @instance - * @returns {Object.} JSON object - */ - ClientConnectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientConnectionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ClientConnectionConfig"; - }; - - return ClientConnectionConfig; - })(); - - Instance.PscInterfaceConfig = (function() { - - /** - * Properties of a PscInterfaceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IPscInterfaceConfig - * @property {string|null} [networkAttachmentResource] PscInterfaceConfig networkAttachmentResource - */ - - /** - * Constructs a new PscInterfaceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a PscInterfaceConfig. - * @implements IPscInterfaceConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig=} [properties] Properties to set - */ - function PscInterfaceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscInterfaceConfig networkAttachmentResource. - * @member {string} networkAttachmentResource - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.networkAttachmentResource = ""; - - /** - * Creates a new PscInterfaceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig instance - */ - PscInterfaceConfig.create = function create(properties) { - return new PscInterfaceConfig(properties); - }; - - /** - * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInterfaceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkAttachmentResource != null && Object.hasOwnProperty.call(message, "networkAttachmentResource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkAttachmentResource); - return writer; - }; - - /** - * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInterfaceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInterfaceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.networkAttachmentResource = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInterfaceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscInterfaceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscInterfaceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) - if (!$util.isString(message.networkAttachmentResource)) - return "networkAttachmentResource: string expected"; - return null; - }; - - /** - * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} PscInterfaceConfig - */ - PscInterfaceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig(); - if (object.networkAttachmentResource != null) - message.networkAttachmentResource = String(object.networkAttachmentResource); - return message; - }; - - /** - * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.PscInterfaceConfig} message PscInterfaceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscInterfaceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.networkAttachmentResource = ""; - if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) - object.networkAttachmentResource = message.networkAttachmentResource; - return object; - }; - - /** - * Converts this PscInterfaceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @instance - * @returns {Object.} JSON object - */ - PscInterfaceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscInterfaceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.PscInterfaceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscInterfaceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscInterfaceConfig"; - }; - - return PscInterfaceConfig; - })(); - - Instance.PscAutoConnectionConfig = (function() { - - /** - * Properties of a PscAutoConnectionConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IPscAutoConnectionConfig - * @property {string|null} [consumerProject] PscAutoConnectionConfig consumerProject - * @property {string|null} [consumerNetwork] PscAutoConnectionConfig consumerNetwork - * @property {string|null} [ipAddress] PscAutoConnectionConfig ipAddress - * @property {string|null} [status] PscAutoConnectionConfig status - * @property {string|null} [consumerNetworkStatus] PscAutoConnectionConfig consumerNetworkStatus - */ - - /** - * Constructs a new PscAutoConnectionConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a PscAutoConnectionConfig. - * @implements IPscAutoConnectionConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig=} [properties] Properties to set - */ - function PscAutoConnectionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscAutoConnectionConfig consumerProject. - * @member {string} consumerProject - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerProject = ""; - - /** - * PscAutoConnectionConfig consumerNetwork. - * @member {string} consumerNetwork - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerNetwork = ""; - - /** - * PscAutoConnectionConfig ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.ipAddress = ""; - - /** - * PscAutoConnectionConfig status. - * @member {string} status - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.status = ""; - - /** - * PscAutoConnectionConfig consumerNetworkStatus. - * @member {string} consumerNetworkStatus - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerNetworkStatus = ""; - - /** - * Creates a new PscAutoConnectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig instance - */ - PscAutoConnectionConfig.create = function create(properties) { - return new PscAutoConnectionConfig(properties); - }; - - /** - * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscAutoConnectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); - if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNetwork); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); - if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.consumerNetworkStatus); - return writer; - }; - - /** - * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscAutoConnectionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.consumerProject = reader.string(); - break; - } - case 2: { - message.consumerNetwork = reader.string(); - break; - } - case 3: { - message.ipAddress = reader.string(); - break; - } - case 4: { - message.status = reader.string(); - break; - } - case 5: { - message.consumerNetworkStatus = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscAutoConnectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscAutoConnectionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscAutoConnectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) - if (!$util.isString(message.consumerProject)) - return "consumerProject: string expected"; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) - if (!$util.isString(message.consumerNetwork)) - return "consumerNetwork: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) - if (!$util.isString(message.consumerNetworkStatus)) - return "consumerNetworkStatus: string expected"; - return null; - }; - - /** - * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - */ - PscAutoConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig(); - if (object.consumerProject != null) - message.consumerProject = String(object.consumerProject); - if (object.consumerNetwork != null) - message.consumerNetwork = String(object.consumerNetwork); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.status != null) - message.status = String(object.status); - if (object.consumerNetworkStatus != null) - message.consumerNetworkStatus = String(object.consumerNetworkStatus); - return message; - }; - - /** - * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig} message PscAutoConnectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscAutoConnectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.consumerProject = ""; - object.consumerNetwork = ""; - object.ipAddress = ""; - object.status = ""; - object.consumerNetworkStatus = ""; - } - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) - object.consumerProject = message.consumerProject; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) - object.consumerNetwork = message.consumerNetwork; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) - object.consumerNetworkStatus = message.consumerNetworkStatus; - return object; - }; - - /** - * Converts this PscAutoConnectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @instance - * @returns {Object.} JSON object - */ - PscAutoConnectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscAutoConnectionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscAutoConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig"; - }; - - return PscAutoConnectionConfig; - })(); - - Instance.PscInstanceConfig = (function() { - - /** - * Properties of a PscInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IPscInstanceConfig - * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink - * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects - * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName - * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs - * @property {Array.|null} [pscAutoConnections] PscInstanceConfig pscAutoConnections - */ - - /** - * Constructs a new PscInstanceConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a PscInstanceConfig. - * @implements IPscInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig=} [properties] Properties to set - */ - function PscInstanceConfig(properties) { - this.allowedConsumerProjects = []; - this.pscInterfaceConfigs = []; - this.pscAutoConnections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscInstanceConfig serviceAttachmentLink. - * @member {string} serviceAttachmentLink - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.serviceAttachmentLink = ""; - - /** - * PscInstanceConfig allowedConsumerProjects. - * @member {Array.} allowedConsumerProjects - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.allowedConsumerProjects = $util.emptyArray; - - /** - * PscInstanceConfig pscDnsName. - * @member {string} pscDnsName - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscDnsName = ""; - - /** - * PscInstanceConfig pscInterfaceConfigs. - * @member {Array.} pscInterfaceConfigs - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; - - /** - * PscInstanceConfig pscAutoConnections. - * @member {Array.} pscAutoConnections - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscAutoConnections = $util.emptyArray; - - /** - * Creates a new PscInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig instance - */ - PscInstanceConfig.create = function create(properties) { - return new PscInstanceConfig(properties); - }; - - /** - * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAttachmentLink != null && Object.hasOwnProperty.call(message, "serviceAttachmentLink")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachmentLink); - if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) - for (var i = 0; i < message.allowedConsumerProjects.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); - if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscDnsName); - if (message.pscInterfaceConfigs != null && message.pscInterfaceConfigs.length) - for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) - $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.encode(message.pscInterfaceConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.pscAutoConnections != null && message.pscAutoConnections.length) - for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.PscInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serviceAttachmentLink = reader.string(); - break; - } - case 2: { - if (!(message.allowedConsumerProjects && message.allowedConsumerProjects.length)) - message.allowedConsumerProjects = []; - message.allowedConsumerProjects.push(reader.string()); - break; - } - case 7: { - message.pscDnsName = reader.string(); - break; - } - case 8: { - if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) - message.pscInterfaceConfigs = []; - message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.pscAutoConnections && message.pscAutoConnections.length)) - message.pscAutoConnections = []; - message.pscAutoConnections.push($root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) - if (!$util.isString(message.serviceAttachmentLink)) - return "serviceAttachmentLink: string expected"; - if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { - if (!Array.isArray(message.allowedConsumerProjects)) - return "allowedConsumerProjects: array expected"; - for (var i = 0; i < message.allowedConsumerProjects.length; ++i) - if (!$util.isString(message.allowedConsumerProjects[i])) - return "allowedConsumerProjects: string[] expected"; - } - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - if (!$util.isString(message.pscDnsName)) - return "pscDnsName: string expected"; - if (message.pscInterfaceConfigs != null && message.hasOwnProperty("pscInterfaceConfigs")) { - if (!Array.isArray(message.pscInterfaceConfigs)) - return "pscInterfaceConfigs: array expected"; - for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.verify(message.pscInterfaceConfigs[i]); - if (error) - return "pscInterfaceConfigs." + error; - } - } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { - if (!Array.isArray(message.pscAutoConnections)) - return "pscAutoConnections: array expected"; - for (var i = 0; i < message.pscAutoConnections.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.verify(message.pscAutoConnections[i]); - if (error) - return "pscAutoConnections." + error; - } - } - return null; - }; - - /** - * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig - */ - PscInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.PscInstanceConfig(); - if (object.serviceAttachmentLink != null) - message.serviceAttachmentLink = String(object.serviceAttachmentLink); - if (object.allowedConsumerProjects) { - if (!Array.isArray(object.allowedConsumerProjects)) - throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.allowedConsumerProjects: array expected"); - message.allowedConsumerProjects = []; - for (var i = 0; i < object.allowedConsumerProjects.length; ++i) - message.allowedConsumerProjects[i] = String(object.allowedConsumerProjects[i]); - } - if (object.pscDnsName != null) - message.pscDnsName = String(object.pscDnsName); - if (object.pscInterfaceConfigs) { - if (!Array.isArray(object.pscInterfaceConfigs)) - throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscInterfaceConfigs: array expected"); - message.pscInterfaceConfigs = []; - for (var i = 0; i < object.pscInterfaceConfigs.length; ++i) { - if (typeof object.pscInterfaceConfigs[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscInterfaceConfigs: object expected"); - message.pscInterfaceConfigs[i] = $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.fromObject(object.pscInterfaceConfigs[i]); - } - } - if (object.pscAutoConnections) { - if (!Array.isArray(object.pscAutoConnections)) - throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscAutoConnections: array expected"); - message.pscAutoConnections = []; - for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.PscInstanceConfig.pscAutoConnections: object expected"); - message.pscAutoConnections[i] = $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.PscInstanceConfig} message PscInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedConsumerProjects = []; - object.pscInterfaceConfigs = []; - object.pscAutoConnections = []; - } - if (options.defaults) { - object.serviceAttachmentLink = ""; - object.pscDnsName = ""; - } - if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) - object.serviceAttachmentLink = message.serviceAttachmentLink; - if (message.allowedConsumerProjects && message.allowedConsumerProjects.length) { - object.allowedConsumerProjects = []; - for (var j = 0; j < message.allowedConsumerProjects.length; ++j) - object.allowedConsumerProjects[j] = message.allowedConsumerProjects[j]; - } - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - object.pscDnsName = message.pscDnsName; - if (message.pscInterfaceConfigs && message.pscInterfaceConfigs.length) { - object.pscInterfaceConfigs = []; - for (var j = 0; j < message.pscInterfaceConfigs.length; ++j) - object.pscInterfaceConfigs[j] = $root.google.cloud.alloydb.v1.Instance.PscInterfaceConfig.toObject(message.pscInterfaceConfigs[j], options); - } - if (message.pscAutoConnections && message.pscAutoConnections.length) { - object.pscAutoConnections = []; - for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.alloydb.v1.Instance.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); - } - return object; - }; - - /** - * Converts this PscInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - PscInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscInstanceConfig"; - }; - - return PscInstanceConfig; - })(); - - Instance.InstanceNetworkConfig = (function() { - - /** - * Properties of an InstanceNetworkConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IInstanceNetworkConfig - * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks - * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp - * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp - * @property {string|null} [network] InstanceNetworkConfig network - * @property {string|null} [allocatedIpRangeOverride] InstanceNetworkConfig allocatedIpRangeOverride - */ - - /** - * Constructs a new InstanceNetworkConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents an InstanceNetworkConfig. - * @implements IInstanceNetworkConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig=} [properties] Properties to set - */ - function InstanceNetworkConfig(properties) { - this.authorizedExternalNetworks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceNetworkConfig authorizedExternalNetworks. - * @member {Array.} authorizedExternalNetworks - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; - - /** - * InstanceNetworkConfig enablePublicIp. - * @member {boolean} enablePublicIp - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.enablePublicIp = false; - - /** - * InstanceNetworkConfig enableOutboundPublicIp. - * @member {boolean} enableOutboundPublicIp - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; - - /** - * InstanceNetworkConfig network. - * @member {string} network - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.network = ""; - - /** - * InstanceNetworkConfig allocatedIpRangeOverride. - * @member {string} allocatedIpRangeOverride - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.allocatedIpRangeOverride = ""; - - /** - * Creates a new InstanceNetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance - */ - InstanceNetworkConfig.create = function create(properties) { - return new InstanceNetworkConfig(properties); - }; - - /** - * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceNetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.authorizedExternalNetworks != null && message.authorizedExternalNetworks.length) - for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) - $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); - if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); - if (message.allocatedIpRangeOverride != null && Object.hasOwnProperty.call(message, "allocatedIpRangeOverride")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRangeOverride); - return writer; - }; - - /** - * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceNetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.authorizedExternalNetworks && message.authorizedExternalNetworks.length)) - message.authorizedExternalNetworks = []; - message.authorizedExternalNetworks.push($root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.decode(reader, reader.uint32())); - break; - } - case 2: { - message.enablePublicIp = reader.bool(); - break; - } - case 3: { - message.enableOutboundPublicIp = reader.bool(); - break; - } - case 4: { - message.network = reader.string(); - break; - } - case 5: { - message.allocatedIpRangeOverride = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceNetworkConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceNetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.authorizedExternalNetworks != null && message.hasOwnProperty("authorizedExternalNetworks")) { - if (!Array.isArray(message.authorizedExternalNetworks)) - return "authorizedExternalNetworks: array expected"; - for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify(message.authorizedExternalNetworks[i]); - if (error) - return "authorizedExternalNetworks." + error; - } - } - if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) - if (typeof message.enablePublicIp !== "boolean") - return "enablePublicIp: boolean expected"; - if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) - if (typeof message.enableOutboundPublicIp !== "boolean") - return "enableOutboundPublicIp: boolean expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) - if (!$util.isString(message.allocatedIpRangeOverride)) - return "allocatedIpRangeOverride: string expected"; - return null; - }; - - /** - * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig - */ - InstanceNetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig(); - if (object.authorizedExternalNetworks) { - if (!Array.isArray(object.authorizedExternalNetworks)) - throw TypeError(".google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.authorizedExternalNetworks: array expected"); - message.authorizedExternalNetworks = []; - for (var i = 0; i < object.authorizedExternalNetworks.length; ++i) { - if (typeof object.authorizedExternalNetworks[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.authorizedExternalNetworks: object expected"); - message.authorizedExternalNetworks[i] = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.fromObject(object.authorizedExternalNetworks[i]); - } - } - if (object.enablePublicIp != null) - message.enablePublicIp = Boolean(object.enablePublicIp); - if (object.enableOutboundPublicIp != null) - message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); - if (object.network != null) - message.network = String(object.network); - if (object.allocatedIpRangeOverride != null) - message.allocatedIpRangeOverride = String(object.allocatedIpRangeOverride); - return message; - }; - - /** - * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} message InstanceNetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceNetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.authorizedExternalNetworks = []; - if (options.defaults) { - object.enablePublicIp = false; - object.enableOutboundPublicIp = false; - object.network = ""; - object.allocatedIpRangeOverride = ""; - } - if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { - object.authorizedExternalNetworks = []; - for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) - object.authorizedExternalNetworks[j] = $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.toObject(message.authorizedExternalNetworks[j], options); - } - if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) - object.enablePublicIp = message.enablePublicIp; - if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) - object.enableOutboundPublicIp = message.enableOutboundPublicIp; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) - object.allocatedIpRangeOverride = message.allocatedIpRangeOverride; - return object; - }; - - /** - * Converts this InstanceNetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceNetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceNetworkConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceNetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.InstanceNetworkConfig"; - }; - - InstanceNetworkConfig.AuthorizedNetwork = (function() { - - /** - * Properties of an AuthorizedNetwork. - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @interface IAuthorizedNetwork - * @property {string|null} [cidrRange] AuthorizedNetwork cidrRange - */ - - /** - * Constructs a new AuthorizedNetwork. - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig - * @classdesc Represents an AuthorizedNetwork. - * @implements IAuthorizedNetwork - * @constructor - * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set - */ - function AuthorizedNetwork(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuthorizedNetwork cidrRange. - * @member {string} cidrRange - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @instance - */ - AuthorizedNetwork.prototype.cidrRange = ""; - - /** - * Creates a new AuthorizedNetwork instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork instance - */ - AuthorizedNetwork.create = function create(properties) { - return new AuthorizedNetwork(properties); - }; - - /** - * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthorizedNetwork.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cidrRange != null && Object.hasOwnProperty.call(message, "cidrRange")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cidrRange); - return writer; - }; - - /** - * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthorizedNetwork.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthorizedNetwork.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cidrRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthorizedNetwork.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuthorizedNetwork message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuthorizedNetwork.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) - if (!$util.isString(message.cidrRange)) - return "cidrRange: string expected"; - return null; - }; - - /** - * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - */ - AuthorizedNetwork.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork(); - if (object.cidrRange != null) - message.cidrRange = String(object.cidrRange); - return message; - }; - - /** - * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork} message AuthorizedNetwork - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuthorizedNetwork.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cidrRange = ""; - if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) - object.cidrRange = message.cidrRange; - return object; - }; - - /** - * Converts this AuthorizedNetwork to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @instance - * @returns {Object.} JSON object - */ - AuthorizedNetwork.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuthorizedNetwork - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuthorizedNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.InstanceNetworkConfig.AuthorizedNetwork"; - }; - - return AuthorizedNetwork; - })(); - - return InstanceNetworkConfig; - })(); - - Instance.ConnectionPoolConfig = (function() { - - /** - * Properties of a ConnectionPoolConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @interface IConnectionPoolConfig - * @property {boolean|null} [enabled] ConnectionPoolConfig enabled - * @property {Object.|null} [flags] ConnectionPoolConfig flags - * @property {number|null} [poolerCount] ConnectionPoolConfig poolerCount - */ - - /** - * Constructs a new ConnectionPoolConfig. - * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a ConnectionPoolConfig. - * @implements IConnectionPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig=} [properties] Properties to set - */ - function ConnectionPoolConfig(properties) { - this.flags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionPoolConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.enabled = false; - - /** - * ConnectionPoolConfig flags. - * @member {Object.} flags - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.flags = $util.emptyObject; - - /** - * ConnectionPoolConfig poolerCount. - * @member {number} poolerCount - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.poolerCount = 0; - - /** - * Creates a new ConnectionPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig instance - */ - ConnectionPoolConfig.create = function create(properties) { - return new ConnectionPoolConfig(properties); - }; - - /** - * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enabled); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) - for (var keys = Object.keys(message.flags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.flags[keys[i]]).ldelim(); - if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.poolerCount); - return writer; - }; - - /** - * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 12: { - message.enabled = reader.bool(); - break; - } - case 13: { - if (message.flags === $util.emptyObject) - message.flags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.flags[key] = value; - break; - } - case 14: { - message.poolerCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isObject(message.flags)) - return "flags: object expected"; - var key = Object.keys(message.flags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.flags[key[i]])) - return "flags: string{k:string} expected"; - } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) - if (!$util.isInteger(message.poolerCount)) - return "poolerCount: integer expected"; - return null; - }; - - /** - * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} ConnectionPoolConfig - */ - ConnectionPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1.Instance.ConnectionPoolConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.flags) { - if (typeof object.flags !== "object") - throw TypeError(".google.cloud.alloydb.v1.Instance.ConnectionPoolConfig.flags: object expected"); - message.flags = {}; - for (var keys = Object.keys(object.flags), i = 0; i < keys.length; ++i) - message.flags[keys[i]] = String(object.flags[keys[i]]); - } - if (object.poolerCount != null) - message.poolerCount = object.poolerCount | 0; - return message; - }; - - /** - * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1.Instance.ConnectionPoolConfig} message ConnectionPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.flags = {}; - if (options.defaults) { - object.enabled = false; - object.poolerCount = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - var keys2; - if (message.flags && (keys2 = Object.keys(message.flags)).length) { - object.flags = {}; - for (var j = 0; j < keys2.length; ++j) - object.flags[keys2[j]] = message.flags[keys2[j]]; - } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) - object.poolerCount = message.poolerCount; - return object; - }; - - /** - * Converts this ConnectionPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ConnectionPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectionPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.ConnectionPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectionPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ConnectionPoolConfig"; - }; - - return ConnectionPoolConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * InstanceType enum. - * @name google.cloud.alloydb.v1.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} READ_POOL=2 READ_POOL value - * @property {number} SECONDARY=3 SECONDARY value - */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "READ_POOL"] = 2; - values[valuesById[3] = "SECONDARY"] = 3; - return values; - })(); - - /** - * AvailabilityType enum. - * @name google.cloud.alloydb.v1.Instance.AvailabilityType - * @enum {number} - * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value - */ - Instance.AvailabilityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; - return values; - })(); - - /** - * ActivationPolicy enum. - * @name google.cloud.alloydb.v1.Instance.ActivationPolicy - * @enum {number} - * @property {number} ACTIVATION_POLICY_UNSPECIFIED=0 ACTIVATION_POLICY_UNSPECIFIED value - * @property {number} ALWAYS=1 ALWAYS value - * @property {number} NEVER=2 NEVER value - */ - Instance.ActivationPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVATION_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALWAYS"] = 1; - values[valuesById[2] = "NEVER"] = 2; - return values; - })(); - - return Instance; - })(); - - v1.ConnectionInfo = (function() { - - /** - * Properties of a ConnectionInfo. - * @memberof google.cloud.alloydb.v1 - * @interface IConnectionInfo - * @property {string|null} [name] ConnectionInfo name - * @property {string|null} [ipAddress] ConnectionInfo ipAddress - * @property {string|null} [publicIpAddress] ConnectionInfo publicIpAddress - * @property {string|null} [instanceUid] ConnectionInfo instanceUid - */ - - /** - * Constructs a new ConnectionInfo. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ConnectionInfo. - * @implements IConnectionInfo - * @constructor - * @param {google.cloud.alloydb.v1.IConnectionInfo=} [properties] Properties to set - */ - function ConnectionInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionInfo name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.name = ""; - - /** - * ConnectionInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.ipAddress = ""; - - /** - * ConnectionInfo publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.publicIpAddress = ""; - - /** - * ConnectionInfo instanceUid. - * @member {string} instanceUid - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.instanceUid = ""; - - /** - * Creates a new ConnectionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1.IConnectionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo instance - */ - ConnectionInfo.create = function create(properties) { - return new ConnectionInfo(properties); - }; - - /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicIpAddress); - return writer; - }; - - /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ConnectionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ConnectionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.ipAddress = reader.string(); - break; - } - case 5: { - message.publicIpAddress = reader.string(); - break; - } - case 4: { - message.instanceUid = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - if (!$util.isString(message.instanceUid)) - return "instanceUid: string expected"; - return null; - }; - - /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo - */ - ConnectionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ConnectionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1.ConnectionInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.instanceUid != null) - message.instanceUid = String(object.instanceUid); - return message; - }; - - /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1.ConnectionInfo} message ConnectionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.ipAddress = ""; - object.instanceUid = ""; - object.publicIpAddress = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - object.instanceUid = message.instanceUid; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - return object; - }; - - /** - * Converts this ConnectionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @instance - * @returns {Object.} JSON object - */ - ConnectionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ConnectionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ConnectionInfo"; - }; - - return ConnectionInfo; - })(); - - v1.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.cloud.alloydb.v1 - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [displayName] Backup displayName - * @property {string|null} [uid] Backup uid - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime - * @property {google.protobuf.ITimestamp|null} [createCompletionTime] Backup createCompletionTime - * @property {Object.|null} [labels] Backup labels - * @property {google.cloud.alloydb.v1.Backup.State|null} [state] Backup state - * @property {google.cloud.alloydb.v1.Backup.Type|null} [type] Backup type - * @property {string|null} [description] Backup description - * @property {string|null} [clusterUid] Backup clusterUid - * @property {string|null} [clusterName] Backup clusterName - * @property {boolean|null} [reconciling] Backup reconciling - * @property {google.cloud.alloydb.v1.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig - * @property {google.cloud.alloydb.v1.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {string|null} [etag] Backup etag - * @property {Object.|null} [annotations] Backup annotations - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime - * @property {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity - * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Backup databaseVersion - * @property {Object.|null} [tags] Backup tags - */ - - /** - * Constructs a new Backup. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set - */ - function Backup(properties) { - this.labels = {}; - this.annotations = {}; - this.tags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.displayName = ""; - - /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.uid = ""; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.updateTime = null; - - /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.deleteTime = null; - - /** - * Backup createCompletionTime. - * @member {google.protobuf.ITimestamp|null|undefined} createCompletionTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.createCompletionTime = null; - - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; - - /** - * Backup state. - * @member {google.cloud.alloydb.v1.Backup.State} state - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup type. - * @member {google.cloud.alloydb.v1.Backup.Type} type - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.type = 0; - - /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.description = ""; - - /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.clusterUid = ""; - - /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.clusterName = ""; - - /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.reconciling = false; - - /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.encryptionConfig = null; - - /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; - - /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.etag = ""; - - /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.annotations = $util.emptyObject; - - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.expiryTime = null; - - /** - * Backup expiryQuantity. - * @member {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.expiryQuantity = null; - - /** - * Backup satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.satisfiesPzs = false; - - /** - * Backup databaseVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.databaseVersion = 0; - - /** - * Backup tags. - * @member {Object.} tags - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.tags = $util.emptyObject; - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); - if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) - $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); - if (message.createCompletionTime != null && Object.hasOwnProperty.call(message, "createCompletionTime")) - $root.google.protobuf.Timestamp.encode(message.createCompletionTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Backup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 26: { - message.createCompletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.description = reader.string(); - break; - } - case 18: { - message.clusterUid = reader.string(); - break; - } - case 10: { - message.clusterName = reader.string(); - break; - } - case 11: { - message.reconciling = reader.bool(); - break; - } - case 12: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 16: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 17: { - message.sizeBytes = reader.int64(); - break; - } - case 19: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 20: { - message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); - break; - } - case 21: { - message.satisfiesPzs = reader.bool(); - break; - } - case 22: { - message.databaseVersion = reader.int32(); - break; - } - case 25: { - if (message.tags === $util.emptyObject) - message.tags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.tags[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Backup message. - * @function verify - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Backup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createCompletionTime); - if (error) - return "createCompletionTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - if (!$util.isString(message.clusterUid)) - return "clusterUid: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } - if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { - var error = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); - if (error) - return "expiryQuantity." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!$util.isObject(message.tags)) - return "tags: object expected"; - var key = Object.keys(message.tags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.tags[key[i]])) - return "tags: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Backup} Backup - */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Backup) - return object; - var message = new $root.google.cloud.alloydb.v1.Backup(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.createCompletionTime != null) { - if (typeof object.createCompletionTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.createCompletionTime: object expected"); - message.createCompletionTime = $root.google.protobuf.Timestamp.fromObject(object.createCompletionTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ON_DEMAND": - case 1: - message.type = 1; - break; - case "AUTOMATED": - case 2: - message.type = 2; - break; - case "CONTINUOUS": - case 3: - message.type = 3; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.clusterUid != null) - message.clusterUid = String(object.clusterUid); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } - if (object.expiryQuantity != null) { - if (typeof object.expiryQuantity !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.expiryQuantity: object expected"); - message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - } - if (object.tags) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.alloydb.v1.Backup.tags: object expected"); - message.tags = {}; - for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) - message.tags[keys[i]] = String(object.tags[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {google.cloud.alloydb.v1.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - object.tags = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.clusterName = ""; - object.reconciling = false; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.etag = ""; - object.deleteTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.clusterUid = ""; - object.expiryTime = null; - object.expiryQuantity = null; - object.satisfiesPzs = false; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.createCompletionTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.Backup.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Backup.Type[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - object.clusterUid = message.clusterUid; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); - if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) - object.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.tags && (keys2 = Object.keys(message.tags)).length) { - object.tags = {}; - for (var j = 0; j < keys2.length; ++j) - object.tags[keys2[j]] = message.tags[keys2[j]]; - } - if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) - object.createCompletionTime = $root.google.protobuf.Timestamp.toObject(message.createCompletionTime, options); - return object; - }; - - /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Backup - * @instance - * @returns {Object.} JSON object - */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; - }; - - Backup.QuantityBasedExpiry = (function() { - - /** - * Properties of a QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1.Backup - * @interface IQuantityBasedExpiry - * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount - * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount - */ - - /** - * Constructs a new QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1.Backup - * @classdesc Represents a QuantityBasedExpiry. - * @implements IQuantityBasedExpiry - * @constructor - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set - */ - function QuantityBasedExpiry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedExpiry retentionCount. - * @member {number} retentionCount - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @instance - */ - QuantityBasedExpiry.prototype.retentionCount = 0; - - /** - * QuantityBasedExpiry totalRetentionCount. - * @member {number} totalRetentionCount - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @instance - */ - QuantityBasedExpiry.prototype.totalRetentionCount = 0; - - /** - * Creates a new QuantityBasedExpiry instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance - */ - QuantityBasedExpiry.create = function create(properties) { - return new QuantityBasedExpiry(properties); - }; - - /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedExpiry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); - if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); - return writer; - }; - - /** - * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedExpiry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionCount = reader.int32(); - break; - } - case 2: { - message.totalRetentionCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedExpiry message. - * @function verify - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedExpiry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - if (!$util.isInteger(message.retentionCount)) - return "retentionCount: integer expected"; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - if (!$util.isInteger(message.totalRetentionCount)) - return "totalRetentionCount: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry - */ - QuantityBasedExpiry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry) - return object; - var message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); - if (object.retentionCount != null) - message.retentionCount = object.retentionCount | 0; - if (object.totalRetentionCount != null) - message.totalRetentionCount = object.totalRetentionCount | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} message QuantityBasedExpiry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedExpiry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.retentionCount = 0; - object.totalRetentionCount = 0; - } - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - object.retentionCount = message.retentionCount; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - object.totalRetentionCount = message.totalRetentionCount; - return object; - }; - - /** - * Converts this QuantityBasedExpiry to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedExpiry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedExpiry - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup.QuantityBasedExpiry"; - }; - - return QuantityBasedExpiry; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} FAILED=3 FAILED value - * @property {number} DELETING=4 DELETING value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "DELETING"] = 4; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.alloydb.v1.Backup.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ON_DEMAND=1 ON_DEMAND value - * @property {number} AUTOMATED=2 AUTOMATED value - * @property {number} CONTINUOUS=3 CONTINUOUS value - */ - Backup.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ON_DEMAND"] = 1; - values[valuesById[2] = "AUTOMATED"] = 2; - values[valuesById[3] = "CONTINUOUS"] = 3; - return values; - })(); - - return Backup; - })(); - - v1.SupportedDatabaseFlag = (function() { - - /** - * Properties of a SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1 - * @interface ISupportedDatabaseFlag - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions - * @property {string|null} [recommendedStringValue] SupportedDatabaseFlag recommendedStringValue - * @property {google.protobuf.IInt64Value|null} [recommendedIntegerValue] SupportedDatabaseFlag recommendedIntegerValue - * @property {string|null} [name] SupportedDatabaseFlag name - * @property {string|null} [flagName] SupportedDatabaseFlag flagName - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType - * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues - * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions - * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null} [scope] SupportedDatabaseFlag scope - */ - - /** - * Constructs a new SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag - * @constructor - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set - */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; - - /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; - - /** - * SupportedDatabaseFlag recommendedStringValue. - * @member {string|null|undefined} recommendedStringValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.recommendedStringValue = null; - - /** - * SupportedDatabaseFlag recommendedIntegerValue. - * @member {google.protobuf.IInt64Value|null|undefined} recommendedIntegerValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.recommendedIntegerValue = null; - - /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.name = ""; - - /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.flagName = ""; - - /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.valueType = 0; - - /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; - - /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; - - /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; - - /** - * SupportedDatabaseFlag scope. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} scope - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.scope = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SupportedDatabaseFlag recommendedValue. - * @member {"recommendedStringValue"|"recommendedIntegerValue"|undefined} recommendedValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "recommendedValue", { - get: $util.oneOfGetter($oneOfFields = ["recommendedStringValue", "recommendedIntegerValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag instance - */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); - }; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); - if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); - if (message.supportedDbVersions != null && message.supportedDbVersions.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedDbVersions.length; ++i) - writer.int32(message.supportedDbVersions[i]); - writer.ldelim(); - } - if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); - if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) - $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) - $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); - if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.recommendedStringValue); - if (message.recommendedIntegerValue != null && Object.hasOwnProperty.call(message, "recommendedIntegerValue")) - $root.google.protobuf.Int64Value.encode(message.recommendedIntegerValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 7: { - message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); - break; - } - case 10: { - message.recommendedStringValue = reader.string(); - break; - } - case 11: { - message.recommendedIntegerValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.flagName = reader.string(); - break; - } - case 3: { - message.valueType = reader.int32(); - break; - } - case 4: { - message.acceptsMultipleValues = reader.bool(); - break; - } - case 5: { - if (!(message.supportedDbVersions && message.supportedDbVersions.length)) - message.supportedDbVersions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.supportedDbVersions.push(reader.int32()); - } else - message.supportedDbVersions.push(reader.int32()); - break; - } - case 6: { - message.requiresDbRestart = reader.bool(); - break; - } - case 9: { - message.scope = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SupportedDatabaseFlag message. - * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SupportedDatabaseFlag.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); - if (error) - return "stringRestrictions." + error; - } - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - if (properties.restrictions === 1) - return "restrictions: multiple values"; - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); - if (error) - return "integerRestrictions." + error; - } - } - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { - properties.recommendedValue = 1; - if (!$util.isString(message.recommendedStringValue)) - return "recommendedStringValue: string expected"; - } - if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { - if (properties.recommendedValue === 1) - return "recommendedValue: multiple values"; - properties.recommendedValue = 1; - { - var error = $root.google.protobuf.Int64Value.verify(message.recommendedIntegerValue); - if (error) - return "recommendedIntegerValue." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.flagName != null && message.hasOwnProperty("flagName")) - if (!$util.isString(message.flagName)) - return "flagName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - if (typeof message.acceptsMultipleValues !== "boolean") - return "acceptsMultipleValues: boolean expected"; - if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { - if (!Array.isArray(message.supportedDbVersions)) - return "supportedDbVersions: array expected"; - for (var i = 0; i < message.supportedDbVersions.length; ++i) - switch (message.supportedDbVersions[i]) { - default: - return "supportedDbVersions: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag - */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag) - return object; - var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag(); - if (object.stringRestrictions != null) { - if (typeof object.stringRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.stringRestrictions: object expected"); - message.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); - } - if (object.integerRestrictions != null) { - if (typeof object.integerRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.integerRestrictions: object expected"); - message.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); - } - if (object.recommendedStringValue != null) - message.recommendedStringValue = String(object.recommendedStringValue); - if (object.recommendedIntegerValue != null) { - if (typeof object.recommendedIntegerValue !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.recommendedIntegerValue: object expected"); - message.recommendedIntegerValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntegerValue); - } - if (object.name != null) - message.name = String(object.name); - if (object.flagName != null) - message.flagName = String(object.flagName); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "STRING": - case 1: - message.valueType = 1; - break; - case "INTEGER": - case 2: - message.valueType = 2; - break; - case "FLOAT": - case 3: - message.valueType = 3; - break; - case "NONE": - case 4: - message.valueType = 4; - break; - } - if (object.acceptsMultipleValues != null) - message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); - if (object.supportedDbVersions) { - if (!Array.isArray(object.supportedDbVersions)) - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.supportedDbVersions: array expected"); - message.supportedDbVersions = []; - for (var i = 0; i < object.supportedDbVersions.length; ++i) - switch (object.supportedDbVersions[i]) { - default: - if (typeof object.supportedDbVersions[i] === "number") { - message.supportedDbVersions[i] = object.supportedDbVersions[i]; - break; - } - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.supportedDbVersions[i] = 0; - break; - case "POSTGRES_13": - case 1: - message.supportedDbVersions[i] = 1; - break; - case "POSTGRES_14": - case 2: - message.supportedDbVersions[i] = 2; - break; - case "POSTGRES_15": - case 3: - message.supportedDbVersions[i] = 3; - break; - case "POSTGRES_16": - case 4: - message.supportedDbVersions[i] = 4; - break; - case "POSTGRES_17": - case 5: - message.supportedDbVersions[i] = 5; - break; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "DATABASE": - case 1: - message.scope = 1; - break; - case "CONNECTION_POOL": - case 2: - message.scope = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag} message SupportedDatabaseFlag - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDbVersions = []; - if (options.defaults) { - object.name = ""; - object.flagName = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.acceptsMultipleValues = false; - object.requiresDbRestart = false; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.flagName != null && message.hasOwnProperty("flagName")) - object.flagName = message.flagName; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - object.acceptsMultipleValues = message.acceptsMultipleValues; - if (message.supportedDbVersions && message.supportedDbVersions.length) { - object.supportedDbVersions = []; - for (var j = 0; j < message.supportedDbVersions.length; ++j) - object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - object.requiresDbRestart = message.requiresDbRestart; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - object.stringRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); - if (options.oneofs) - object.restrictions = "stringRestrictions"; - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - object.integerRestrictions = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); - if (options.oneofs) - object.restrictions = "integerRestrictions"; - } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] : message.scope; - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { - object.recommendedStringValue = message.recommendedStringValue; - if (options.oneofs) - object.recommendedValue = "recommendedStringValue"; - } - if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { - object.recommendedIntegerValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntegerValue, options); - if (options.oneofs) - object.recommendedValue = "recommendedIntegerValue"; - } - return object; - }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @instance - * @returns {Object.} JSON object - */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag"; - }; - - SupportedDatabaseFlag.StringRestrictions = (function() { - - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ - - /** - * Constructs a new StringRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @classdesc Represents a StringRestrictions. - * @implements IStringRestrictions - * @constructor - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - */ - function StringRestrictions(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance - */ - StringRestrictions.create = function create(properties) { - return new StringRestrictions(properties); - }; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); - return writer; - }; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) - if (!$util.isString(message.allowedValues[i])) - return "allowedValues: string[] expected"; - } - return null; - }; - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - */ - StringRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) - message.allowedValues[i] = String(object.allowedValues[i]); - } - return message; - }; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = message.allowedValues[j]; - } - return object; - }; - - /** - * Converts this StringRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @instance - * @returns {Object.} JSON object - */ - StringRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions"; - }; - - return StringRestrictions; - })(); - - SupportedDatabaseFlag.IntegerRestrictions = (function() { - - /** - * Properties of an IntegerRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @interface IIntegerRestrictions - * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue - * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue - */ - - /** - * Constructs a new IntegerRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @classdesc Represents an IntegerRestrictions. - * @implements IIntegerRestrictions - * @constructor - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - */ - function IntegerRestrictions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.minValue = null; - - /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.maxValue = null; - - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance - */ - IntegerRestrictions.create = function create(properties) { - return new IntegerRestrictions(properties); - }; - - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntegerRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minValue != null && message.hasOwnProperty("minValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.minValue); - if (error) - return "minValue." + error; - } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.maxValue); - if (error) - return "maxValue." + error; - } - return null; - }; - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - */ - IntegerRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions(); - if (object.minValue != null) { - if (typeof object.minValue !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); - message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); - } - if (object.maxValue != null) { - if (typeof object.maxValue !== "object") - throw TypeError(".google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); - message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); - } - return message; - }; - - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minValue = null; - object.maxValue = null; - } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); - return object; - }; - - /** - * Converts this IntegerRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @instance - * @returns {Object.} JSON object - */ - IntegerRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IntegerRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions"; - }; - - return IntegerRestrictions; - })(); - - /** - * ValueType enum. - * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} FLOAT=3 FLOAT value - * @property {number} NONE=4 NONE value - */ - SupportedDatabaseFlag.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "FLOAT"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); - - /** - * Scope enum. - * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope - * @enum {number} - * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value - * @property {number} DATABASE=1 DATABASE value - * @property {number} CONNECTION_POOL=2 CONNECTION_POOL value - */ - SupportedDatabaseFlag.Scope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATABASE"] = 1; - values[valuesById[2] = "CONNECTION_POOL"] = 2; - return values; - })(); - - return SupportedDatabaseFlag; - })(); - - v1.User = (function() { - - /** - * Properties of a User. - * @memberof google.cloud.alloydb.v1 - * @interface IUser - * @property {string|null} [name] User name - * @property {string|null} [password] User password - * @property {Array.|null} [databaseRoles] User databaseRoles - * @property {google.cloud.alloydb.v1.User.UserType|null} [userType] User userType - * @property {boolean|null} [keepExtraRoles] User keepExtraRoles - */ - - /** - * Constructs a new User. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a User. - * @implements IUser - * @constructor - * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set - */ - function User(properties) { - this.databaseRoles = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * User name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.User - * @instance - */ - User.prototype.name = ""; - - /** - * User password. - * @member {string} password - * @memberof google.cloud.alloydb.v1.User - * @instance - */ - User.prototype.password = ""; - - /** - * User databaseRoles. - * @member {Array.} databaseRoles - * @memberof google.cloud.alloydb.v1.User - * @instance - */ - User.prototype.databaseRoles = $util.emptyArray; - - /** - * User userType. - * @member {google.cloud.alloydb.v1.User.UserType} userType - * @memberof google.cloud.alloydb.v1.User - * @instance - */ - User.prototype.userType = 0; - - /** - * User keepExtraRoles. - * @member {boolean} keepExtraRoles - * @memberof google.cloud.alloydb.v1.User - * @instance - */ - User.prototype.keepExtraRoles = false; - - /** - * Creates a new User instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.User} User instance - */ - User.create = function create(properties) { - return new User(properties); - }; - - /** - * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {google.cloud.alloydb.v1.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); - if (message.databaseRoles != null && message.databaseRoles.length) - for (var i = 0; i < message.databaseRoles.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); - if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); - if (message.keepExtraRoles != null && Object.hasOwnProperty.call(message, "keepExtraRoles")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.keepExtraRoles); - return writer; - }; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.User.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {google.cloud.alloydb.v1.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a User message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.User(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.password = reader.string(); - break; - } - case 4: { - if (!(message.databaseRoles && message.databaseRoles.length)) - message.databaseRoles = []; - message.databaseRoles.push(reader.string()); - break; - } - case 5: { - message.userType = reader.int32(); - break; - } - case 6: { - message.keepExtraRoles = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a User message. - * @function verify - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - User.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { - if (!Array.isArray(message.databaseRoles)) - return "databaseRoles: array expected"; - for (var i = 0; i < message.databaseRoles.length; ++i) - if (!$util.isString(message.databaseRoles[i])) - return "databaseRoles: string[] expected"; - } - if (message.userType != null && message.hasOwnProperty("userType")) - switch (message.userType) { - default: - return "userType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) - if (typeof message.keepExtraRoles !== "boolean") - return "keepExtraRoles: boolean expected"; - return null; - }; - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.User} User - */ - User.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.User) - return object; - var message = new $root.google.cloud.alloydb.v1.User(); - if (object.name != null) - message.name = String(object.name); - if (object.password != null) - message.password = String(object.password); - if (object.databaseRoles) { - if (!Array.isArray(object.databaseRoles)) - throw TypeError(".google.cloud.alloydb.v1.User.databaseRoles: array expected"); - message.databaseRoles = []; - for (var i = 0; i < object.databaseRoles.length; ++i) - message.databaseRoles[i] = String(object.databaseRoles[i]); - } - switch (object.userType) { - default: - if (typeof object.userType === "number") { - message.userType = object.userType; - break; - } - break; - case "USER_TYPE_UNSPECIFIED": - case 0: - message.userType = 0; - break; - case "ALLOYDB_BUILT_IN": - case 1: - message.userType = 1; - break; - case "ALLOYDB_IAM_USER": - case 2: - message.userType = 2; - break; - } - if (object.keepExtraRoles != null) - message.keepExtraRoles = Boolean(object.keepExtraRoles); - return message; - }; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {google.cloud.alloydb.v1.User} message User - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - User.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databaseRoles = []; - if (options.defaults) { - object.name = ""; - object.password = ""; - object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; - object.keepExtraRoles = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.databaseRoles && message.databaseRoles.length) { - object.databaseRoles = []; - for (var j = 0; j < message.databaseRoles.length; ++j) - object.databaseRoles[j] = message.databaseRoles[j]; - } - if (message.userType != null && message.hasOwnProperty("userType")) - object.userType = options.enums === String ? $root.google.cloud.alloydb.v1.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1.User.UserType[message.userType] : message.userType; - if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) - object.keepExtraRoles = message.keepExtraRoles; - return object; - }; - - /** - * Converts this User to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.User - * @instance - * @returns {Object.} JSON object - */ - User.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for User - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.User - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.User"; - }; - - /** - * UserType enum. - * @name google.cloud.alloydb.v1.User.UserType - * @enum {number} - * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value - * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value - * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value - */ - User.UserType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; - values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; - return values; - })(); - - return User; - })(); - - v1.Database = (function() { - - /** - * Properties of a Database. - * @memberof google.cloud.alloydb.v1 - * @interface IDatabase - * @property {string|null} [name] Database name - * @property {string|null} [charset] Database charset - * @property {string|null} [collation] Database collation - * @property {string|null} [characterType] Database characterType - * @property {string|null} [databaseTemplate] Database databaseTemplate - * @property {boolean|null} [isTemplateDatabase] Database isTemplateDatabase - */ - - /** - * Constructs a new Database. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a Database. - * @implements IDatabase - * @constructor - * @param {google.cloud.alloydb.v1.IDatabase=} [properties] Properties to set - */ - function Database(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Database name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Database - * @instance - */ - Database.prototype.name = ""; - - /** - * Database charset. - * @member {string} charset - * @memberof google.cloud.alloydb.v1.Database - * @instance - */ - Database.prototype.charset = ""; - - /** - * Database collation. - * @member {string} collation - * @memberof google.cloud.alloydb.v1.Database - * @instance - */ - Database.prototype.collation = ""; - - /** - * Database characterType. - * @member {string} characterType - * @memberof google.cloud.alloydb.v1.Database - * @instance - */ - Database.prototype.characterType = ""; - - /** - * Database databaseTemplate. - * @member {string} databaseTemplate - * @memberof google.cloud.alloydb.v1.Database - * @instance - */ - Database.prototype.databaseTemplate = ""; - - /** - * Database isTemplateDatabase. - * @member {boolean|null|undefined} isTemplateDatabase - * @memberof google.cloud.alloydb.v1.Database - * @instance - */ - Database.prototype.isTemplateDatabase = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Database.prototype, "_isTemplateDatabase", { - get: $util.oneOfGetter($oneOfFields = ["isTemplateDatabase"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Database instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {google.cloud.alloydb.v1.IDatabase=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Database} Database instance - */ - Database.create = function create(properties) { - return new Database(properties); - }; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {google.cloud.alloydb.v1.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.charset); - if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.collation); - if (message.characterType != null && Object.hasOwnProperty.call(message, "characterType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.characterType); - if (message.databaseTemplate != null && Object.hasOwnProperty.call(message, "databaseTemplate")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseTemplate); - if (message.isTemplateDatabase != null && Object.hasOwnProperty.call(message, "isTemplateDatabase")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isTemplateDatabase); - return writer; - }; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {google.cloud.alloydb.v1.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Database message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Database(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.charset = reader.string(); - break; - } - case 3: { - message.collation = reader.string(); - break; - } - case 4: { - message.characterType = reader.string(); - break; - } - case 6: { - message.databaseTemplate = reader.string(); - break; - } - case 7: { - message.isTemplateDatabase = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Database message. - * @function verify - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Database.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.charset != null && message.hasOwnProperty("charset")) - if (!$util.isString(message.charset)) - return "charset: string expected"; - if (message.collation != null && message.hasOwnProperty("collation")) - if (!$util.isString(message.collation)) - return "collation: string expected"; - if (message.characterType != null && message.hasOwnProperty("characterType")) - if (!$util.isString(message.characterType)) - return "characterType: string expected"; - if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) - if (!$util.isString(message.databaseTemplate)) - return "databaseTemplate: string expected"; - if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { - properties._isTemplateDatabase = 1; - if (typeof message.isTemplateDatabase !== "boolean") - return "isTemplateDatabase: boolean expected"; - } - return null; - }; - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Database} Database - */ - Database.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Database) - return object; - var message = new $root.google.cloud.alloydb.v1.Database(); - if (object.name != null) - message.name = String(object.name); - if (object.charset != null) - message.charset = String(object.charset); - if (object.collation != null) - message.collation = String(object.collation); - if (object.characterType != null) - message.characterType = String(object.characterType); - if (object.databaseTemplate != null) - message.databaseTemplate = String(object.databaseTemplate); - if (object.isTemplateDatabase != null) - message.isTemplateDatabase = Boolean(object.isTemplateDatabase); - return message; - }; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {google.cloud.alloydb.v1.Database} message Database - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Database.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.charset = ""; - object.collation = ""; - object.characterType = ""; - object.databaseTemplate = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.charset != null && message.hasOwnProperty("charset")) - object.charset = message.charset; - if (message.collation != null && message.hasOwnProperty("collation")) - object.collation = message.collation; - if (message.characterType != null && message.hasOwnProperty("characterType")) - object.characterType = message.characterType; - if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) - object.databaseTemplate = message.databaseTemplate; - if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { - object.isTemplateDatabase = message.isTemplateDatabase; - if (options.oneofs) - object._isTemplateDatabase = "isTemplateDatabase"; - } - return object; - }; - - /** - * Converts this Database to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.Database - * @instance - * @returns {Object.} JSON object - */ - Database.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Database - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Database - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Database"; - }; - - return Database; - })(); - - v1.AlloyDBAdmin = (function() { - - /** - * Constructs a new AlloyDBAdmin service. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an AlloyDBAdmin - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; - - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListClustersResponse} [response] ListClustersResponse - */ - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1.ListClustersRequest, $root.google.cloud.alloydb.v1.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Cluster} [response] Cluster - */ - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1.GetClusterRequest, $root.google.cloud.alloydb.v1.Cluster, request, callback); - }, "name", { value: "GetCluster" }); - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|exportCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ExportClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportCluster. - * @function exportCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IExportClusterRequest} request ExportClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ExportClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.exportCluster = function exportCluster(request, callback) { - return this.rpcCall(exportCluster, $root.google.cloud.alloydb.v1.ExportClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportCluster" }); - - /** - * Calls ExportCluster. - * @function exportCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IExportClusterRequest} request ExportClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|importCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ImportClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportCluster. - * @function importCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IImportClusterRequest} request ImportClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ImportClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.importCluster = function importCluster(request, callback) { - return this.rpcCall(importCluster, $root.google.cloud.alloydb.v1.ImportClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportCluster" }); - - /** - * Calls ImportCluster. - * @function importCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IImportClusterRequest} request ImportClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|upgradeCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpgradeClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpgradeCluster. - * @function upgradeCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.upgradeCluster = function upgradeCluster(request, callback) { - return this.rpcCall(upgradeCluster, $root.google.cloud.alloydb.v1.UpgradeClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpgradeCluster" }); - - /** - * Calls UpgradeCluster. - * @function upgradeCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|promoteCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef PromoteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { - return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PromoteCluster" }); - - /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|switchoverCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef SwitchoverClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SwitchoverCluster. - * @function switchoverCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.switchoverCluster = function switchoverCluster(request, callback) { - return this.rpcCall(switchoverCluster, $root.google.cloud.alloydb.v1.SwitchoverClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SwitchoverCluster" }); - - /** - * Calls SwitchoverCluster. - * @function switchoverCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restoreCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef RestoreClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryCluster}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateSecondaryClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { - return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryCluster" }); - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listInstances}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1.ListInstancesRequest, $root.google.cloud.alloydb.v1.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1.GetInstanceRequest, $root.google.cloud.alloydb.v1.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createSecondaryInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateSecondaryInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { - return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryInstance" }); - - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|batchCreateInstances}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef BatchCreateInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { - return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateInstances" }); - - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|failoverInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef FailoverInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { - return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "FailoverInstance" }); - - /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|injectFault}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef InjectFaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls InjectFault. - * @function injectFault - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IInjectFaultRequest} request InjectFaultRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { - return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "InjectFault" }); - - /** - * Calls InjectFault. - * @function injectFault - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IInjectFaultRequest} request InjectFaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|restartInstance}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef RestartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { - return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartInstance" }); - - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|executeSql}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ExecuteSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ExecuteSqlResponse} [response] ExecuteSqlResponse - */ - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ExecuteSqlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.cloud.alloydb.v1.ExecuteSqlRequest, $root.google.cloud.alloydb.v1.ExecuteSqlResponse, request, callback); - }, "name", { value: "ExecuteSql" }); - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listBackups}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListBackupsResponse} [response] ListBackupsResponse - */ - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1.ListBackupsRequest, $root.google.cloud.alloydb.v1.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Backup} [response] Backup - */ - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1.GetBackupRequest, $root.google.cloud.alloydb.v1.Backup, request, callback); - }, "name", { value: "GetBackup" }); - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListSupportedDatabaseFlagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse - */ - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { - return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse, request, callback); - }, "name", { value: "ListSupportedDatabaseFlags" }); - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|generateClientCertificate}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GenerateClientCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse - */ - - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { - return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse, request, callback); - }, "name", { value: "GenerateClientCertificate" }); - - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getConnectionInfo}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetConnectionInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ConnectionInfo} [response] ConnectionInfo - */ - - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { - return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1.ConnectionInfo, request, callback); - }, "name", { value: "GetConnectionInfo" }); - - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListUsersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListUsersResponse} [response] ListUsersResponse - */ - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { - return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1.ListUsersRequest, $root.google.cloud.alloydb.v1.ListUsersResponse, request, callback); - }, "name", { value: "ListUsers" }); - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.User} [response] User - */ - - /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetUserRequest} request GetUserRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { - return this.rpcCall(getUser, $root.google.cloud.alloydb.v1.GetUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); - }, "name", { value: "GetUser" }); - - /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IGetUserRequest} request GetUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.User} [response] User - */ - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateUserRequest} request CreateUserRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { - return this.rpcCall(createUser, $root.google.cloud.alloydb.v1.CreateUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); - }, "name", { value: "CreateUser" }); - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.ICreateUserRequest} request CreateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateUser}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.User} [response] User - */ - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { - return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1.UpdateUserRequest, $root.google.cloud.alloydb.v1.User, request, callback); - }, "name", { value: "UpdateUser" }); - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteUser}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { - return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteUser" }); - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listDatabases}. - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListDatabasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListDatabasesResponse} [response] ListDatabasesResponse - */ - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @param {google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listDatabases = function listDatabases(request, callback) { - return this.rpcCall(listDatabases, $root.google.cloud.alloydb.v1.ListDatabasesRequest, $root.google.cloud.alloydb.v1.ListDatabasesResponse, request, callback); - }, "name", { value: "ListDatabases" }); - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBAdmin; - })(); - - v1.ListClustersRequest = (function() { - - /** - * Properties of a ListClustersRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - * @property {string|null} [filter] ListClustersRequest filter - * @property {string|null} [orderBy] ListClustersRequest orderBy - */ - - /** - * Constructs a new ListClustersRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set - */ - function ListClustersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.parent = ""; - - /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageSize = 0; - - /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageToken = ""; - - /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.filter = ""; - - /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest instance - */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); - }; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest - */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListClustersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1.ListClustersRequest} message ListClustersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListClustersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @instance - * @returns {Object.} JSON object - */ - ListClustersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListClustersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersRequest"; - }; - - return ListClustersRequest; - })(); - - v1.ListClustersResponse = (function() { - - /** - * Properties of a ListClustersResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - * @property {Array.|null} [unreachable] ListClustersResponse unreachable - */ - - /** - * Constructs a new ListClustersResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse - * @constructor - * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set - */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.clusters = $util.emptyArray; - - /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.nextPageToken = ""; - - /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse instance - */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); - }; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.alloydb.v1.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.clusters[i]); - if (error) - return "clusters." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse - */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListClustersResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.clusters[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListClustersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1.ListClustersResponse} message ListClustersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.clusters = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.alloydb.v1.Cluster.toObject(message.clusters[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListClustersResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @instance - * @returns {Object.} JSON object - */ - ListClustersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListClustersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersResponse"; - }; - - return ListClustersResponse; - })(); - - v1.GetClusterRequest = (function() { - - /** - * Properties of a GetClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name - * @property {google.cloud.alloydb.v1.ClusterView|null} [view] GetClusterRequest view - */ - - /** - * Constructs a new GetClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set - */ - function GetClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.name = ""; - - /** - * GetClusterRequest view. - * @member {google.cloud.alloydb.v1.ClusterView} view - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.view = 0; - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest instance - */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); - }; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest - */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "CLUSTER_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "CLUSTER_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "CLUSTER_VIEW_CONTINUOUS_BACKUP": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1.GetClusterRequest} message GetClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.ClusterView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @instance - * @returns {Object.} JSON object - */ - GetClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetClusterRequest"; - }; - - return GetClusterRequest; - })(); - - v1.CreateSecondaryClusterRequest = (function() { - - /** - * Properties of a CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateSecondaryClusterRequest - * @property {string|null} [parent] CreateSecondaryClusterRequest parent - * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster - * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly - */ - - /** - * Constructs a new CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateSecondaryClusterRequest. - * @implements ICreateSecondaryClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set - */ - function CreateSecondaryClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecondaryClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.parent = ""; - - /** - * CreateSecondaryClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.clusterId = ""; - - /** - * CreateSecondaryClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.cluster = null; - - /** - * CreateSecondaryClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.requestId = ""; - - /** - * CreateSecondaryClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance - */ - CreateSecondaryClusterRequest.create = function create(properties) { - return new CreateSecondaryClusterRequest(properties); - }; - - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecondaryClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - */ - CreateSecondaryClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateSecondaryClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryClusterRequest"; - }; - - return CreateSecondaryClusterRequest; - })(); - - v1.CreateClusterRequest = (function() { - - /** - * Properties of a CreateClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateClusterRequest - * @property {string|null} [parent] CreateClusterRequest parent - * @property {string|null} [clusterId] CreateClusterRequest clusterId - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly - */ - - /** - * Constructs a new CreateClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set - */ - function CreateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.parent = ""; - - /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.clusterId = ""; - - /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.cluster = null; - - /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.requestId = ""; - - /** - * CreateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest instance - */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); - }; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest - */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.CreateClusterRequest} message CreateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateClusterRequest"; - }; - - return CreateClusterRequest; - })(); - - v1.UpdateClusterRequest = (function() { - - /** - * Properties of an UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IUpdateClusterRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {string|null} [requestId] UpdateClusterRequest requestId - * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing - */ - - /** - * Constructs a new UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set - */ - function UpdateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.updateMask = null; - - /** - * UpdateClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.cluster = null; - - /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.requestId = ""; - - /** - * UpdateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.validateOnly = false; - - /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest instance - */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); - }; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest - */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.UpdateClusterRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1.UpdateClusterRequest} message UpdateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateClusterRequest"; - }; - - return UpdateClusterRequest; - })(); - - v1.GcsDestination = (function() { - - /** - * Properties of a GcsDestination. - * @memberof google.cloud.alloydb.v1 - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - */ - - /** - * Constructs a new GcsDestination. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination - * @constructor - * @param {google.cloud.alloydb.v1.IGcsDestination=} [properties] Properties to set - */ - function GcsDestination(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.alloydb.v1.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {google.cloud.alloydb.v1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination instance - */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); - }; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {google.cloud.alloydb.v1.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GcsDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {google.cloud.alloydb.v1.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GcsDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDestination message. - * @function verify - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GcsDestination} GcsDestination - */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GcsDestination) - return object; - var message = new $root.google.cloud.alloydb.v1.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {google.cloud.alloydb.v1.GcsDestination} message GcsDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this GcsDestination to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GcsDestination - * @instance - * @returns {Object.} JSON object - */ - GcsDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDestination - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GcsDestination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GcsDestination"; - }; - - return GcsDestination; - })(); - - v1.ExportClusterRequest = (function() { - - /** - * Properties of an ExportClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IExportClusterRequest - * @property {google.cloud.alloydb.v1.IGcsDestination|null} [gcsDestination] ExportClusterRequest gcsDestination - * @property {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null} [csvExportOptions] ExportClusterRequest csvExportOptions - * @property {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null} [sqlExportOptions] ExportClusterRequest sqlExportOptions - * @property {string|null} [name] ExportClusterRequest name - * @property {string|null} [database] ExportClusterRequest database - */ - - /** - * Constructs a new ExportClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ExportClusterRequest. - * @implements IExportClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IExportClusterRequest=} [properties] Properties to set - */ - function ExportClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportClusterRequest gcsDestination. - * @member {google.cloud.alloydb.v1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.gcsDestination = null; - - /** - * ExportClusterRequest csvExportOptions. - * @member {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions|null|undefined} csvExportOptions - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.csvExportOptions = null; - - /** - * ExportClusterRequest sqlExportOptions. - * @member {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions|null|undefined} sqlExportOptions - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.sqlExportOptions = null; - - /** - * ExportClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.name = ""; - - /** - * ExportClusterRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.database = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportClusterRequest destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - Object.defineProperty(ExportClusterRequest.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * ExportClusterRequest exportOptions. - * @member {"csvExportOptions"|"sqlExportOptions"|undefined} exportOptions - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - */ - Object.defineProperty(ExportClusterRequest.prototype, "exportOptions", { - get: $util.oneOfGetter($oneOfFields = ["csvExportOptions", "sqlExportOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IExportClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest instance - */ - ExportClusterRequest.create = function create(properties) { - return new ExportClusterRequest(properties); - }; - - /** - * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IExportClusterRequest} message ExportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.alloydb.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); - if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) - $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) - $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IExportClusterRequest} message ExportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.decode(reader, reader.uint32()); - break; - } - case 4: { - message.csvExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.sqlExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.alloydb.v1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { - properties.exportOptions = 1; - { - var error = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify(message.csvExportOptions); - if (error) - return "csvExportOptions." + error; - } - } - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { - if (properties.exportOptions === 1) - return "exportOptions: multiple values"; - properties.exportOptions = 1; - { - var error = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify(message.sqlExportOptions); - if (error) - return "sqlExportOptions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExportClusterRequest} ExportClusterRequest - */ - ExportClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ExportClusterRequest(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.fromObject(object.gcsDestination); - } - if (object.csvExportOptions != null) { - if (typeof object.csvExportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.csvExportOptions: object expected"); - message.csvExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.fromObject(object.csvExportOptions); - } - if (object.sqlExportOptions != null) { - if (typeof object.sqlExportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.sqlExportOptions: object expected"); - message.sqlExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.fromObject(object.sqlExportOptions); - } - if (object.name != null) - message.name = String(object.name); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest} message ExportClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.database = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { - object.csvExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.toObject(message.csvExportOptions, options); - if (options.oneofs) - object.exportOptions = "csvExportOptions"; - } - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { - object.sqlExportOptions = $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.toObject(message.sqlExportOptions, options); - if (options.oneofs) - object.exportOptions = "sqlExportOptions"; - } - return object; - }; - - /** - * Converts this ExportClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @instance - * @returns {Object.} JSON object - */ - ExportClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterRequest"; - }; - - ExportClusterRequest.CsvExportOptions = (function() { - - /** - * Properties of a CsvExportOptions. - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @interface ICsvExportOptions - * @property {string|null} [selectQuery] CsvExportOptions selectQuery - * @property {string|null} [fieldDelimiter] CsvExportOptions fieldDelimiter - * @property {string|null} [quoteCharacter] CsvExportOptions quoteCharacter - * @property {string|null} [escapeCharacter] CsvExportOptions escapeCharacter - */ - - /** - * Constructs a new CsvExportOptions. - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @classdesc Represents a CsvExportOptions. - * @implements ICsvExportOptions - * @constructor - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set - */ - function CsvExportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CsvExportOptions selectQuery. - * @member {string} selectQuery - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.selectQuery = ""; - - /** - * CsvExportOptions fieldDelimiter. - * @member {string} fieldDelimiter - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.fieldDelimiter = ""; - - /** - * CsvExportOptions quoteCharacter. - * @member {string} quoteCharacter - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.quoteCharacter = ""; - - /** - * CsvExportOptions escapeCharacter. - * @member {string} escapeCharacter - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.escapeCharacter = ""; - - /** - * Creates a new CsvExportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions instance - */ - CsvExportOptions.create = function create(properties) { - return new CsvExportOptions(properties); - }; - - /** - * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvExportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); - if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldDelimiter); - if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.quoteCharacter); - if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.escapeCharacter); - return writer; - }; - - /** - * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvExportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selectQuery = reader.string(); - break; - } - case 2: { - message.fieldDelimiter = reader.string(); - break; - } - case 3: { - message.quoteCharacter = reader.string(); - break; - } - case 4: { - message.escapeCharacter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvExportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CsvExportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CsvExportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) - if (!$util.isString(message.selectQuery)) - return "selectQuery: string expected"; - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - if (!$util.isString(message.fieldDelimiter)) - return "fieldDelimiter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - if (!$util.isString(message.quoteCharacter)) - return "quoteCharacter: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - if (!$util.isString(message.escapeCharacter)) - return "escapeCharacter: string expected"; - return null; - }; - - /** - * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} CsvExportOptions - */ - CsvExportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions(); - if (object.selectQuery != null) - message.selectQuery = String(object.selectQuery); - if (object.fieldDelimiter != null) - message.fieldDelimiter = String(object.fieldDelimiter); - if (object.quoteCharacter != null) - message.quoteCharacter = String(object.quoteCharacter); - if (object.escapeCharacter != null) - message.escapeCharacter = String(object.escapeCharacter); - return message; - }; - - /** - * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} message CsvExportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CsvExportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.selectQuery = ""; - object.fieldDelimiter = ""; - object.quoteCharacter = ""; - object.escapeCharacter = ""; - } - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) - object.selectQuery = message.selectQuery; - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - object.fieldDelimiter = message.fieldDelimiter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - object.quoteCharacter = message.quoteCharacter; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - object.escapeCharacter = message.escapeCharacter; - return object; - }; - - /** - * Converts this CsvExportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @instance - * @returns {Object.} JSON object - */ - CsvExportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CsvExportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CsvExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions"; - }; - - return CsvExportOptions; - })(); - - ExportClusterRequest.SqlExportOptions = (function() { - - /** - * Properties of a SqlExportOptions. - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @interface ISqlExportOptions - * @property {Array.|null} [tables] SqlExportOptions tables - * @property {boolean|null} [schemaOnly] SqlExportOptions schemaOnly - * @property {boolean|null} [cleanTargetObjects] SqlExportOptions cleanTargetObjects - * @property {boolean|null} [ifExistTargetObjects] SqlExportOptions ifExistTargetObjects - */ - - /** - * Constructs a new SqlExportOptions. - * @memberof google.cloud.alloydb.v1.ExportClusterRequest - * @classdesc Represents a SqlExportOptions. - * @implements ISqlExportOptions - * @constructor - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set - */ - function SqlExportOptions(properties) { - this.tables = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlExportOptions tables. - * @member {Array.} tables - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.tables = $util.emptyArray; - - /** - * SqlExportOptions schemaOnly. - * @member {boolean|null|undefined} schemaOnly - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.schemaOnly = null; - - /** - * SqlExportOptions cleanTargetObjects. - * @member {boolean|null|undefined} cleanTargetObjects - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.cleanTargetObjects = null; - - /** - * SqlExportOptions ifExistTargetObjects. - * @member {boolean|null|undefined} ifExistTargetObjects - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.ifExistTargetObjects = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_schemaOnly", { - get: $util.oneOfGetter($oneOfFields = ["schemaOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_cleanTargetObjects", { - get: $util.oneOfGetter($oneOfFields = ["cleanTargetObjects"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_ifExistTargetObjects", { - get: $util.oneOfGetter($oneOfFields = ["ifExistTargetObjects"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SqlExportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions instance - */ - SqlExportOptions.create = function create(properties) { - return new SqlExportOptions(properties); - }; - - /** - * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlExportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tables != null && message.tables.length) - for (var i = 0; i < message.tables.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); - if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.schemaOnly); - if (message.cleanTargetObjects != null && Object.hasOwnProperty.call(message, "cleanTargetObjects")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanTargetObjects); - if (message.ifExistTargetObjects != null && Object.hasOwnProperty.call(message, "ifExistTargetObjects")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ifExistTargetObjects); - return writer; - }; - - /** - * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlExportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tables && message.tables.length)) - message.tables = []; - message.tables.push(reader.string()); - break; - } - case 2: { - message.schemaOnly = reader.bool(); - break; - } - case 3: { - message.cleanTargetObjects = reader.bool(); - break; - } - case 4: { - message.ifExistTargetObjects = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlExportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlExportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlExportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tables != null && message.hasOwnProperty("tables")) { - if (!Array.isArray(message.tables)) - return "tables: array expected"; - for (var i = 0; i < message.tables.length; ++i) - if (!$util.isString(message.tables[i])) - return "tables: string[] expected"; - } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { - properties._schemaOnly = 1; - if (typeof message.schemaOnly !== "boolean") - return "schemaOnly: boolean expected"; - } - if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { - properties._cleanTargetObjects = 1; - if (typeof message.cleanTargetObjects !== "boolean") - return "cleanTargetObjects: boolean expected"; - } - if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { - properties._ifExistTargetObjects = 1; - if (typeof message.ifExistTargetObjects !== "boolean") - return "ifExistTargetObjects: boolean expected"; - } - return null; - }; - - /** - * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} SqlExportOptions - */ - SqlExportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions(); - if (object.tables) { - if (!Array.isArray(object.tables)) - throw TypeError(".google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions.tables: array expected"); - message.tables = []; - for (var i = 0; i < object.tables.length; ++i) - message.tables[i] = String(object.tables[i]); - } - if (object.schemaOnly != null) - message.schemaOnly = Boolean(object.schemaOnly); - if (object.cleanTargetObjects != null) - message.cleanTargetObjects = Boolean(object.cleanTargetObjects); - if (object.ifExistTargetObjects != null) - message.ifExistTargetObjects = Boolean(object.ifExistTargetObjects); - return message; - }; - - /** - * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} message SqlExportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlExportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tables = []; - if (message.tables && message.tables.length) { - object.tables = []; - for (var j = 0; j < message.tables.length; ++j) - object.tables[j] = message.tables[j]; - } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { - object.schemaOnly = message.schemaOnly; - if (options.oneofs) - object._schemaOnly = "schemaOnly"; - } - if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { - object.cleanTargetObjects = message.cleanTargetObjects; - if (options.oneofs) - object._cleanTargetObjects = "cleanTargetObjects"; - } - if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { - object.ifExistTargetObjects = message.ifExistTargetObjects; - if (options.oneofs) - object._ifExistTargetObjects = "ifExistTargetObjects"; - } - return object; - }; - - /** - * Converts this SqlExportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @instance - * @returns {Object.} JSON object - */ - SqlExportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlExportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions"; - }; - - return SqlExportOptions; - })(); - - return ExportClusterRequest; - })(); - - v1.ExportClusterResponse = (function() { - - /** - * Properties of an ExportClusterResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IExportClusterResponse - * @property {google.cloud.alloydb.v1.IGcsDestination|null} [gcsDestination] ExportClusterResponse gcsDestination - */ - - /** - * Constructs a new ExportClusterResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ExportClusterResponse. - * @implements IExportClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1.IExportClusterResponse=} [properties] Properties to set - */ - function ExportClusterResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportClusterResponse gcsDestination. - * @member {google.cloud.alloydb.v1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @instance - */ - ExportClusterResponse.prototype.gcsDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportClusterResponse destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @instance - */ - Object.defineProperty(ExportClusterResponse.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IExportClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse instance - */ - ExportClusterResponse.create = function create(properties) { - return new ExportClusterResponse(properties); - }; - - /** - * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IExportClusterResponse} message ExportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.alloydb.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExportClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IExportClusterResponse} message ExportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExportClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.alloydb.v1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - return null; - }; - - /** - * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExportClusterResponse} ExportClusterResponse - */ - ExportClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExportClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ExportClusterResponse(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExportClusterResponse.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.fromObject(object.gcsDestination); - } - return message; - }; - - /** - * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.ExportClusterResponse} message ExportClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.alloydb.v1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - return object; - }; - - /** - * Converts this ExportClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @instance - * @returns {Object.} JSON object - */ - ExportClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExportClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExportClusterResponse"; - }; - - return ExportClusterResponse; - })(); - - v1.ImportClusterRequest = (function() { - - /** - * Properties of an ImportClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IImportClusterRequest - * @property {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null} [sqlImportOptions] ImportClusterRequest sqlImportOptions - * @property {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null} [csvImportOptions] ImportClusterRequest csvImportOptions - * @property {string|null} [name] ImportClusterRequest name - * @property {string|null} [gcsUri] ImportClusterRequest gcsUri - * @property {string|null} [database] ImportClusterRequest database - * @property {string|null} [user] ImportClusterRequest user - */ - - /** - * Constructs a new ImportClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ImportClusterRequest. - * @implements IImportClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IImportClusterRequest=} [properties] Properties to set - */ - function ImportClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportClusterRequest sqlImportOptions. - * @member {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions|null|undefined} sqlImportOptions - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.sqlImportOptions = null; - - /** - * ImportClusterRequest csvImportOptions. - * @member {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions|null|undefined} csvImportOptions - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.csvImportOptions = null; - - /** - * ImportClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.name = ""; - - /** - * ImportClusterRequest gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.gcsUri = ""; - - /** - * ImportClusterRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.database = ""; - - /** - * ImportClusterRequest user. - * @member {string} user - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.user = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportClusterRequest importOptions. - * @member {"sqlImportOptions"|"csvImportOptions"|undefined} importOptions - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - */ - Object.defineProperty(ImportClusterRequest.prototype, "importOptions", { - get: $util.oneOfGetter($oneOfFields = ["sqlImportOptions", "csvImportOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IImportClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest instance - */ - ImportClusterRequest.create = function create(properties) { - return new ImportClusterRequest(properties); - }; - - /** - * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IImportClusterRequest} message ImportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); - if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) - $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.user); - if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) - $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IImportClusterRequest} message ImportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.sqlImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.decode(reader, reader.uint32()); - break; - } - case 7: { - message.csvImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.gcsUri = reader.string(); - break; - } - case 3: { - message.database = reader.string(); - break; - } - case 5: { - message.user = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { - properties.importOptions = 1; - { - var error = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify(message.sqlImportOptions); - if (error) - return "sqlImportOptions." + error; - } - } - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { - if (properties.importOptions === 1) - return "importOptions: multiple values"; - properties.importOptions = 1; - { - var error = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify(message.csvImportOptions); - if (error) - return "csvImportOptions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - return null; - }; - - /** - * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ImportClusterRequest} ImportClusterRequest - */ - ImportClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ImportClusterRequest(); - if (object.sqlImportOptions != null) { - if (typeof object.sqlImportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1.ImportClusterRequest.sqlImportOptions: object expected"); - message.sqlImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.fromObject(object.sqlImportOptions); - } - if (object.csvImportOptions != null) { - if (typeof object.csvImportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1.ImportClusterRequest.csvImportOptions: object expected"); - message.csvImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.fromObject(object.csvImportOptions); - } - if (object.name != null) - message.name = String(object.name); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.database != null) - message.database = String(object.database); - if (object.user != null) - message.user = String(object.user); - return message; - }; - - /** - * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest} message ImportClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.gcsUri = ""; - object.database = ""; - object.user = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { - object.sqlImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.toObject(message.sqlImportOptions, options); - if (options.oneofs) - object.importOptions = "sqlImportOptions"; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { - object.csvImportOptions = $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.toObject(message.csvImportOptions, options); - if (options.oneofs) - object.importOptions = "csvImportOptions"; - } - return object; - }; - - /** - * Converts this ImportClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @instance - * @returns {Object.} JSON object - */ - ImportClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterRequest"; - }; - - ImportClusterRequest.SqlImportOptions = (function() { - - /** - * Properties of a SqlImportOptions. - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @interface ISqlImportOptions - */ - - /** - * Constructs a new SqlImportOptions. - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @classdesc Represents a SqlImportOptions. - * @implements ISqlImportOptions - * @constructor - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set - */ - function SqlImportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new SqlImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions instance - */ - SqlImportOptions.create = function create(properties) { - return new SqlImportOptions(properties); - }; - - /** - * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlImportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} SqlImportOptions - */ - SqlImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions) - return object; - return new $root.google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions(); - }; - - /** - * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} message SqlImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlImportOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SqlImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @instance - * @returns {Object.} JSON object - */ - SqlImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlImportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions"; - }; - - return SqlImportOptions; - })(); - - ImportClusterRequest.CsvImportOptions = (function() { - - /** - * Properties of a CsvImportOptions. - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @interface ICsvImportOptions - * @property {string|null} [table] CsvImportOptions table - * @property {Array.|null} [columns] CsvImportOptions columns - * @property {string|null} [fieldDelimiter] CsvImportOptions fieldDelimiter - * @property {string|null} [quoteCharacter] CsvImportOptions quoteCharacter - * @property {string|null} [escapeCharacter] CsvImportOptions escapeCharacter - */ - - /** - * Constructs a new CsvImportOptions. - * @memberof google.cloud.alloydb.v1.ImportClusterRequest - * @classdesc Represents a CsvImportOptions. - * @implements ICsvImportOptions - * @constructor - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set - */ - function CsvImportOptions(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CsvImportOptions table. - * @member {string} table - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.table = ""; - - /** - * CsvImportOptions columns. - * @member {Array.} columns - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.columns = $util.emptyArray; - - /** - * CsvImportOptions fieldDelimiter. - * @member {string} fieldDelimiter - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.fieldDelimiter = ""; - - /** - * CsvImportOptions quoteCharacter. - * @member {string} quoteCharacter - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.quoteCharacter = ""; - - /** - * CsvImportOptions escapeCharacter. - * @member {string} escapeCharacter - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.escapeCharacter = ""; - - /** - * Creates a new CsvImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions instance - */ - CsvImportOptions.create = function create(properties) { - return new CsvImportOptions(properties); - }; - - /** - * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); - if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldDelimiter); - if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.quoteCharacter); - if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.escapeCharacter); - return writer; - }; - - /** - * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 3: { - message.fieldDelimiter = reader.string(); - break; - } - case 4: { - message.quoteCharacter = reader.string(); - break; - } - case 5: { - message.escapeCharacter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CsvImportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CsvImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - if (!$util.isString(message.fieldDelimiter)) - return "fieldDelimiter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - if (!$util.isString(message.quoteCharacter)) - return "quoteCharacter: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - if (!$util.isString(message.escapeCharacter)) - return "escapeCharacter: string expected"; - return null; - }; - - /** - * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} CsvImportOptions - */ - CsvImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions(); - if (object.table != null) - message.table = String(object.table); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.fieldDelimiter != null) - message.fieldDelimiter = String(object.fieldDelimiter); - if (object.quoteCharacter != null) - message.quoteCharacter = String(object.quoteCharacter); - if (object.escapeCharacter != null) - message.escapeCharacter = String(object.escapeCharacter); - return message; - }; - - /** - * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} message CsvImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CsvImportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.table = ""; - object.fieldDelimiter = ""; - object.quoteCharacter = ""; - object.escapeCharacter = ""; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - object.fieldDelimiter = message.fieldDelimiter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - object.quoteCharacter = message.quoteCharacter; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - object.escapeCharacter = message.escapeCharacter; - return object; - }; - - /** - * Converts this CsvImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @instance - * @returns {Object.} JSON object - */ - CsvImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CsvImportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CsvImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions"; - }; - - return CsvImportOptions; - })(); - - return ImportClusterRequest; - })(); - - v1.ImportClusterResponse = (function() { - - /** - * Properties of an ImportClusterResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IImportClusterResponse - * @property {number|Long|null} [bytesDownloaded] ImportClusterResponse bytesDownloaded - */ - - /** - * Constructs a new ImportClusterResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ImportClusterResponse. - * @implements IImportClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1.IImportClusterResponse=} [properties] Properties to set - */ - function ImportClusterResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportClusterResponse bytesDownloaded. - * @member {number|Long} bytesDownloaded - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @instance - */ - ImportClusterResponse.prototype.bytesDownloaded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ImportClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IImportClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse instance - */ - ImportClusterResponse.create = function create(properties) { - return new ImportClusterResponse(properties); - }; - - /** - * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IImportClusterResponse} message ImportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bytesDownloaded != null && Object.hasOwnProperty.call(message, "bytesDownloaded")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bytesDownloaded); - return writer; - }; - - /** - * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ImportClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IImportClusterResponse} message ImportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ImportClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bytesDownloaded = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) - if (!$util.isInteger(message.bytesDownloaded) && !(message.bytesDownloaded && $util.isInteger(message.bytesDownloaded.low) && $util.isInteger(message.bytesDownloaded.high))) - return "bytesDownloaded: integer|Long expected"; - return null; - }; - - /** - * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ImportClusterResponse} ImportClusterResponse - */ - ImportClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ImportClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ImportClusterResponse(); - if (object.bytesDownloaded != null) - if ($util.Long) - (message.bytesDownloaded = $util.Long.fromValue(object.bytesDownloaded)).unsigned = false; - else if (typeof object.bytesDownloaded === "string") - message.bytesDownloaded = parseInt(object.bytesDownloaded, 10); - else if (typeof object.bytesDownloaded === "number") - message.bytesDownloaded = object.bytesDownloaded; - else if (typeof object.bytesDownloaded === "object") - message.bytesDownloaded = new $util.LongBits(object.bytesDownloaded.low >>> 0, object.bytesDownloaded.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1.ImportClusterResponse} message ImportClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesDownloaded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesDownloaded = options.longs === String ? "0" : 0; - if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) - if (typeof message.bytesDownloaded === "number") - object.bytesDownloaded = options.longs === String ? String(message.bytesDownloaded) : message.bytesDownloaded; - else - object.bytesDownloaded = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDownloaded) : options.longs === Number ? new $util.LongBits(message.bytesDownloaded.low >>> 0, message.bytesDownloaded.high >>> 0).toNumber() : message.bytesDownloaded; - return object; - }; - - /** - * Converts this ImportClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @instance - * @returns {Object.} JSON object - */ - ImportClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ImportClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ImportClusterResponse"; - }; - - return ImportClusterResponse; - })(); - - v1.UpgradeClusterRequest = (function() { - - /** - * Properties of an UpgradeClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IUpgradeClusterRequest - * @property {string|null} [name] UpgradeClusterRequest name - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [version] UpgradeClusterRequest version - * @property {string|null} [requestId] UpgradeClusterRequest requestId - * @property {boolean|null} [validateOnly] UpgradeClusterRequest validateOnly - * @property {string|null} [etag] UpgradeClusterRequest etag - */ - - /** - * Constructs a new UpgradeClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpgradeClusterRequest. - * @implements IUpgradeClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest=} [properties] Properties to set - */ - function UpgradeClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.name = ""; - - /** - * UpgradeClusterRequest version. - * @member {google.cloud.alloydb.v1.DatabaseVersion} version - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.version = 0; - - /** - * UpgradeClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.requestId = ""; - - /** - * UpgradeClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.validateOnly = false; - - /** - * UpgradeClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.etag = ""; - - /** - * Creates a new UpgradeClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest instance - */ - UpgradeClusterRequest.create = function create(properties) { - return new UpgradeClusterRequest(properties); - }; - - /** - * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.version = reader.int32(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - switch (message.version) { - default: - return "version: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterRequest} UpgradeClusterRequest - */ - UpgradeClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.version) { - default: - if (typeof object.version === "number") { - message.version = object.version; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.version = 0; - break; - case "POSTGRES_13": - case 1: - message.version = 1; - break; - case "POSTGRES_14": - case 2: - message.version = 2; - break; - case "POSTGRES_15": - case 3: - message.version = 3; - break; - case "POSTGRES_16": - case 4: - message.version = 4; - break; - case "POSTGRES_17": - case 5: - message.version = 5; - break; - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterRequest} message UpgradeClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.version = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.version] === undefined ? message.version : $root.google.cloud.alloydb.v1.DatabaseVersion[message.version] : message.version; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this UpgradeClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterRequest"; - }; - - return UpgradeClusterRequest; - })(); - - v1.UpgradeClusterResponse = (function() { - - /** - * Properties of an UpgradeClusterResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IUpgradeClusterResponse - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [status] UpgradeClusterResponse status - * @property {string|null} [message] UpgradeClusterResponse message - * @property {Array.|null} [clusterUpgradeDetails] UpgradeClusterResponse clusterUpgradeDetails - */ - - /** - * Constructs a new UpgradeClusterResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpgradeClusterResponse. - * @implements IUpgradeClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse=} [properties] Properties to set - */ - function UpgradeClusterResponse(properties) { - this.clusterUpgradeDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterResponse status. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} status - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.status = 0; - - /** - * UpgradeClusterResponse message. - * @member {string} message - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.message = ""; - - /** - * UpgradeClusterResponse clusterUpgradeDetails. - * @member {Array.} clusterUpgradeDetails - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.clusterUpgradeDetails = $util.emptyArray; - - /** - * Creates a new UpgradeClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse instance - */ - UpgradeClusterResponse.create = function create(properties) { - return new UpgradeClusterResponse(properties); - }; - - /** - * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.clusterUpgradeDetails != null && message.clusterUpgradeDetails.length) - for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) - $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.encode(message.clusterUpgradeDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.status = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.clusterUpgradeDetails && message.clusterUpgradeDetails.length)) - message.clusterUpgradeDetails = []; - message.clusterUpgradeDetails.push($root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.clusterUpgradeDetails != null && message.hasOwnProperty("clusterUpgradeDetails")) { - if (!Array.isArray(message.clusterUpgradeDetails)) - return "clusterUpgradeDetails: array expected"; - for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify(message.clusterUpgradeDetails[i]); - if (error) - return "clusterUpgradeDetails." + error; - } - } - return null; - }; - - /** - * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse} UpgradeClusterResponse - */ - UpgradeClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse(); - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "NOT_STARTED": - case 4: - message.status = 4; - break; - case "IN_PROGRESS": - case 5: - message.status = 5; - break; - case "SUCCESS": - case 1: - message.status = 1; - break; - case "FAILED": - case 2: - message.status = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.status = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.status = 6; - break; - case "CANCELLED": - case 7: - message.status = 7; - break; - } - if (object.message != null) - message.message = String(object.message); - if (object.clusterUpgradeDetails) { - if (!Array.isArray(object.clusterUpgradeDetails)) - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.clusterUpgradeDetails: array expected"); - message.clusterUpgradeDetails = []; - for (var i = 0; i < object.clusterUpgradeDetails.length; ++i) { - if (typeof object.clusterUpgradeDetails[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.clusterUpgradeDetails: object expected"); - message.clusterUpgradeDetails[i] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.fromObject(object.clusterUpgradeDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse} message UpgradeClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clusterUpgradeDetails = []; - if (options.defaults) { - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.message = ""; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] : message.status; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.clusterUpgradeDetails && message.clusterUpgradeDetails.length) { - object.clusterUpgradeDetails = []; - for (var j = 0; j < message.clusterUpgradeDetails.length; ++j) - object.clusterUpgradeDetails[j] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.toObject(message.clusterUpgradeDetails[j], options); - } - return object; - }; - - /** - * Converts this UpgradeClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse"; - }; - - UpgradeClusterResponse.StageInfo = (function() { - - /** - * Properties of a StageInfo. - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @interface IStageInfo - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null} [stage] StageInfo stage - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [status] StageInfo status - * @property {string|null} [logsUrl] StageInfo logsUrl - */ - - /** - * Constructs a new StageInfo. - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @classdesc Represents a StageInfo. - * @implements IStageInfo - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set - */ - function StageInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageInfo stage. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage} stage - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.stage = 0; - - /** - * StageInfo status. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} status - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.status = 0; - - /** - * StageInfo logsUrl. - * @member {string} logsUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.logsUrl = ""; - - /** - * Creates a new StageInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo instance - */ - StageInfo.create = function create(properties) { - return new StageInfo(properties); - }; - - /** - * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); - if (message.logsUrl != null && Object.hasOwnProperty.call(message, "logsUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.logsUrl); - return writer; - }; - - /** - * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stage = reader.int32(); - break; - } - case 2: { - message.status = reader.int32(); - break; - } - case 3: { - message.logsUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stage != null && message.hasOwnProperty("stage")) - switch (message.stage) { - default: - return "stage: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) - if (!$util.isString(message.logsUrl)) - return "logsUrl: string expected"; - return null; - }; - - /** - * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} StageInfo - */ - StageInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo(); - switch (object.stage) { - default: - if (typeof object.stage === "number") { - message.stage = object.stage; - break; - } - break; - case "STAGE_UNSPECIFIED": - case 0: - message.stage = 0; - break; - case "ALLOYDB_PRECHECK": - case 1: - message.stage = 1; - break; - case "PG_UPGRADE_CHECK": - case 2: - message.stage = 2; - break; - case "PREPARE_FOR_UPGRADE": - case 5: - message.stage = 5; - break; - case "PRIMARY_INSTANCE_UPGRADE": - case 3: - message.stage = 3; - break; - case "READ_POOL_INSTANCES_UPGRADE": - case 4: - message.stage = 4; - break; - case "ROLLBACK": - case 6: - message.stage = 6; - break; - case "CLEANUP": - case 7: - message.stage = 7; - break; - } - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "NOT_STARTED": - case 4: - message.status = 4; - break; - case "IN_PROGRESS": - case 5: - message.status = 5; - break; - case "SUCCESS": - case 1: - message.status = 1; - break; - case "FAILED": - case 2: - message.status = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.status = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.status = 6; - break; - case "CANCELLED": - case 7: - message.status = 7; - break; - } - if (object.logsUrl != null) - message.logsUrl = String(object.logsUrl); - return message; - }; - - /** - * Creates a plain object from a StageInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo} message StageInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.logsUrl = ""; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] : message.stage; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.status] : message.status; - if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) - object.logsUrl = message.logsUrl; - return object; - }; - - /** - * Converts this StageInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @instance - * @returns {Object.} JSON object - */ - StageInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo"; - }; - - return StageInfo; - })(); - - UpgradeClusterResponse.InstanceUpgradeDetails = (function() { - - /** - * Properties of an InstanceUpgradeDetails. - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @interface IInstanceUpgradeDetails - * @property {string|null} [name] InstanceUpgradeDetails name - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [upgradeStatus] InstanceUpgradeDetails upgradeStatus - * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [instanceType] InstanceUpgradeDetails instanceType - */ - - /** - * Constructs a new InstanceUpgradeDetails. - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @classdesc Represents an InstanceUpgradeDetails. - * @implements IInstanceUpgradeDetails - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set - */ - function InstanceUpgradeDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceUpgradeDetails name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.name = ""; - - /** - * InstanceUpgradeDetails upgradeStatus. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} upgradeStatus - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.upgradeStatus = 0; - - /** - * InstanceUpgradeDetails instanceType. - * @member {google.cloud.alloydb.v1.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.instanceType = 0; - - /** - * Creates a new InstanceUpgradeDetails instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails instance - */ - InstanceUpgradeDetails.create = function create(properties) { - return new InstanceUpgradeDetails(properties); - }; - - /** - * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceUpgradeDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.instanceType); - return writer; - }; - - /** - * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceUpgradeDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.upgradeStatus = reader.int32(); - break; - } - case 3: { - message.instanceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceUpgradeDetails message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceUpgradeDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - switch (message.upgradeStatus) { - default: - return "upgradeStatus: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - */ - InstanceUpgradeDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails(); - if (object.name != null) - message.name = String(object.name); - switch (object.upgradeStatus) { - default: - if (typeof object.upgradeStatus === "number") { - message.upgradeStatus = object.upgradeStatus; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.upgradeStatus = 0; - break; - case "NOT_STARTED": - case 4: - message.upgradeStatus = 4; - break; - case "IN_PROGRESS": - case 5: - message.upgradeStatus = 5; - break; - case "SUCCESS": - case 1: - message.upgradeStatus = 1; - break; - case "FAILED": - case 2: - message.upgradeStatus = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.upgradeStatus = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.upgradeStatus = 6; - break; - case "CANCELLED": - case 7: - message.upgradeStatus = 7; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails} message InstanceUpgradeDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceUpgradeDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.instanceType] : message.instanceType; - return object; - }; - - /** - * Converts this InstanceUpgradeDetails to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - * @returns {Object.} JSON object - */ - InstanceUpgradeDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceUpgradeDetails - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails"; - }; - - return InstanceUpgradeDetails; - })(); - - UpgradeClusterResponse.ClusterUpgradeDetails = (function() { - - /** - * Properties of a ClusterUpgradeDetails. - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @interface IClusterUpgradeDetails - * @property {string|null} [name] ClusterUpgradeDetails name - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [upgradeStatus] ClusterUpgradeDetails upgradeStatus - * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] ClusterUpgradeDetails clusterType - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] ClusterUpgradeDetails databaseVersion - * @property {Array.|null} [stageInfo] ClusterUpgradeDetails stageInfo - * @property {Array.|null} [instanceUpgradeDetails] ClusterUpgradeDetails instanceUpgradeDetails - */ - - /** - * Constructs a new ClusterUpgradeDetails. - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse - * @classdesc Represents a ClusterUpgradeDetails. - * @implements IClusterUpgradeDetails - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set - */ - function ClusterUpgradeDetails(properties) { - this.stageInfo = []; - this.instanceUpgradeDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterUpgradeDetails name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.name = ""; - - /** - * ClusterUpgradeDetails upgradeStatus. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} upgradeStatus - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.upgradeStatus = 0; - - /** - * ClusterUpgradeDetails clusterType. - * @member {google.cloud.alloydb.v1.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.clusterType = 0; - - /** - * ClusterUpgradeDetails databaseVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.databaseVersion = 0; - - /** - * ClusterUpgradeDetails stageInfo. - * @member {Array.} stageInfo - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.stageInfo = $util.emptyArray; - - /** - * ClusterUpgradeDetails instanceUpgradeDetails. - * @member {Array.} instanceUpgradeDetails - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.instanceUpgradeDetails = $util.emptyArray; - - /** - * Creates a new ClusterUpgradeDetails instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails instance - */ - ClusterUpgradeDetails.create = function create(properties) { - return new ClusterUpgradeDetails(properties); - }; - - /** - * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterUpgradeDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.clusterType); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.databaseVersion); - if (message.stageInfo != null && message.stageInfo.length) - for (var i = 0; i < message.stageInfo.length; ++i) - $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.encode(message.stageInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.instanceUpgradeDetails != null && message.instanceUpgradeDetails.length) - for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) - $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.encode(message.instanceUpgradeDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterUpgradeDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.upgradeStatus = reader.int32(); - break; - } - case 3: { - message.clusterType = reader.int32(); - break; - } - case 4: { - message.databaseVersion = reader.int32(); - break; - } - case 5: { - if (!(message.stageInfo && message.stageInfo.length)) - message.stageInfo = []; - message.stageInfo.push($root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.instanceUpgradeDetails && message.instanceUpgradeDetails.length)) - message.instanceUpgradeDetails = []; - message.instanceUpgradeDetails.push($root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterUpgradeDetails message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterUpgradeDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - switch (message.upgradeStatus) { - default: - return "upgradeStatus: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stageInfo != null && message.hasOwnProperty("stageInfo")) { - if (!Array.isArray(message.stageInfo)) - return "stageInfo: array expected"; - for (var i = 0; i < message.stageInfo.length; ++i) { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.verify(message.stageInfo[i]); - if (error) - return "stageInfo." + error; - } - } - if (message.instanceUpgradeDetails != null && message.hasOwnProperty("instanceUpgradeDetails")) { - if (!Array.isArray(message.instanceUpgradeDetails)) - return "instanceUpgradeDetails: array expected"; - for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.verify(message.instanceUpgradeDetails[i]); - if (error) - return "instanceUpgradeDetails." + error; - } - } - return null; - }; - - /** - * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - */ - ClusterUpgradeDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails(); - if (object.name != null) - message.name = String(object.name); - switch (object.upgradeStatus) { - default: - if (typeof object.upgradeStatus === "number") { - message.upgradeStatus = object.upgradeStatus; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.upgradeStatus = 0; - break; - case "NOT_STARTED": - case 4: - message.upgradeStatus = 4; - break; - case "IN_PROGRESS": - case 5: - message.upgradeStatus = 5; - break; - case "SUCCESS": - case 1: - message.upgradeStatus = 1; - break; - case "FAILED": - case 2: - message.upgradeStatus = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.upgradeStatus = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.upgradeStatus = 6; - break; - case "CANCELLED": - case 7: - message.upgradeStatus = 7; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - } - if (object.stageInfo) { - if (!Array.isArray(object.stageInfo)) - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: array expected"); - message.stageInfo = []; - for (var i = 0; i < object.stageInfo.length; ++i) { - if (typeof object.stageInfo[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: object expected"); - message.stageInfo[i] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.fromObject(object.stageInfo[i]); - } - } - if (object.instanceUpgradeDetails) { - if (!Array.isArray(object.instanceUpgradeDetails)) - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: array expected"); - message.instanceUpgradeDetails = []; - for (var i = 0; i < object.instanceUpgradeDetails.length; ++i) { - if (typeof object.instanceUpgradeDetails[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: object expected"); - message.instanceUpgradeDetails[i] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.fromObject(object.instanceUpgradeDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails} message ClusterUpgradeDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterUpgradeDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.stageInfo = []; - object.instanceUpgradeDetails = []; - } - if (options.defaults) { - object.name = ""; - object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.stageInfo && message.stageInfo.length) { - object.stageInfo = []; - for (var j = 0; j < message.stageInfo.length; ++j) - object.stageInfo[j] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.StageInfo.toObject(message.stageInfo[j], options); - } - if (message.instanceUpgradeDetails && message.instanceUpgradeDetails.length) { - object.instanceUpgradeDetails = []; - for (var j = 0; j < message.instanceUpgradeDetails.length; ++j) - object.instanceUpgradeDetails[j] = $root.google.cloud.alloydb.v1.UpgradeClusterResponse.InstanceUpgradeDetails.toObject(message.instanceUpgradeDetails[j], options); - } - return object; - }; - - /** - * Converts this ClusterUpgradeDetails to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - * @returns {Object.} JSON object - */ - ClusterUpgradeDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterUpgradeDetails - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterResponse.ClusterUpgradeDetails"; - }; - - return ClusterUpgradeDetails; - })(); - - /** - * Status enum. - * @name google.cloud.alloydb.v1.UpgradeClusterResponse.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} NOT_STARTED=4 NOT_STARTED value - * @property {number} IN_PROGRESS=5 IN_PROGRESS value - * @property {number} SUCCESS=1 SUCCESS value - * @property {number} FAILED=2 FAILED value - * @property {number} PARTIAL_SUCCESS=3 PARTIAL_SUCCESS value - * @property {number} CANCEL_IN_PROGRESS=6 CANCEL_IN_PROGRESS value - * @property {number} CANCELLED=7 CANCELLED value - */ - UpgradeClusterResponse.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[4] = "NOT_STARTED"] = 4; - values[valuesById[5] = "IN_PROGRESS"] = 5; - values[valuesById[1] = "SUCCESS"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "PARTIAL_SUCCESS"] = 3; - values[valuesById[6] = "CANCEL_IN_PROGRESS"] = 6; - values[valuesById[7] = "CANCELLED"] = 7; - return values; - })(); - - /** - * Stage enum. - * @name google.cloud.alloydb.v1.UpgradeClusterResponse.Stage - * @enum {number} - * @property {number} STAGE_UNSPECIFIED=0 STAGE_UNSPECIFIED value - * @property {number} ALLOYDB_PRECHECK=1 ALLOYDB_PRECHECK value - * @property {number} PG_UPGRADE_CHECK=2 PG_UPGRADE_CHECK value - * @property {number} PREPARE_FOR_UPGRADE=5 PREPARE_FOR_UPGRADE value - * @property {number} PRIMARY_INSTANCE_UPGRADE=3 PRIMARY_INSTANCE_UPGRADE value - * @property {number} READ_POOL_INSTANCES_UPGRADE=4 READ_POOL_INSTANCES_UPGRADE value - * @property {number} ROLLBACK=6 ROLLBACK value - * @property {number} CLEANUP=7 CLEANUP value - */ - UpgradeClusterResponse.Stage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STAGE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOYDB_PRECHECK"] = 1; - values[valuesById[2] = "PG_UPGRADE_CHECK"] = 2; - values[valuesById[5] = "PREPARE_FOR_UPGRADE"] = 5; - values[valuesById[3] = "PRIMARY_INSTANCE_UPGRADE"] = 3; - values[valuesById[4] = "READ_POOL_INSTANCES_UPGRADE"] = 4; - values[valuesById[6] = "ROLLBACK"] = 6; - values[valuesById[7] = "CLEANUP"] = 7; - return values; - })(); - - return UpgradeClusterResponse; - })(); - - v1.DeleteClusterRequest = (function() { - - /** - * Properties of a DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name - * @property {string|null} [requestId] DeleteClusterRequest requestId - * @property {string|null} [etag] DeleteClusterRequest etag - * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly - * @property {boolean|null} [force] DeleteClusterRequest force - */ - - /** - * Constructs a new DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set - */ - function DeleteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.name = ""; - - /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.requestId = ""; - - /** - * DeleteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.etag = ""; - - /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.validateOnly = false; - - /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.force = false; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest instance - */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); - }; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); - return writer; - }; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest - */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.DeleteClusterRequest} message DeleteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteClusterRequest"; - }; - - return DeleteClusterRequest; - })(); - - v1.SwitchoverClusterRequest = (function() { - - /** - * Properties of a SwitchoverClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ISwitchoverClusterRequest - * @property {string|null} [name] SwitchoverClusterRequest name - * @property {string|null} [requestId] SwitchoverClusterRequest requestId - * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly - */ - - /** - * Constructs a new SwitchoverClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SwitchoverClusterRequest. - * @implements ISwitchoverClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest=} [properties] Properties to set - */ - function SwitchoverClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SwitchoverClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.name = ""; - - /** - * SwitchoverClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.requestId = ""; - - /** - * SwitchoverClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new SwitchoverClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest instance - */ - SwitchoverClusterRequest.create = function create(properties) { - return new SwitchoverClusterRequest(properties); - }; - - /** - * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwitchoverClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwitchoverClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SwitchoverClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SwitchoverClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SwitchoverClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest - */ - SwitchoverClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SwitchoverClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.SwitchoverClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1.SwitchoverClusterRequest} message SwitchoverClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SwitchoverClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this SwitchoverClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @instance - * @returns {Object.} JSON object - */ - SwitchoverClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SwitchoverClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SwitchoverClusterRequest"; - }; - - return SwitchoverClusterRequest; - })(); - - v1.PromoteClusterRequest = (function() { - - /** - * Properties of a PromoteClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IPromoteClusterRequest - * @property {string|null} [name] PromoteClusterRequest name - * @property {string|null} [requestId] PromoteClusterRequest requestId - * @property {string|null} [etag] PromoteClusterRequest etag - * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly - */ - - /** - * Constructs a new PromoteClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a PromoteClusterRequest. - * @implements IPromoteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set - */ - function PromoteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromoteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.name = ""; - - /** - * PromoteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.requestId = ""; - - /** - * PromoteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.etag = ""; - - /** - * PromoteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new PromoteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest instance - */ - PromoteClusterRequest.create = function create(properties) { - return new PromoteClusterRequest(properties); - }; - - /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.PromoteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromoteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromoteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest - */ - PromoteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.PromoteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.PromoteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1.PromoteClusterRequest} message PromoteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromoteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this PromoteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - PromoteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromoteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.PromoteClusterRequest"; - }; - - return PromoteClusterRequest; - })(); - - v1.RestoreClusterRequest = (function() { - - /** - * Properties of a RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IRestoreClusterRequest - * @property {google.cloud.alloydb.v1.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource - * @property {google.cloud.alloydb.v1.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource - * @property {string|null} [parent] RestoreClusterRequest parent - * @property {string|null} [clusterId] RestoreClusterRequest clusterId - * @property {google.cloud.alloydb.v1.ICluster|null} [cluster] RestoreClusterRequest cluster - * @property {string|null} [requestId] RestoreClusterRequest requestId - * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly - */ - - /** - * Constructs a new RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set - */ - function RestoreClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreClusterRequest backupSource. - * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.backupSource = null; - - /** - * RestoreClusterRequest continuousBackupSource. - * @member {google.cloud.alloydb.v1.IContinuousBackupSource|null|undefined} continuousBackupSource - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.continuousBackupSource = null; - - /** - * RestoreClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.parent = ""; - - /** - * RestoreClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.clusterId = ""; - - /** - * RestoreClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.cluster = null; - - /** - * RestoreClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.requestId = ""; - - /** - * RestoreClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreClusterRequest source. - * @member {"backupSource"|"continuousBackupSource"|undefined} source - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest instance - */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); - }; - - /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) - $root.google.cloud.alloydb.v1.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.decode(reader, reader.uint32()); - break; - } - case 8: { - message.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1.ContinuousBackupSource.verify(message.continuousBackupSource); - if (error) - return "continuousBackupSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest - */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestoreClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.RestoreClusterRequest(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1.BackupSource.fromObject(object.backupSource); - } - if (object.continuousBackupSource != null) { - if (typeof object.continuousBackupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.continuousBackupSource: object expected"); - message.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.fromObject(object.continuousBackupSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1.RestoreClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1.RestoreClusterRequest} message RestoreClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1.Cluster.toObject(message.cluster, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - object.continuousBackupSource = $root.google.cloud.alloydb.v1.ContinuousBackupSource.toObject(message.continuousBackupSource, options); - if (options.oneofs) - object.source = "continuousBackupSource"; - } - return object; - }; - - /** - * Converts this RestoreClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreClusterRequest"; - }; - - return RestoreClusterRequest; - })(); - - v1.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set - */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.filter = ""; - - /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v1.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.ListInstancesResponse} message ListInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v1.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1.InstanceView|null} [view] GetInstanceRequest view - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * GetInstanceRequest view. - * @member {google.cloud.alloydb.v1.InstanceView} view - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.view = 0; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "INSTANCE_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "INSTANCE_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "INSTANCE_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.GetInstanceRequest} message GetInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1.InstanceView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v1.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [requestId] CreateInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * CreateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.requestId = ""; - - /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v1.CreateSecondaryInstanceRequest = (function() { - - /** - * Properties of a CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateSecondaryInstanceRequest - * @property {string|null} [parent] CreateSecondaryInstanceRequest parent - * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId - * @property {google.cloud.alloydb.v1.IInstance|null} [instance] CreateSecondaryInstanceRequest instance - * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateSecondaryInstanceRequest. - * @implements ICreateSecondaryInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set - */ - function CreateSecondaryInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecondaryInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.parent = ""; - - /** - * CreateSecondaryInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.instanceId = ""; - - /** - * CreateSecondaryInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.instance = null; - - /** - * CreateSecondaryInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.requestId = ""; - - /** - * CreateSecondaryInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance - */ - CreateSecondaryInstanceRequest.create = function create(properties) { - return new CreateSecondaryInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecondaryInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - */ - CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateSecondaryInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecondaryInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryInstanceRequest"; - }; - - return CreateSecondaryInstanceRequest; - })(); - - v1.CreateInstanceRequests = (function() { - - /** - * Properties of a CreateInstanceRequests. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests - */ - - /** - * Constructs a new CreateInstanceRequests. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests - * @constructor - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set - */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @instance - */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; - - /** - * Creates a new CreateInstanceRequests instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests instance - */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); - }; - - /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequests.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createInstanceRequests != null && message.createInstanceRequests.length) - for (var i = 0; i < message.createInstanceRequests.length; ++i) - $root.google.cloud.alloydb.v1.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequests.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.createInstanceRequests && message.createInstanceRequests.length)) - message.createInstanceRequests = []; - message.createInstanceRequests.push($root.google.cloud.alloydb.v1.CreateInstanceRequest.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequests message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequests.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { - if (!Array.isArray(message.createInstanceRequests)) - return "createInstanceRequests: array expected"; - for (var i = 0; i < message.createInstanceRequests.length; ++i) { - var error = $root.google.cloud.alloydb.v1.CreateInstanceRequest.verify(message.createInstanceRequests[i]); - if (error) - return "createInstanceRequests." + error; - } - } - return null; - }; - - /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests - */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequests) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequests(); - if (object.createInstanceRequests) { - if (!Array.isArray(object.createInstanceRequests)) - throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: array expected"); - message.createInstanceRequests = []; - for (var i = 0; i < object.createInstanceRequests.length; ++i) { - if (typeof object.createInstanceRequests[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateInstanceRequests.createInstanceRequests: object expected"); - message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1.CreateInstanceRequests} message CreateInstanceRequests - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequests.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.createInstanceRequests = []; - if (message.createInstanceRequests && message.createInstanceRequests.length) { - object.createInstanceRequests = []; - for (var j = 0; j < message.createInstanceRequests.length; ++j) - object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); - } - return object; - }; - - /** - * Converts this CreateInstanceRequests to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequests - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequests"; - }; - - return CreateInstanceRequests; - })(); - - v1.BatchCreateInstancesRequest = (function() { - - /** - * Properties of a BatchCreateInstancesRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesRequest - * @property {string|null} [parent] BatchCreateInstancesRequest parent - * @property {google.cloud.alloydb.v1.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests - * @property {string|null} [requestId] BatchCreateInstancesRequest requestId - */ - - /** - * Constructs a new BatchCreateInstancesRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set - */ - function BatchCreateInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.parent = ""; - - /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.requests = null; - - /** - * BatchCreateInstancesRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.requestId = ""; - - /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance - */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.alloydb.v1.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.alloydb.v1.CreateInstanceRequests.verify(message.requests); - if (error) - return "requests." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest - */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesRequest.requests: object expected"); - message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.fromObject(object.requests); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesRequest} message BatchCreateInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requests = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.toObject(message.requests, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this BatchCreateInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesRequest"; - }; - - return BatchCreateInstancesRequest; - })(); - - v1.BatchCreateInstancesResponse = (function() { - - /** - * Properties of a BatchCreateInstancesResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances - */ - - /** - * Constructs a new BatchCreateInstancesResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set - */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @instance - */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance - */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse - */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesResponse} message BatchCreateInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1.Instance.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesResponse"; - }; - - return BatchCreateInstancesResponse; - })(); - - v1.BatchCreateInstancesMetadata = (function() { - - /** - * Properties of a BatchCreateInstancesMetadata. - * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses - */ - - /** - * Constructs a new BatchCreateInstancesMetadata. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata - * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set - */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @instance - */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; - - /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @instance - */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; - - /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance - */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceTargets != null && message.instanceTargets.length) - for (var i = 0; i < message.instanceTargets.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); - if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) - for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); - break; - } - case 2: { - if (message.instanceStatuses === $util.emptyObject) - message.instanceStatuses = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.instanceStatuses[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { - if (!Array.isArray(message.instanceTargets)) - return "instanceTargets: array expected"; - for (var i = 0; i < message.instanceTargets.length; ++i) - if (!$util.isString(message.instanceTargets[i])) - return "instanceTargets: string[] expected"; - } - if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { - if (!$util.isObject(message.instanceStatuses)) - return "instanceStatuses: object expected"; - var key = Object.keys(message.instanceStatuses); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); - if (error) - return "instanceStatuses." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata(); - if (object.instanceTargets) { - if (!Array.isArray(object.instanceTargets)) - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceTargets: array expected"); - message.instanceTargets = []; - for (var i = 0; i < object.instanceTargets.length; ++i) - message.instanceTargets[i] = String(object.instanceTargets[i]); - } - if (object.instanceStatuses) { - if (typeof object.instanceStatuses !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses = {}; - for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { - if (typeof object.instanceStatuses[keys[i]] !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instanceTargets = []; - if (options.objects || options.defaults) - object.instanceStatuses = {}; - if (message.instanceTargets && message.instanceTargets.length) { - object.instanceTargets = []; - for (var j = 0; j < message.instanceTargets.length; ++j) - object.instanceTargets[j] = message.instanceTargets[j]; - } - var keys2; - if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { - object.instanceStatuses = {}; - for (var j = 0; j < keys2.length; ++j) - object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); - } - return object; - }; - - /** - * Converts this BatchCreateInstancesMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesMetadata"; - }; - - return BatchCreateInstancesMetadata; - })(); - - v1.BatchCreateInstanceStatus = (function() { - - /** - * Properties of a BatchCreateInstanceStatus. - * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstanceStatus - * @property {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state - * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg - * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error - * @property {google.cloud.alloydb.v1.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type - */ - - /** - * Constructs a new BatchCreateInstanceStatus. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus - * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set - */ - function BatchCreateInstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstanceStatus state. - * @member {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State} state - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.state = 0; - - /** - * BatchCreateInstanceStatus errorMsg. - * @member {string} errorMsg - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; - - /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.error = null; - - /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.type = 0; - - /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance - */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); - }; - - /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstanceStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.errorMsg = reader.string(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstanceStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - if (!$util.isString(message.errorMsg)) - return "errorMsg: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus - */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus) - return object; - var message = new $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING_CREATE": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "ROLLED_BACK": - case 6: - message.state = 6; - break; - } - if (object.errorMsg != null) - message.errorMsg = String(object.errorMsg); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.alloydb.v1.BatchCreateInstanceStatus.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "READ_POOL": - case 2: - message.type = 2; - break; - case "SECONDARY": - case 3: - message.type = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstanceStatus} message BatchCreateInstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.errorMsg = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.error = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus.State[message.state] : message.state; - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - object.errorMsg = message.errorMsg; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1.Instance.InstanceType[message.type] : message.type; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - return object; - }; - - /** - * Converts this BatchCreateInstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstanceStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstanceStatus"; - }; - - /** - * State enum. - * @name google.cloud.alloydb.v1.BatchCreateInstanceStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING_CREATE=1 PENDING_CREATE value - * @property {number} READY=2 READY value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} FAILED=5 FAILED value - * @property {number} ROLLED_BACK=6 ROLLED_BACK value - */ - BatchCreateInstanceStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_CREATE"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "ROLLED_BACK"] = 6; - return values; - })(); - - return BatchCreateInstanceStatus; - })(); - - v1.UpdateInstanceRequest = (function() { - - /** - * Properties of an UpdateInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.alloydb.v1.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {string|null} [requestId] UpdateInstanceRequest requestId - * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing - */ - - /** - * Constructs a new UpdateInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set - */ - function UpdateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.updateMask = null; - - /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.instance = null; - - /** - * UpdateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.requestId = ""; - - /** - * UpdateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.validateOnly = false; - - /** - * UpdateInstanceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest instance - */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest - */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.UpdateInstanceRequest} message UpdateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateInstanceRequest"; - }; - - return UpdateInstanceRequest; - })(); - - v1.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {string|null} [requestId] DeleteInstanceRequest requestId - * @property {string|null} [etag] DeleteInstanceRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * DeleteInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.requestId = ""; - - /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.etag = ""; - - /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v1.FailoverInstanceRequest = (function() { - - /** - * Properties of a FailoverInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IFailoverInstanceRequest - * @property {string|null} [name] FailoverInstanceRequest name - * @property {string|null} [requestId] FailoverInstanceRequest requestId - * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly - */ - - /** - * Constructs a new FailoverInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set - */ - function FailoverInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FailoverInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.name = ""; - - /** - * FailoverInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.requestId = ""; - - /** - * FailoverInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest instance - */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); - }; - - /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FailoverInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FailoverInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FailoverInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FailoverInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest - */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.FailoverInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.FailoverInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.FailoverInstanceRequest} message FailoverInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FailoverInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this FailoverInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FailoverInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.FailoverInstanceRequest"; - }; - - return FailoverInstanceRequest; - })(); - - v1.InjectFaultRequest = (function() { - - /** - * Properties of an InjectFaultRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IInjectFaultRequest - * @property {google.cloud.alloydb.v1.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType - * @property {string|null} [name] InjectFaultRequest name - * @property {string|null} [requestId] InjectFaultRequest requestId - * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly - */ - - /** - * Constructs a new InjectFaultRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an InjectFaultRequest. - * @implements IInjectFaultRequest - * @constructor - * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set - */ - function InjectFaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InjectFaultRequest faultType. - * @member {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} faultType - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.faultType = 0; - - /** - * InjectFaultRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.name = ""; - - /** - * InjectFaultRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.requestId = ""; - - /** - * InjectFaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.validateOnly = false; - - /** - * Creates a new InjectFaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest instance - */ - InjectFaultRequest.create = function create(properties) { - return new InjectFaultRequest(properties); - }; - - /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InjectFaultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InjectFaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.InjectFaultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.faultType = reader.int32(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InjectFaultRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InjectFaultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.faultType != null && message.hasOwnProperty("faultType")) - switch (message.faultType) { - default: - return "faultType: enum value expected"; - case 0: - case 1: - break; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest - */ - InjectFaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.InjectFaultRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.InjectFaultRequest(); - switch (object.faultType) { - default: - if (typeof object.faultType === "number") { - message.faultType = object.faultType; - break; - } - break; - case "FAULT_TYPE_UNSPECIFIED": - case 0: - message.faultType = 0; - break; - case "STOP_VM": - case 1: - message.faultType = 1; - break; - } - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1.InjectFaultRequest} message InjectFaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InjectFaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.faultType != null && message.hasOwnProperty("faultType")) - object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1.InjectFaultRequest.FaultType[message.faultType] : message.faultType; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this InjectFaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @instance - * @returns {Object.} JSON object - */ - InjectFaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InjectFaultRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.InjectFaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.InjectFaultRequest"; - }; - - /** - * FaultType enum. - * @name google.cloud.alloydb.v1.InjectFaultRequest.FaultType - * @enum {number} - * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value - * @property {number} STOP_VM=1 STOP_VM value - */ - InjectFaultRequest.FaultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STOP_VM"] = 1; - return values; - })(); - - return InjectFaultRequest; - })(); - - v1.RestartInstanceRequest = (function() { - - /** - * Properties of a RestartInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IRestartInstanceRequest - * @property {string|null} [name] RestartInstanceRequest name - * @property {string|null} [requestId] RestartInstanceRequest requestId - * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly - * @property {Array.|null} [nodeIds] RestartInstanceRequest nodeIds - */ - - /** - * Constructs a new RestartInstanceRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set - */ - function RestartInstanceRequest(properties) { - this.nodeIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.name = ""; - - /** - * RestartInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.requestId = ""; - - /** - * RestartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.validateOnly = false; - - /** - * RestartInstanceRequest nodeIds. - * @member {Array.} nodeIds - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest instance - */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); - }; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.nodeIds != null && message.nodeIds.length) - for (var i = 0; i < message.nodeIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeIds[i]); - return writer; - }; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestartInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestartInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { - if (!Array.isArray(message.nodeIds)) - return "nodeIds: array expected"; - for (var i = 0; i < message.nodeIds.length; ++i) - if (!$util.isString(message.nodeIds[i])) - return "nodeIds: string[] expected"; - } - return null; - }; - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest - */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestartInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.RestartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.nodeIds) { - if (!Array.isArray(object.nodeIds)) - throw TypeError(".google.cloud.alloydb.v1.RestartInstanceRequest.nodeIds: array expected"); - message.nodeIds = []; - for (var i = 0; i < object.nodeIds.length; ++i) - message.nodeIds[i] = String(object.nodeIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1.RestartInstanceRequest} message RestartInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestartInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodeIds = []; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.nodeIds && message.nodeIds.length) { - object.nodeIds = []; - for (var j = 0; j < message.nodeIds.length; ++j) - object.nodeIds[j] = message.nodeIds[j]; - } - return object; - }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestartInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestartInstanceRequest"; - }; - - return RestartInstanceRequest; - })(); - - v1.ExecuteSqlRequest = (function() { - - /** - * Properties of an ExecuteSqlRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IExecuteSqlRequest - * @property {string|null} [password] ExecuteSqlRequest password - * @property {string|null} [instance] ExecuteSqlRequest instance - * @property {string|null} [database] ExecuteSqlRequest database - * @property {string|null} [user] ExecuteSqlRequest user - * @property {string|null} [sqlStatement] ExecuteSqlRequest sqlStatement - * @property {boolean|null} [validateOnly] ExecuteSqlRequest validateOnly - */ - - /** - * Constructs a new ExecuteSqlRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ExecuteSqlRequest. - * @implements IExecuteSqlRequest - * @constructor - * @param {google.cloud.alloydb.v1.IExecuteSqlRequest=} [properties] Properties to set - */ - function ExecuteSqlRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlRequest password. - * @member {string|null|undefined} password - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.password = null; - - /** - * ExecuteSqlRequest instance. - * @member {string} instance - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.instance = ""; - - /** - * ExecuteSqlRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.database = ""; - - /** - * ExecuteSqlRequest user. - * @member {string} user - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.user = ""; - - /** - * ExecuteSqlRequest sqlStatement. - * @member {string} sqlStatement - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.sqlStatement = ""; - - /** - * ExecuteSqlRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteSqlRequest userCredential. - * @member {"password"|undefined} userCredential - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - */ - Object.defineProperty(ExecuteSqlRequest.prototype, "userCredential", { - get: $util.oneOfGetter($oneOfFields = ["password"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest instance - */ - ExecuteSqlRequest.create = function create(properties) { - return new ExecuteSqlRequest(properties); - }; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); - if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlStatement); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.password); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExecuteSqlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.password = reader.string(); - break; - } - case 1: { - message.instance = reader.string(); - break; - } - case 2: { - message.database = reader.string(); - break; - } - case 3: { - message.user = reader.string(); - break; - } - case 4: { - message.sqlStatement = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.password != null && message.hasOwnProperty("password")) { - properties.userCredential = 1; - if (!$util.isString(message.password)) - return "password: string expected"; - } - if (message.instance != null && message.hasOwnProperty("instance")) - if (!$util.isString(message.instance)) - return "instance: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) - if (!$util.isString(message.sqlStatement)) - return "sqlStatement: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest - */ - ExecuteSqlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ExecuteSqlRequest(); - if (object.password != null) - message.password = String(object.password); - if (object.instance != null) - message.instance = String(object.instance); - if (object.database != null) - message.database = String(object.database); - if (object.user != null) - message.user = String(object.user); - if (object.sqlStatement != null) - message.sqlStatement = String(object.sqlStatement); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1.ExecuteSqlRequest} message ExecuteSqlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = ""; - object.database = ""; - object.user = ""; - object.sqlStatement = ""; - object.validateOnly = false; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = message.instance; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) - object.sqlStatement = message.sqlStatement; - if (message.password != null && message.hasOwnProperty("password")) { - object.password = message.password; - if (options.oneofs) - object.userCredential = "password"; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlRequest"; - }; - - return ExecuteSqlRequest; - })(); - - v1.ExecuteSqlResponse = (function() { - - /** - * Properties of an ExecuteSqlResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IExecuteSqlResponse - * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults - * @property {google.cloud.alloydb.v1.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata - */ - - /** - * Constructs a new ExecuteSqlResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ExecuteSqlResponse. - * @implements IExecuteSqlResponse - * @constructor - * @param {google.cloud.alloydb.v1.IExecuteSqlResponse=} [properties] Properties to set - */ - function ExecuteSqlResponse(properties) { - this.sqlResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlResponse sqlResults. - * @member {Array.} sqlResults - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @instance - */ - ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; - - /** - * ExecuteSqlResponse metadata. - * @member {google.cloud.alloydb.v1.IExecuteSqlMetadata|null|undefined} metadata - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @instance - */ - ExecuteSqlResponse.prototype.metadata = null; - - /** - * Creates a new ExecuteSqlResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse instance - */ - ExecuteSqlResponse.create = function create(properties) { - return new ExecuteSqlResponse(properties); - }; - - /** - * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sqlResults != null && message.sqlResults.length) - for (var i = 0; i < message.sqlResults.length; ++i) - $root.google.cloud.alloydb.v1.SqlResult.encode(message.sqlResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExecuteSqlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sqlResults && message.sqlResults.length)) - message.sqlResults = []; - message.sqlResults.push($root.google.cloud.alloydb.v1.SqlResult.decode(reader, reader.uint32())); - break; - } - case 3: { - message.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sqlResults != null && message.hasOwnProperty("sqlResults")) { - if (!Array.isArray(message.sqlResults)) - return "sqlResults: array expected"; - for (var i = 0; i < message.sqlResults.length; ++i) { - var error = $root.google.cloud.alloydb.v1.SqlResult.verify(message.sqlResults[i]); - if (error) - return "sqlResults." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse - */ - ExecuteSqlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ExecuteSqlResponse(); - if (object.sqlResults) { - if (!Array.isArray(object.sqlResults)) - throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlResponse.sqlResults: array expected"); - message.sqlResults = []; - for (var i = 0; i < object.sqlResults.length; ++i) { - if (typeof object.sqlResults[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlResponse.sqlResults: object expected"); - message.sqlResults[i] = $root.google.cloud.alloydb.v1.SqlResult.fromObject(object.sqlResults[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlResponse.metadata: object expected"); - message.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1.ExecuteSqlResponse} message ExecuteSqlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sqlResults = []; - if (options.defaults) - object.metadata = null; - if (message.sqlResults && message.sqlResults.length) { - object.sqlResults = []; - for (var j = 0; j < message.sqlResults.length; ++j) - object.sqlResults[j] = $root.google.cloud.alloydb.v1.SqlResult.toObject(message.sqlResults[j], options); - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this ExecuteSqlResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlResponse"; - }; - - return ExecuteSqlResponse; - })(); - - v1.ExecuteSqlMetadata = (function() { - - /** - * Properties of an ExecuteSqlMetadata. - * @memberof google.cloud.alloydb.v1 - * @interface IExecuteSqlMetadata - * @property {string|null} [message] ExecuteSqlMetadata message - * @property {boolean|null} [partialResult] ExecuteSqlMetadata partialResult - * @property {google.protobuf.IDuration|null} [sqlStatementExecutionDuration] ExecuteSqlMetadata sqlStatementExecutionDuration - * @property {google.cloud.alloydb.v1.ExecuteSqlMetadata.Status|null} [status] ExecuteSqlMetadata status - */ - - /** - * Constructs a new ExecuteSqlMetadata. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an ExecuteSqlMetadata. - * @implements IExecuteSqlMetadata - * @constructor - * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata=} [properties] Properties to set - */ - function ExecuteSqlMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlMetadata message. - * @member {string} message - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.message = ""; - - /** - * ExecuteSqlMetadata partialResult. - * @member {boolean} partialResult - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.partialResult = false; - - /** - * ExecuteSqlMetadata sqlStatementExecutionDuration. - * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; - - /** - * ExecuteSqlMetadata status. - * @member {google.cloud.alloydb.v1.ExecuteSqlMetadata.Status} status - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.status = 0; - - /** - * Creates a new ExecuteSqlMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata instance - */ - ExecuteSqlMetadata.create = function create(properties) { - return new ExecuteSqlMetadata(properties); - }; - - /** - * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialResult); - if (message.sqlStatementExecutionDuration != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionDuration")) - $root.google.protobuf.Duration.encode(message.sqlStatementExecutionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ExecuteSqlMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.message = reader.string(); - break; - } - case 2: { - message.partialResult = reader.bool(); - break; - } - case 3: { - message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.status = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) - if (typeof message.partialResult !== "boolean") - return "partialResult: boolean expected"; - if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionDuration); - if (error) - return "sqlStatementExecutionDuration." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata - */ - ExecuteSqlMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1.ExecuteSqlMetadata(); - if (object.message != null) - message.message = String(object.message); - if (object.partialResult != null) - message.partialResult = Boolean(object.partialResult); - if (object.sqlStatementExecutionDuration != null) { - if (typeof object.sqlStatementExecutionDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1.ExecuteSqlMetadata.sqlStatementExecutionDuration: object expected"); - message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionDuration); - } - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "OK": - case 1: - message.status = 1; - break; - case "PARTIAL": - case 2: - message.status = 2; - break; - case "ERROR": - case 3: - message.status = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1.ExecuteSqlMetadata} message ExecuteSqlMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.message = ""; - object.partialResult = false; - object.sqlStatementExecutionDuration = null; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - } - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) - object.partialResult = message.partialResult; - if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) - object.sqlStatementExecutionDuration = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionDuration, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.Status[message.status] : message.status; - return object; - }; - - /** - * Converts this ExecuteSqlMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlMetadata"; - }; - - /** - * Status enum. - * @name google.cloud.alloydb.v1.ExecuteSqlMetadata.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} OK=1 OK value - * @property {number} PARTIAL=2 PARTIAL value - * @property {number} ERROR=3 ERROR value - */ - ExecuteSqlMetadata.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "OK"] = 1; - values[valuesById[2] = "PARTIAL"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return ExecuteSqlMetadata; - })(); - - v1.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest instance - */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); - }; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListBackupsRequest} ListBackupsRequest - */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ListBackupsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1.ListBackupsRequest} message ListBackupsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListBackupsRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListBackupsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsRequest"; - }; - - return ListBackupsRequest; - })(); - - v1.ListBackupsResponse = (function() { - - /** - * Properties of a ListBackupsResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable - */ - - /** - * Constructs a new ListBackupsResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse - * @constructor - * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set - */ - function ListBackupsResponse(properties) { - this.backups = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse instance - */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); - }; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.alloydb.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListBackupsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListBackupsResponse} ListBackupsResponse - */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListBackupsResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListBackupsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1.ListBackupsResponse} message ListBackupsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.alloydb.v1.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListBackupsResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListBackupsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListBackupsResponse"; - }; - - return ListBackupsResponse; - })(); - - v1.GetBackupRequest = (function() { - - /** - * Properties of a GetBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name - */ - - /** - * Constructs a new GetBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set - */ - function GetBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.name = ""; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest instance - */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); - }; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetBackupRequest} GetBackupRequest - */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1.GetBackupRequest} message GetBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetBackupRequest"; - }; - - return GetBackupRequest; - })(); - - v1.CreateBackupRequest = (function() { - - /** - * Properties of a CreateBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.cloud.alloydb.v1.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [requestId] CreateBackupRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly - */ - - /** - * Constructs a new CreateBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set - */ - function CreateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backup = null; - - /** - * CreateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.requestId = ""; - - /** - * CreateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest instance - */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); - }; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateBackupRequest} CreateBackupRequest - */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.CreateBackupRequest} message CreateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateBackupRequest"; - }; - - return CreateBackupRequest; - })(); - - v1.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.alloydb.v1.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing - */ - - /** - * Constructs a new UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * UpdateBackupRequest backup. - * @member {google.cloud.alloydb.v1.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.requestId = ""; - - /** - * UpdateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.validateOnly = false; - - /** - * UpdateBackupRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest instance - */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.backup = $root.google.cloud.alloydb.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateBackupRequest} UpdateBackupRequest - */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1.UpdateBackupRequest} message UpdateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateBackupRequest"; - }; - - return UpdateBackupRequest; - })(); - - v1.DeleteBackupRequest = (function() { - - /** - * Properties of a DeleteBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly - * @property {string|null} [etag] DeleteBackupRequest etag - */ - - /** - * Constructs a new DeleteBackupRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set - */ - function DeleteBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.requestId = ""; - - /** - * DeleteBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.validateOnly = false; - - /** - * DeleteBackupRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.etag = ""; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest instance - */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteBackupRequest} DeleteBackupRequest - */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteBackupRequest"; - }; - - return DeleteBackupRequest; - })(); - - v1.ListSupportedDatabaseFlagsRequest = (function() { - - /** - * Properties of a ListSupportedDatabaseFlagsRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListSupportedDatabaseFlagsRequest - * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent - * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize - * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken - * @property {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope|null} [scope] ListSupportedDatabaseFlagsRequest scope - */ - - /** - * Constructs a new ListSupportedDatabaseFlagsRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListSupportedDatabaseFlagsRequest. - * @implements IListSupportedDatabaseFlagsRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - */ - function ListSupportedDatabaseFlagsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSupportedDatabaseFlagsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.parent = ""; - - /** - * ListSupportedDatabaseFlagsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; - - /** - * ListSupportedDatabaseFlagsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; - - /** - * ListSupportedDatabaseFlagsRequest scope. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} scope - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.scope = 0; - - /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance - */ - ListSupportedDatabaseFlagsRequest.create = function create(properties) { - return new ListSupportedDatabaseFlagsRequest(properties); - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); - return writer; - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 6: { - message.scope = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSupportedDatabaseFlagsRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSupportedDatabaseFlagsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - */ - ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "DATABASE": - case 1: - message.scope = 1; - break; - case "CONNECTION_POOL": - case 2: - message.scope = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope[message.scope] : message.scope; - return object; - }; - - /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest"; - }; - - return ListSupportedDatabaseFlagsRequest; - })(); - - v1.ListSupportedDatabaseFlagsResponse = (function() { - - /** - * Properties of a ListSupportedDatabaseFlagsResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IListSupportedDatabaseFlagsResponse - * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags - * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken - */ - - /** - * Constructs a new ListSupportedDatabaseFlagsResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListSupportedDatabaseFlagsResponse. - * @implements IListSupportedDatabaseFlagsResponse - * @constructor - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - */ - function ListSupportedDatabaseFlagsResponse(properties) { - this.supportedDatabaseFlags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. - * @member {Array.} supportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; - - /** - * ListSupportedDatabaseFlagsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance - */ - ListSupportedDatabaseFlagsResponse.create = function create(properties) { - return new ListSupportedDatabaseFlagsResponse(properties); - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) - $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) - message.supportedDatabaseFlags = []; - message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1.SupportedDatabaseFlag.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSupportedDatabaseFlagsResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSupportedDatabaseFlagsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { - if (!Array.isArray(message.supportedDatabaseFlags)) - return "supportedDatabaseFlags: array expected"; - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { - var error = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); - if (error) - return "supportedDatabaseFlags." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - */ - ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse(); - if (object.supportedDatabaseFlags) { - if (!Array.isArray(object.supportedDatabaseFlags)) - throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); - message.supportedDatabaseFlags = []; - for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { - if (typeof object.supportedDatabaseFlags[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); - message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDatabaseFlags = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { - object.supportedDatabaseFlags = []; - for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) - object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse"; - }; - - return ListSupportedDatabaseFlagsResponse; - })(); - - v1.GenerateClientCertificateRequest = (function() { - - /** - * Properties of a GenerateClientCertificateRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGenerateClientCertificateRequest - * @property {string|null} [parent] GenerateClientCertificateRequest parent - * @property {string|null} [requestId] GenerateClientCertificateRequest requestId - * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration - * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey - * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange - */ - - /** - * Constructs a new GenerateClientCertificateRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GenerateClientCertificateRequest. - * @implements IGenerateClientCertificateRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest=} [properties] Properties to set - */ - function GenerateClientCertificateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateClientCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.parent = ""; - - /** - * GenerateClientCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.requestId = ""; - - /** - * GenerateClientCertificateRequest certDuration. - * @member {google.protobuf.IDuration|null|undefined} certDuration - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.certDuration = null; - - /** - * GenerateClientCertificateRequest publicKey. - * @member {string} publicKey - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.publicKey = ""; - - /** - * GenerateClientCertificateRequest useMetadataExchange. - * @member {boolean} useMetadataExchange - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.useMetadataExchange = false; - - /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance - */ - GenerateClientCertificateRequest.create = function create(properties) { - return new GenerateClientCertificateRequest(properties); - }; - - /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) - $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); - if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); - return writer; - }; - - /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 4: { - message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.publicKey = reader.string(); - break; - } - case 6: { - message.useMetadataExchange = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateClientCertificateRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateClientCertificateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) { - var error = $root.google.protobuf.Duration.verify(message.certDuration); - if (error) - return "certDuration." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!$util.isString(message.publicKey)) - return "publicKey: string expected"; - if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) - if (typeof message.useMetadataExchange !== "boolean") - return "useMetadataExchange: boolean expected"; - return null; - }; - - /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateRequest} GenerateClientCertificateRequest - */ - GenerateClientCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.certDuration != null) { - if (typeof object.certDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1.GenerateClientCertificateRequest.certDuration: object expected"); - message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); - } - if (object.publicKey != null) - message.publicKey = String(object.publicKey); - if (object.useMetadataExchange != null) - message.useMetadataExchange = Boolean(object.useMetadataExchange); - return message; - }; - - /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1.GenerateClientCertificateRequest} message GenerateClientCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateClientCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - object.certDuration = null; - object.publicKey = ""; - object.useMetadataExchange = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) - object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = message.publicKey; - if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) - object.useMetadataExchange = message.useMetadataExchange; - return object; - }; - - /** - * Converts this GenerateClientCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateClientCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GenerateClientCertificateRequest"; - }; - - return GenerateClientCertificateRequest; - })(); - - v1.GenerateClientCertificateResponse = (function() { - - /** - * Properties of a GenerateClientCertificateResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IGenerateClientCertificateResponse - * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain - * @property {string|null} [caCert] GenerateClientCertificateResponse caCert - */ - - /** - * Constructs a new GenerateClientCertificateResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GenerateClientCertificateResponse. - * @implements IGenerateClientCertificateResponse - * @constructor - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse=} [properties] Properties to set - */ - function GenerateClientCertificateResponse(properties) { - this.pemCertificateChain = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateClientCertificateResponse pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; - - /** - * GenerateClientCertificateResponse caCert. - * @member {string} caCert - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.caCert = ""; - - /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance - */ - GenerateClientCertificateResponse.create = function create(properties) { - return new GenerateClientCertificateResponse(properties); - }; - - /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); - if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); - return writer; - }; - - /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GenerateClientCertificateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 3: { - message.caCert = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateClientCertificateResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateClientCertificateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.caCert != null && message.hasOwnProperty("caCert")) - if (!$util.isString(message.caCert)) - return "caCert: string expected"; - return null; - }; - - /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GenerateClientCertificateResponse} GenerateClientCertificateResponse - */ - GenerateClientCertificateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.GenerateClientCertificateResponse(); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1.GenerateClientCertificateResponse.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.caCert != null) - message.caCert = String(object.caCert); - return message; - }; - - /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1.GenerateClientCertificateResponse} message GenerateClientCertificateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateClientCertificateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) - object.caCert = ""; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.caCert != null && message.hasOwnProperty("caCert")) - object.caCert = message.caCert; - return object; - }; - - /** - * Converts this GenerateClientCertificateResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @instance - * @returns {Object.} JSON object - */ - GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateClientCertificateResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GenerateClientCertificateResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GenerateClientCertificateResponse"; - }; - - return GenerateClientCertificateResponse; - })(); - - v1.GetConnectionInfoRequest = (function() { - - /** - * Properties of a GetConnectionInfoRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGetConnectionInfoRequest - * @property {string|null} [parent] GetConnectionInfoRequest parent - * @property {string|null} [requestId] GetConnectionInfoRequest requestId - */ - - /** - * Constructs a new GetConnectionInfoRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetConnectionInfoRequest. - * @implements IGetConnectionInfoRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest=} [properties] Properties to set - */ - function GetConnectionInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConnectionInfoRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @instance - */ - GetConnectionInfoRequest.prototype.parent = ""; - - /** - * GetConnectionInfoRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @instance - */ - GetConnectionInfoRequest.prototype.requestId = ""; - - /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest instance - */ - GetConnectionInfoRequest.create = function create(properties) { - return new GetConnectionInfoRequest(properties); - }; - - /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConnectionInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetConnectionInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConnectionInfoRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetConnectionInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConnectionInfoRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConnectionInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetConnectionInfoRequest} GetConnectionInfoRequest - */ - GetConnectionInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetConnectionInfoRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GetConnectionInfoRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1.GetConnectionInfoRequest} message GetConnectionInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConnectionInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this GetConnectionInfoRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetConnectionInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetConnectionInfoRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetConnectionInfoRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetConnectionInfoRequest"; - }; - - return GetConnectionInfoRequest; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.alloydb.v1 - * @interface IOperationMetadata - * @property {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata - * @property {google.cloud.alloydb.v1.IUpgradeClusterStatus|null} [upgradeClusterStatus] OperationMetadata upgradeClusterStatus - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata batchCreateInstancesMetadata. - * @member {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.batchCreateInstancesMetadata = null; - - /** - * OperationMetadata upgradeClusterStatus. - * @member {google.cloud.alloydb.v1.IUpgradeClusterStatus|null|undefined} upgradeClusterStatus - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.upgradeClusterStatus = null; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OperationMetadata requestSpecific. - * @member {"batchCreateInstancesMetadata"|"upgradeClusterStatus"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata", "upgradeClusterStatus"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) - $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.upgradeClusterStatus != null && Object.hasOwnProperty.call(message, "upgradeClusterStatus")) - $root.google.cloud.alloydb.v1.UpgradeClusterStatus.encode(message.upgradeClusterStatus, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); - break; - } - case 10: { - message.upgradeClusterStatus = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.decode(reader, reader.uint32()); - break; - } - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); - if (error) - return "batchCreateInstancesMetadata." + error; - } - } - if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { - if (properties.requestSpecific === 1) - return "requestSpecific: multiple values"; - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.verify(message.upgradeClusterStatus); - if (error) - return "upgradeClusterStatus." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1.OperationMetadata(); - if (object.batchCreateInstancesMetadata != null) { - if (typeof object.batchCreateInstancesMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.batchCreateInstancesMetadata: object expected"); - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); - } - if (object.upgradeClusterStatus != null) { - if (typeof object.upgradeClusterStatus !== "object") - throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.upgradeClusterStatus: object expected"); - message.upgradeClusterStatus = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.fromObject(object.upgradeClusterStatus); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); - if (options.oneofs) - object.requestSpecific = "batchCreateInstancesMetadata"; - } - if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { - object.upgradeClusterStatus = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.toObject(message.upgradeClusterStatus, options); - if (options.oneofs) - object.requestSpecific = "upgradeClusterStatus"; - } - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.UpgradeClusterStatus = (function() { - - /** - * Properties of an UpgradeClusterStatus. - * @memberof google.cloud.alloydb.v1 - * @interface IUpgradeClusterStatus - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [state] UpgradeClusterStatus state - * @property {boolean|null} [cancellable] UpgradeClusterStatus cancellable - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [sourceVersion] UpgradeClusterStatus sourceVersion - * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [targetVersion] UpgradeClusterStatus targetVersion - * @property {Array.|null} [stages] UpgradeClusterStatus stages - */ - - /** - * Constructs a new UpgradeClusterStatus. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpgradeClusterStatus. - * @implements IUpgradeClusterStatus - * @constructor - * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus=} [properties] Properties to set - */ - function UpgradeClusterStatus(properties) { - this.stages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterStatus state. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} state - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.state = 0; - - /** - * UpgradeClusterStatus cancellable. - * @member {boolean} cancellable - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.cancellable = false; - - /** - * UpgradeClusterStatus sourceVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} sourceVersion - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.sourceVersion = 0; - - /** - * UpgradeClusterStatus targetVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} targetVersion - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.targetVersion = 0; - - /** - * UpgradeClusterStatus stages. - * @member {Array.} stages - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.stages = $util.emptyArray; - - /** - * Creates a new UpgradeClusterStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus instance - */ - UpgradeClusterStatus.create = function create(properties) { - return new UpgradeClusterStatus(properties); - }; - - /** - * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.cancellable != null && Object.hasOwnProperty.call(message, "cancellable")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cancellable); - if (message.sourceVersion != null && Object.hasOwnProperty.call(message, "sourceVersion")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceVersion); - if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.targetVersion); - if (message.stages != null && message.stages.length) - for (var i = 0; i < message.stages.length; ++i) - $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.cancellable = reader.bool(); - break; - } - case 3: { - message.sourceVersion = reader.int32(); - break; - } - case 4: { - message.targetVersion = reader.int32(); - break; - } - case 5: { - if (!(message.stages && message.stages.length)) - message.stages = []; - message.stages.push($root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.cancellable != null && message.hasOwnProperty("cancellable")) - if (typeof message.cancellable !== "boolean") - return "cancellable: boolean expected"; - if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) - switch (message.sourceVersion) { - default: - return "sourceVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) - switch (message.targetVersion) { - default: - return "targetVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stages != null && message.hasOwnProperty("stages")) { - if (!Array.isArray(message.stages)) - return "stages: array expected"; - for (var i = 0; i < message.stages.length; ++i) { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify(message.stages[i]); - if (error) - return "stages." + error; - } - } - return null; - }; - - /** - * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus} UpgradeClusterStatus - */ - UpgradeClusterStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "IN_PROGRESS": - case 5: - message.state = 5; - break; - case "SUCCESS": - case 1: - message.state = 1; - break; - case "FAILED": - case 2: - message.state = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.state = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.cancellable != null) - message.cancellable = Boolean(object.cancellable); - switch (object.sourceVersion) { - default: - if (typeof object.sourceVersion === "number") { - message.sourceVersion = object.sourceVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.sourceVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.sourceVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.sourceVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.sourceVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.sourceVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.sourceVersion = 5; - break; - } - switch (object.targetVersion) { - default: - if (typeof object.targetVersion === "number") { - message.targetVersion = object.targetVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.targetVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.targetVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.targetVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.targetVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.targetVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.targetVersion = 5; - break; - } - if (object.stages) { - if (!Array.isArray(object.stages)) - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.stages: array expected"); - message.stages = []; - for (var i = 0; i < object.stages.length; ++i) { - if (typeof object.stages[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.stages: object expected"); - message.stages[i] = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.fromObject(object.stages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus} message UpgradeClusterStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.stages = []; - if (options.defaults) { - object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.cancellable = false; - object.sourceVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.targetVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] : message.state; - if (message.cancellable != null && message.hasOwnProperty("cancellable")) - object.cancellable = message.cancellable; - if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) - object.sourceVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.sourceVersion] === undefined ? message.sourceVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.sourceVersion] : message.sourceVersion; - if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) - object.targetVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.targetVersion] === undefined ? message.targetVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.targetVersion] : message.targetVersion; - if (message.stages && message.stages.length) { - object.stages = []; - for (var j = 0; j < message.stages.length; ++j) - object.stages[j] = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.toObject(message.stages[j], options); - } - return object; - }; - - /** - * Converts this UpgradeClusterStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus"; - }; - - UpgradeClusterStatus.StageStatus = (function() { - - /** - * Properties of a StageStatus. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @interface IStageStatus - * @property {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null} [readPoolInstancesUpgrade] StageStatus readPoolInstancesUpgrade - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage|null} [stage] StageStatus stage - * @property {google.cloud.alloydb.v1.UpgradeClusterResponse.Status|null} [state] StageStatus state - * @property {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null} [schedule] StageStatus schedule - */ - - /** - * Constructs a new StageStatus. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @classdesc Represents a StageStatus. - * @implements IStageStatus - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set - */ - function StageStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageStatus readPoolInstancesUpgrade. - * @member {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null|undefined} readPoolInstancesUpgrade - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.readPoolInstancesUpgrade = null; - - /** - * StageStatus stage. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Stage} stage - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.stage = 0; - - /** - * StageStatus state. - * @member {google.cloud.alloydb.v1.UpgradeClusterResponse.Status} state - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.state = 0; - - /** - * StageStatus schedule. - * @member {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule|null|undefined} schedule - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.schedule = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * StageStatus stageSpecificStatus. - * @member {"readPoolInstancesUpgrade"|undefined} stageSpecificStatus - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @instance - */ - Object.defineProperty(StageStatus.prototype, "stageSpecificStatus", { - get: $util.oneOfGetter($oneOfFields = ["readPoolInstancesUpgrade"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StageStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus instance - */ - StageStatus.create = function create(properties) { - return new StageStatus(properties); - }; - - /** - * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.encode(message.schedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readPoolInstancesUpgrade != null && Object.hasOwnProperty.call(message, "readPoolInstancesUpgrade")) - $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.encode(message.readPoolInstancesUpgrade, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 11: { - message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.decode(reader, reader.uint32()); - break; - } - case 1: { - message.stage = reader.int32(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.schedule = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { - properties.stageSpecificStatus = 1; - { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify(message.readPoolInstancesUpgrade); - if (error) - return "readPoolInstancesUpgrade." + error; - } - } - if (message.stage != null && message.hasOwnProperty("stage")) - switch (message.stage) { - default: - return "stage: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify(message.schedule); - if (error) - return "schedule." + error; - } - return null; - }; - - /** - * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} StageStatus - */ - StageStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus(); - if (object.readPoolInstancesUpgrade != null) { - if (typeof object.readPoolInstancesUpgrade !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.readPoolInstancesUpgrade: object expected"); - message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.fromObject(object.readPoolInstancesUpgrade); - } - switch (object.stage) { - default: - if (typeof object.stage === "number") { - message.stage = object.stage; - break; - } - break; - case "STAGE_UNSPECIFIED": - case 0: - message.stage = 0; - break; - case "ALLOYDB_PRECHECK": - case 1: - message.stage = 1; - break; - case "PG_UPGRADE_CHECK": - case 2: - message.stage = 2; - break; - case "PREPARE_FOR_UPGRADE": - case 5: - message.stage = 5; - break; - case "PRIMARY_INSTANCE_UPGRADE": - case 3: - message.stage = 3; - break; - case "READ_POOL_INSTANCES_UPGRADE": - case 4: - message.stage = 4; - break; - case "ROLLBACK": - case 6: - message.stage = 6; - break; - case "CLEANUP": - case 7: - message.stage = 7; - break; - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "IN_PROGRESS": - case 5: - message.state = 5; - break; - case "SUCCESS": - case 1: - message.state = 1; - break; - case "FAILED": - case 2: - message.state = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.state = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.schedule: object expected"); - message.schedule = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.fromObject(object.schedule); - } - return message; - }; - - /** - * Creates a plain object from a StageStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus} message StageStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.schedule = null; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Stage[message.stage] : message.stage; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1.UpgradeClusterResponse.Status[message.state] : message.state; - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.toObject(message.schedule, options); - if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { - object.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.toObject(message.readPoolInstancesUpgrade, options); - if (options.oneofs) - object.stageSpecificStatus = "readPoolInstancesUpgrade"; - } - return object; - }; - - /** - * Converts this StageStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @instance - * @returns {Object.} JSON object - */ - StageStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus"; - }; - - StageStatus.StageSchedule = (function() { - - /** - * Properties of a StageSchedule. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @interface IStageSchedule - * @property {google.protobuf.ITimestamp|null} [estimatedStartTime] StageSchedule estimatedStartTime - * @property {google.protobuf.ITimestamp|null} [actualStartTime] StageSchedule actualStartTime - * @property {google.protobuf.ITimestamp|null} [estimatedEndTime] StageSchedule estimatedEndTime - * @property {google.protobuf.ITimestamp|null} [actualEndTime] StageSchedule actualEndTime - */ - - /** - * Constructs a new StageSchedule. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus - * @classdesc Represents a StageSchedule. - * @implements IStageSchedule - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set - */ - function StageSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageSchedule estimatedStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} estimatedStartTime - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.estimatedStartTime = null; - - /** - * StageSchedule actualStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} actualStartTime - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.actualStartTime = null; - - /** - * StageSchedule estimatedEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} estimatedEndTime - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.estimatedEndTime = null; - - /** - * StageSchedule actualEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} actualEndTime - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.actualEndTime = null; - - /** - * Creates a new StageSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule instance - */ - StageSchedule.create = function create(properties) { - return new StageSchedule(properties); - }; - - /** - * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.estimatedStartTime != null && Object.hasOwnProperty.call(message, "estimatedStartTime")) - $root.google.protobuf.Timestamp.encode(message.estimatedStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.actualStartTime != null && Object.hasOwnProperty.call(message, "actualStartTime")) - $root.google.protobuf.Timestamp.encode(message.actualStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.estimatedEndTime != null && Object.hasOwnProperty.call(message, "estimatedEndTime")) - $root.google.protobuf.Timestamp.encode(message.estimatedEndTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.actualEndTime != null && Object.hasOwnProperty.call(message, "actualEndTime")) - $root.google.protobuf.Timestamp.encode(message.actualEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.estimatedStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.actualStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.estimatedEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.actualEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageSchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.estimatedStartTime); - if (error) - return "estimatedStartTime." + error; - } - if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.actualStartTime); - if (error) - return "actualStartTime." + error; - } - if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.estimatedEndTime); - if (error) - return "estimatedEndTime." + error; - } - if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.actualEndTime); - if (error) - return "actualEndTime." + error; - } - return null; - }; - - /** - * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - */ - StageSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule(); - if (object.estimatedStartTime != null) { - if (typeof object.estimatedStartTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedStartTime: object expected"); - message.estimatedStartTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedStartTime); - } - if (object.actualStartTime != null) { - if (typeof object.actualStartTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.actualStartTime: object expected"); - message.actualStartTime = $root.google.protobuf.Timestamp.fromObject(object.actualStartTime); - } - if (object.estimatedEndTime != null) { - if (typeof object.estimatedEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedEndTime: object expected"); - message.estimatedEndTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedEndTime); - } - if (object.actualEndTime != null) { - if (typeof object.actualEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule.actualEndTime: object expected"); - message.actualEndTime = $root.google.protobuf.Timestamp.fromObject(object.actualEndTime); - } - return message; - }; - - /** - * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule} message StageSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.estimatedStartTime = null; - object.actualStartTime = null; - object.estimatedEndTime = null; - object.actualEndTime = null; - } - if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) - object.estimatedStartTime = $root.google.protobuf.Timestamp.toObject(message.estimatedStartTime, options); - if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) - object.actualStartTime = $root.google.protobuf.Timestamp.toObject(message.actualStartTime, options); - if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) - object.estimatedEndTime = $root.google.protobuf.Timestamp.toObject(message.estimatedEndTime, options); - if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) - object.actualEndTime = $root.google.protobuf.Timestamp.toObject(message.actualEndTime, options); - return object; - }; - - /** - * Converts this StageSchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - * @returns {Object.} JSON object - */ - StageSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageSchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.StageStatus.StageSchedule"; - }; - - return StageSchedule; - })(); - - return StageStatus; - })(); - - UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus = (function() { - - /** - * Properties of a ReadPoolInstancesUpgradeStageStatus. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @interface IReadPoolInstancesUpgradeStageStatus - * @property {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null} [upgradeStats] ReadPoolInstancesUpgradeStageStatus upgradeStats - */ - - /** - * Constructs a new ReadPoolInstancesUpgradeStageStatus. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus - * @classdesc Represents a ReadPoolInstancesUpgradeStageStatus. - * @implements IReadPoolInstancesUpgradeStageStatus - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set - */ - function ReadPoolInstancesUpgradeStageStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadPoolInstancesUpgradeStageStatus upgradeStats. - * @member {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null|undefined} upgradeStats - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @instance - */ - ReadPoolInstancesUpgradeStageStatus.prototype.upgradeStats = null; - - /** - * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus instance - */ - ReadPoolInstancesUpgradeStageStatus.create = function create(properties) { - return new ReadPoolInstancesUpgradeStageStatus(properties); - }; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolInstancesUpgradeStageStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgradeStats != null && Object.hasOwnProperty.call(message, "upgradeStats")) - $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.encode(message.upgradeStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolInstancesUpgradeStageStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolInstancesUpgradeStageStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.upgradeStats = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolInstancesUpgradeStageStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolInstancesUpgradeStageStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolInstancesUpgradeStageStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) { - var error = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify(message.upgradeStats); - if (error) - return "upgradeStats." + error; - } - return null; - }; - - /** - * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - */ - ReadPoolInstancesUpgradeStageStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); - if (object.upgradeStats != null) { - if (typeof object.upgradeStats !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.upgradeStats: object expected"); - message.upgradeStats = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.fromObject(object.upgradeStats); - } - return message; - }; - - /** - * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolInstancesUpgradeStageStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.upgradeStats = null; - if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) - object.upgradeStats = $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.toObject(message.upgradeStats, options); - return object; - }; - - /** - * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @instance - * @returns {Object.} JSON object - */ - ReadPoolInstancesUpgradeStageStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolInstancesUpgradeStageStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolInstancesUpgradeStageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus"; - }; - - ReadPoolInstancesUpgradeStageStatus.Stats = (function() { - - /** - * Properties of a Stats. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @interface IStats - * @property {number|null} [notStarted] Stats notStarted - * @property {number|null} [ongoing] Stats ongoing - * @property {number|null} [success] Stats success - * @property {number|null} [failed] Stats failed - */ - - /** - * Constructs a new Stats. - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @classdesc Represents a Stats. - * @implements IStats - * @constructor - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set - */ - function Stats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Stats notStarted. - * @member {number} notStarted - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.notStarted = 0; - - /** - * Stats ongoing. - * @member {number} ongoing - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.ongoing = 0; - - /** - * Stats success. - * @member {number} success - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.success = 0; - - /** - * Stats failed. - * @member {number} failed - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.failed = 0; - - /** - * Creates a new Stats instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats instance - */ - Stats.create = function create(properties) { - return new Stats(properties); - }; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.notStarted != null && Object.hasOwnProperty.call(message, "notStarted")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.notStarted); - if (message.ongoing != null && Object.hasOwnProperty.call(message, "ongoing")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ongoing); - if (message.success != null && Object.hasOwnProperty.call(message, "success")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.success); - if (message.failed != null && Object.hasOwnProperty.call(message, "failed")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failed); - return writer; - }; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.notStarted = reader.int32(); - break; - } - case 2: { - message.ongoing = reader.int32(); - break; - } - case 3: { - message.success = reader.int32(); - break; - } - case 4: { - message.failed = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Stats message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Stats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.notStarted != null && message.hasOwnProperty("notStarted")) - if (!$util.isInteger(message.notStarted)) - return "notStarted: integer expected"; - if (message.ongoing != null && message.hasOwnProperty("ongoing")) - if (!$util.isInteger(message.ongoing)) - return "ongoing: integer expected"; - if (message.success != null && message.hasOwnProperty("success")) - if (!$util.isInteger(message.success)) - return "success: integer expected"; - if (message.failed != null && message.hasOwnProperty("failed")) - if (!$util.isInteger(message.failed)) - return "failed: integer expected"; - return null; - }; - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - */ - Stats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats) - return object; - var message = new $root.google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); - if (object.notStarted != null) - message.notStarted = object.notStarted | 0; - if (object.ongoing != null) - message.ongoing = object.ongoing | 0; - if (object.success != null) - message.success = object.success | 0; - if (object.failed != null) - message.failed = object.failed | 0; - return message; - }; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} message Stats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Stats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.notStarted = 0; - object.ongoing = 0; - object.success = 0; - object.failed = 0; - } - if (message.notStarted != null && message.hasOwnProperty("notStarted")) - object.notStarted = message.notStarted; - if (message.ongoing != null && message.hasOwnProperty("ongoing")) - object.ongoing = message.ongoing; - if (message.success != null && message.hasOwnProperty("success")) - object.success = message.success; - if (message.failed != null && message.hasOwnProperty("failed")) - object.failed = message.failed; - return object; - }; - - /** - * Converts this Stats to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - * @returns {Object.} JSON object - */ - Stats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Stats - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats"; - }; - - return Stats; - })(); - - return ReadPoolInstancesUpgradeStageStatus; - })(); - - return UpgradeClusterStatus; - })(); - - v1.ListUsersRequest = (function() { - - /** - * Properties of a ListUsersRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListUsersRequest - * @property {string|null} [parent] ListUsersRequest parent - * @property {number|null} [pageSize] ListUsersRequest pageSize - * @property {string|null} [pageToken] ListUsersRequest pageToken - * @property {string|null} [filter] ListUsersRequest filter - * @property {string|null} [orderBy] ListUsersRequest orderBy - */ - - /** - * Constructs a new ListUsersRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListUsersRequest. - * @implements IListUsersRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListUsersRequest=} [properties] Properties to set - */ - function ListUsersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUsersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.parent = ""; - - /** - * ListUsersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageSize = 0; - - /** - * ListUsersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageToken = ""; - - /** - * ListUsersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.filter = ""; - - /** - * ListUsersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1.IListUsersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest instance - */ - ListUsersRequest.create = function create(properties) { - return new ListUsersRequest(properties); - }; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListUsersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListUsersRequest} ListUsersRequest - */ - ListUsersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListUsersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ListUsersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1.ListUsersRequest} message ListUsersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListUsersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @instance - * @returns {Object.} JSON object - */ - ListUsersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListUsersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListUsersRequest"; - }; - - return ListUsersRequest; - })(); - - v1.ListUsersResponse = (function() { - - /** - * Properties of a ListUsersResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IListUsersResponse - * @property {Array.|null} [users] ListUsersResponse users - * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken - * @property {Array.|null} [unreachable] ListUsersResponse unreachable - */ - - /** - * Constructs a new ListUsersResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListUsersResponse. - * @implements IListUsersResponse - * @constructor - * @param {google.cloud.alloydb.v1.IListUsersResponse=} [properties] Properties to set - */ - function ListUsersResponse(properties) { - this.users = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUsersResponse users. - * @member {Array.} users - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.users = $util.emptyArray; - - /** - * ListUsersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.nextPageToken = ""; - - /** - * ListUsersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1.IListUsersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse instance - */ - ListUsersResponse.create = function create(properties) { - return new ListUsersResponse(properties); - }; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.users != null && message.users.length) - for (var i = 0; i < message.users.length; ++i) - $root.google.cloud.alloydb.v1.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListUsersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListUsersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.users && message.users.length)) - message.users = []; - message.users.push($root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.users != null && message.hasOwnProperty("users")) { - if (!Array.isArray(message.users)) - return "users: array expected"; - for (var i = 0; i < message.users.length; ++i) { - var error = $root.google.cloud.alloydb.v1.User.verify(message.users[i]); - if (error) - return "users." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListUsersResponse} ListUsersResponse - */ - ListUsersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListUsersResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ListUsersResponse(); - if (object.users) { - if (!Array.isArray(object.users)) - throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.users: array expected"); - message.users = []; - for (var i = 0; i < object.users.length; ++i) { - if (typeof object.users[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.users: object expected"); - message.users[i] = $root.google.cloud.alloydb.v1.User.fromObject(object.users[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1.ListUsersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1.ListUsersResponse} message ListUsersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.users = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.users && message.users.length) { - object.users = []; - for (var j = 0; j < message.users.length; ++j) - object.users[j] = $root.google.cloud.alloydb.v1.User.toObject(message.users[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListUsersResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @instance - * @returns {Object.} JSON object - */ - ListUsersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListUsersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListUsersResponse"; - }; - - return ListUsersResponse; - })(); - - v1.GetUserRequest = (function() { - - /** - * Properties of a GetUserRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IGetUserRequest - * @property {string|null} [name] GetUserRequest name - */ - - /** - * Constructs a new GetUserRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetUserRequest. - * @implements IGetUserRequest - * @constructor - * @param {google.cloud.alloydb.v1.IGetUserRequest=} [properties] Properties to set - */ - function GetUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetUserRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @instance - */ - GetUserRequest.prototype.name = ""; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1.IGetUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest instance - */ - GetUserRequest.create = function create(properties) { - return new GetUserRequest(properties); - }; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.GetUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetUserRequest} GetUserRequest - */ - GetUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.GetUserRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1.GetUserRequest} message GetUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @instance - * @returns {Object.} JSON object - */ - GetUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetUserRequest"; - }; - - return GetUserRequest; - })(); - - v1.CreateUserRequest = (function() { - - /** - * Properties of a CreateUserRequest. - * @memberof google.cloud.alloydb.v1 - * @interface ICreateUserRequest - * @property {string|null} [parent] CreateUserRequest parent - * @property {string|null} [userId] CreateUserRequest userId - * @property {google.cloud.alloydb.v1.IUser|null} [user] CreateUserRequest user - * @property {string|null} [requestId] CreateUserRequest requestId - * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly - */ - - /** - * Constructs a new CreateUserRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateUserRequest. - * @implements ICreateUserRequest - * @constructor - * @param {google.cloud.alloydb.v1.ICreateUserRequest=} [properties] Properties to set - */ - function CreateUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateUserRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.parent = ""; - - /** - * CreateUserRequest userId. - * @member {string} userId - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.userId = ""; - - /** - * CreateUserRequest user. - * @member {google.cloud.alloydb.v1.IUser|null|undefined} user - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.user = null; - - /** - * CreateUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.requestId = ""; - - /** - * CreateUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest instance - */ - CreateUserRequest.create = function create(properties) { - return new CreateUserRequest(properties); - }; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.cloud.alloydb.v1.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.CreateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.userId = reader.string(); - break; - } - case 3: { - message.user = $root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.cloud.alloydb.v1.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateUserRequest} CreateUserRequest - */ - CreateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.CreateUserRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userId != null) - message.userId = String(object.userId); - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.cloud.alloydb.v1.CreateUserRequest.user: object expected"); - message.user = $root.google.cloud.alloydb.v1.User.fromObject(object.user); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1.CreateUserRequest} message CreateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userId = ""; - object.user = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.cloud.alloydb.v1.User.toObject(message.user, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @instance - * @returns {Object.} JSON object - */ - CreateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateUserRequest"; - }; - - return CreateUserRequest; - })(); - - v1.UpdateUserRequest = (function() { - - /** - * Properties of an UpdateUserRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IUpdateUserRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask - * @property {google.cloud.alloydb.v1.IUser|null} [user] UpdateUserRequest user - * @property {string|null} [requestId] UpdateUserRequest requestId - * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing - */ - - /** - * Constructs a new UpdateUserRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateUserRequest. - * @implements IUpdateUserRequest - * @constructor - * @param {google.cloud.alloydb.v1.IUpdateUserRequest=} [properties] Properties to set - */ - function UpdateUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateUserRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.updateMask = null; - - /** - * UpdateUserRequest user. - * @member {google.cloud.alloydb.v1.IUser|null|undefined} user - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.user = null; - - /** - * UpdateUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.requestId = ""; - - /** - * UpdateUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.validateOnly = false; - - /** - * UpdateUserRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest instance - */ - UpdateUserRequest.create = function create(properties) { - return new UpdateUserRequest(properties); - }; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.cloud.alloydb.v1.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.UpdateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.user = $root.google.cloud.alloydb.v1.User.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.cloud.alloydb.v1.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateUserRequest} UpdateUserRequest - */ - UpdateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.UpdateUserRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateUserRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.cloud.alloydb.v1.UpdateUserRequest.user: object expected"); - message.user = $root.google.cloud.alloydb.v1.User.fromObject(object.user); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1.UpdateUserRequest} message UpdateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.user = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.cloud.alloydb.v1.User.toObject(message.user, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateUserRequest"; - }; - - return UpdateUserRequest; - })(); - - v1.DeleteUserRequest = (function() { - - /** - * Properties of a DeleteUserRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IDeleteUserRequest - * @property {string|null} [name] DeleteUserRequest name - * @property {string|null} [requestId] DeleteUserRequest requestId - * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly - */ - - /** - * Constructs a new DeleteUserRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteUserRequest. - * @implements IDeleteUserRequest - * @constructor - * @param {google.cloud.alloydb.v1.IDeleteUserRequest=} [properties] Properties to set - */ - function DeleteUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteUserRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.name = ""; - - /** - * DeleteUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.requestId = ""; - - /** - * DeleteUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest instance - */ - DeleteUserRequest.create = function create(properties) { - return new DeleteUserRequest(properties); - }; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.DeleteUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteUserRequest} DeleteUserRequest - */ - DeleteUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.DeleteUserRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1.DeleteUserRequest} message DeleteUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteUserRequest"; - }; - - return DeleteUserRequest; - })(); - - v1.ListDatabasesRequest = (function() { - - /** - * Properties of a ListDatabasesRequest. - * @memberof google.cloud.alloydb.v1 - * @interface IListDatabasesRequest - * @property {string|null} [parent] ListDatabasesRequest parent - * @property {number|null} [pageSize] ListDatabasesRequest pageSize - * @property {string|null} [pageToken] ListDatabasesRequest pageToken - * @property {string|null} [filter] ListDatabasesRequest filter - */ - - /** - * Constructs a new ListDatabasesRequest. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListDatabasesRequest. - * @implements IListDatabasesRequest - * @constructor - * @param {google.cloud.alloydb.v1.IListDatabasesRequest=} [properties] Properties to set - */ - function ListDatabasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.parent = ""; - - /** - * ListDatabasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageSize = 0; - - /** - * ListDatabasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageToken = ""; - - /** - * ListDatabasesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.filter = ""; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1.IListDatabasesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest instance - */ - ListDatabasesRequest.create = function create(properties) { - return new ListDatabasesRequest(properties); - }; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListDatabasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListDatabasesRequest} ListDatabasesRequest - */ - ListDatabasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListDatabasesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1.ListDatabasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1.ListDatabasesRequest} message ListDatabasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListDatabasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListDatabasesRequest"; - }; - - return ListDatabasesRequest; - })(); - - v1.ListDatabasesResponse = (function() { - - /** - * Properties of a ListDatabasesResponse. - * @memberof google.cloud.alloydb.v1 - * @interface IListDatabasesResponse - * @property {Array.|null} [databases] ListDatabasesResponse databases - * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabasesResponse. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListDatabasesResponse. - * @implements IListDatabasesResponse - * @constructor - * @param {google.cloud.alloydb.v1.IListDatabasesResponse=} [properties] Properties to set - */ - function ListDatabasesResponse(properties) { - this.databases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesResponse databases. - * @member {Array.} databases - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.databases = $util.emptyArray; - - /** - * ListDatabasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1.IListDatabasesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse instance - */ - ListDatabasesResponse.create = function create(properties) { - return new ListDatabasesResponse(properties); - }; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databases != null && message.databases.length) - for (var i = 0; i < message.databases.length; ++i) - $root.google.cloud.alloydb.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListDatabasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.ListDatabasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databases && message.databases.length)) - message.databases = []; - message.databases.push($root.google.cloud.alloydb.v1.Database.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databases != null && message.hasOwnProperty("databases")) { - if (!Array.isArray(message.databases)) - return "databases: array expected"; - for (var i = 0; i < message.databases.length; ++i) { - var error = $root.google.cloud.alloydb.v1.Database.verify(message.databases[i]); - if (error) - return "databases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListDatabasesResponse} ListDatabasesResponse - */ - ListDatabasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListDatabasesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1.ListDatabasesResponse(); - if (object.databases) { - if (!Array.isArray(object.databases)) - throw TypeError(".google.cloud.alloydb.v1.ListDatabasesResponse.databases: array expected"); - message.databases = []; - for (var i = 0; i < object.databases.length; ++i) { - if (typeof object.databases[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.ListDatabasesResponse.databases: object expected"); - message.databases[i] = $root.google.cloud.alloydb.v1.Database.fromObject(object.databases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1.ListDatabasesResponse} message ListDatabasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databases && message.databases.length) { - object.databases = []; - for (var j = 0; j < message.databases.length; ++j) - object.databases[j] = $root.google.cloud.alloydb.v1.Database.toObject(message.databases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListDatabasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListDatabasesResponse"; - }; - - return ListDatabasesResponse; - })(); - - v1.SqlResult = (function() { - - /** - * Properties of a SqlResult. - * @memberof google.cloud.alloydb.v1 - * @interface ISqlResult - * @property {Array.|null} [columns] SqlResult columns - * @property {Array.|null} [rows] SqlResult rows - */ - - /** - * Constructs a new SqlResult. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SqlResult. - * @implements ISqlResult - * @constructor - * @param {google.cloud.alloydb.v1.ISqlResult=} [properties] Properties to set - */ - function SqlResult(properties) { - this.columns = []; - this.rows = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResult columns. - * @member {Array.} columns - * @memberof google.cloud.alloydb.v1.SqlResult - * @instance - */ - SqlResult.prototype.columns = $util.emptyArray; - - /** - * SqlResult rows. - * @member {Array.} rows - * @memberof google.cloud.alloydb.v1.SqlResult - * @instance - */ - SqlResult.prototype.rows = $util.emptyArray; - - /** - * Creates a new SqlResult instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {google.cloud.alloydb.v1.ISqlResult=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult instance - */ - SqlResult.create = function create(properties) { - return new SqlResult(properties); - }; - - /** - * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {google.cloud.alloydb.v1.ISqlResult} message SqlResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - $root.google.cloud.alloydb.v1.SqlResultColumn.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.cloud.alloydb.v1.SqlResultRow.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {google.cloud.alloydb.v1.ISqlResult} message SqlResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push($root.google.cloud.alloydb.v1.SqlResultColumn.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.cloud.alloydb.v1.SqlResultRow.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResult message. - * @function verify - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) { - var error = $root.google.cloud.alloydb.v1.SqlResultColumn.verify(message.columns[i]); - if (error) - return "columns." + error; - } - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.cloud.alloydb.v1.SqlResultRow.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - return null; - }; - - /** - * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult - */ - SqlResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SqlResult) - return object; - var message = new $root.google.cloud.alloydb.v1.SqlResult(); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.cloud.alloydb.v1.SqlResult.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) { - if (typeof object.columns[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.SqlResult.columns: object expected"); - message.columns[i] = $root.google.cloud.alloydb.v1.SqlResultColumn.fromObject(object.columns[i]); - } - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.cloud.alloydb.v1.SqlResult.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.SqlResult.rows: object expected"); - message.rows[i] = $root.google.cloud.alloydb.v1.SqlResultRow.fromObject(object.rows[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SqlResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {google.cloud.alloydb.v1.SqlResult} message SqlResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columns = []; - object.rows = []; - } - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = $root.google.cloud.alloydb.v1.SqlResultColumn.toObject(message.columns[j], options); - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.cloud.alloydb.v1.SqlResultRow.toObject(message.rows[j], options); - } - return object; - }; - - /** - * Converts this SqlResult to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SqlResult - * @instance - * @returns {Object.} JSON object - */ - SqlResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResult - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SqlResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResult"; - }; - - return SqlResult; - })(); - - v1.SqlResultColumn = (function() { - - /** - * Properties of a SqlResultColumn. - * @memberof google.cloud.alloydb.v1 - * @interface ISqlResultColumn - * @property {string|null} [name] SqlResultColumn name - * @property {string|null} [type] SqlResultColumn type - */ - - /** - * Constructs a new SqlResultColumn. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SqlResultColumn. - * @implements ISqlResultColumn - * @constructor - * @param {google.cloud.alloydb.v1.ISqlResultColumn=} [properties] Properties to set - */ - function SqlResultColumn(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultColumn name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @instance - */ - SqlResultColumn.prototype.name = ""; - - /** - * SqlResultColumn type. - * @member {string} type - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @instance - */ - SqlResultColumn.prototype.type = ""; - - /** - * Creates a new SqlResultColumn instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1.ISqlResultColumn=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn instance - */ - SqlResultColumn.create = function create(properties) { - return new SqlResultColumn(properties); - }; - - /** - * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1.ISqlResultColumn} message SqlResultColumn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultColumn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - return writer; - }; - - /** - * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1.ISqlResultColumn} message SqlResultColumn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultColumn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResultColumn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultColumn message. - * @function verify - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultColumn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn - */ - SqlResultColumn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SqlResultColumn) - return object; - var message = new $root.google.cloud.alloydb.v1.SqlResultColumn(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1.SqlResultColumn} message SqlResultColumn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultColumn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this SqlResultColumn to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @instance - * @returns {Object.} JSON object - */ - SqlResultColumn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultColumn - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SqlResultColumn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultColumn"; - }; - - return SqlResultColumn; - })(); - - v1.SqlResultRow = (function() { - - /** - * Properties of a SqlResultRow. - * @memberof google.cloud.alloydb.v1 - * @interface ISqlResultRow - * @property {Array.|null} [values] SqlResultRow values - */ - - /** - * Constructs a new SqlResultRow. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SqlResultRow. - * @implements ISqlResultRow - * @constructor - * @param {google.cloud.alloydb.v1.ISqlResultRow=} [properties] Properties to set - */ - function SqlResultRow(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultRow values. - * @member {Array.} values - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @instance - */ - SqlResultRow.prototype.values = $util.emptyArray; - - /** - * Creates a new SqlResultRow instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1.ISqlResultRow=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow instance - */ - SqlResultRow.create = function create(properties) { - return new SqlResultRow(properties); - }; - - /** - * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1.ISqlResultRow} message SqlResultRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.alloydb.v1.SqlResultValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1.ISqlResultRow} message SqlResultRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultRow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResultRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.alloydb.v1.SqlResultValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultRow message. - * @function verify - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.alloydb.v1.SqlResultValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow - */ - SqlResultRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SqlResultRow) - return object; - var message = new $root.google.cloud.alloydb.v1.SqlResultRow(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.alloydb.v1.SqlResultRow.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1.SqlResultRow.values: object expected"); - message.values[i] = $root.google.cloud.alloydb.v1.SqlResultValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1.SqlResultRow} message SqlResultRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.alloydb.v1.SqlResultValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this SqlResultRow to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @instance - * @returns {Object.} JSON object - */ - SqlResultRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultRow - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SqlResultRow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultRow"; - }; - - return SqlResultRow; - })(); - - v1.SqlResultValue = (function() { - - /** - * Properties of a SqlResultValue. - * @memberof google.cloud.alloydb.v1 - * @interface ISqlResultValue - * @property {string|null} [value] SqlResultValue value - * @property {boolean|null} [nullValue] SqlResultValue nullValue - */ - - /** - * Constructs a new SqlResultValue. - * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SqlResultValue. - * @implements ISqlResultValue - * @constructor - * @param {google.cloud.alloydb.v1.ISqlResultValue=} [properties] Properties to set - */ - function SqlResultValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @instance - */ - SqlResultValue.prototype.value = null; - - /** - * SqlResultValue nullValue. - * @member {boolean|null|undefined} nullValue - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @instance - */ - SqlResultValue.prototype.nullValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlResultValue.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlResultValue.prototype, "_nullValue", { - get: $util.oneOfGetter($oneOfFields = ["nullValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SqlResultValue instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1.ISqlResultValue=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue instance - */ - SqlResultValue.create = function create(properties) { - return new SqlResultValue(properties); - }; - - /** - * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1.ISqlResultValue} message SqlResultValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.nullValue); - return writer; - }; - - /** - * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1.ISqlResultValue} message SqlResultValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.SqlResultValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - case 2: { - message.nullValue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultValue message. - * @function verify - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties._nullValue = 1; - if (typeof message.nullValue !== "boolean") - return "nullValue: boolean expected"; - } - return null; - }; - - /** - * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue - */ - SqlResultValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SqlResultValue) - return object; - var message = new $root.google.cloud.alloydb.v1.SqlResultValue(); - if (object.value != null) - message.value = String(object.value); - if (object.nullValue != null) - message.nullValue = Boolean(object.nullValue); - return message; - }; - - /** - * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1.SqlResultValue} message SqlResultValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object._value = "value"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = message.nullValue; - if (options.oneofs) - object._nullValue = "nullValue"; - } - return object; - }; - - /** - * Converts this SqlResultValue to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @instance - * @returns {Object.} JSON object - */ - SqlResultValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultValue - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultValue"; - }; - - return SqlResultValue; - })(); - - return v1; - })(); - - alloydb.v1alpha = (function() { - - /** - * Namespace v1alpha. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1alpha = {}; - - v1alpha.CloudSQLBackupRunSource = (function() { - - /** - * Properties of a CloudSQLBackupRunSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICloudSQLBackupRunSource - * @property {string|null} [project] CloudSQLBackupRunSource project - * @property {string|null} [instanceId] CloudSQLBackupRunSource instanceId - * @property {number|Long|null} [backupRunId] CloudSQLBackupRunSource backupRunId - */ - - /** - * Constructs a new CloudSQLBackupRunSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CloudSQLBackupRunSource. - * @implements ICloudSQLBackupRunSource - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource=} [properties] Properties to set - */ - function CloudSQLBackupRunSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSQLBackupRunSource project. - * @member {string} project - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.project = ""; - - /** - * CloudSQLBackupRunSource instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.instanceId = ""; - - /** - * CloudSQLBackupRunSource backupRunId. - * @member {number|Long} backupRunId - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.backupRunId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CloudSQLBackupRunSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource instance - */ - CloudSQLBackupRunSource.create = function create(properties) { - return new CloudSQLBackupRunSource(properties); - }; - - /** - * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSQLBackupRunSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.backupRunId); - return writer; - }; - - /** - * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSQLBackupRunSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSQLBackupRunSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupRunId = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSQLBackupRunSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSQLBackupRunSource message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSQLBackupRunSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) - return "backupRunId: integer|Long expected"; - return null; - }; - - /** - * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} CloudSQLBackupRunSource - */ - CloudSQLBackupRunSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource(); - if (object.project != null) - message.project = String(object.project); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupRunId != null) - if ($util.Long) - (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; - else if (typeof object.backupRunId === "string") - message.backupRunId = parseInt(object.backupRunId, 10); - else if (typeof object.backupRunId === "number") - message.backupRunId = object.backupRunId; - else if (typeof object.backupRunId === "object") - message.backupRunId = new $util.LongBits(object.backupRunId.low >>> 0, object.backupRunId.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} message CloudSQLBackupRunSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSQLBackupRunSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.instanceId = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backupRunId = options.longs === String ? "0" : 0; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (typeof message.backupRunId === "number") - object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; - else - object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; - return object; - }; - - /** - * Converts this CloudSQLBackupRunSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @instance - * @returns {Object.} JSON object - */ - CloudSQLBackupRunSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSQLBackupRunSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSQLBackupRunSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource"; - }; - - return CloudSQLBackupRunSource; - })(); - - v1alpha.AlloyDBCSQLAdmin = (function() { - - /** - * Constructs a new AlloyDBCSQLAdmin service. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an AlloyDBCSQLAdmin - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AlloyDBCSQLAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBCSQLAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBCSQLAdmin; - - /** - * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AlloyDBCSQLAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBCSQLAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin|restoreFromCloudSQL}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin - * @typedef RestoreFromCloudSQLCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreFromCloudSQL. - * @function restoreFromCloudSQL - * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBCSQLAdmin.prototype.restoreFromCloudSQL = function restoreFromCloudSQL(request, callback) { - return this.rpcCall(restoreFromCloudSQL, $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreFromCloudSQL" }); - - /** - * Calls RestoreFromCloudSQL. - * @function restoreFromCloudSQL - * @memberof google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBCSQLAdmin; - })(); - - v1alpha.RestoreFromCloudSQLRequest = (function() { - - /** - * Properties of a RestoreFromCloudSQLRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IRestoreFromCloudSQLRequest - * @property {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] RestoreFromCloudSQLRequest cloudsqlBackupRunSource - * @property {string|null} [parent] RestoreFromCloudSQLRequest parent - * @property {string|null} [clusterId] RestoreFromCloudSQLRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] RestoreFromCloudSQLRequest cluster - */ - - /** - * Constructs a new RestoreFromCloudSQLRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a RestoreFromCloudSQLRequest. - * @implements IRestoreFromCloudSQLRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest=} [properties] Properties to set - */ - function RestoreFromCloudSQLRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreFromCloudSQLRequest cloudsqlBackupRunSource. - * @member {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.cloudsqlBackupRunSource = null; - - /** - * RestoreFromCloudSQLRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.parent = ""; - - /** - * RestoreFromCloudSQLRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.clusterId = ""; - - /** - * RestoreFromCloudSQLRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.cluster = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreFromCloudSQLRequest source. - * @member {"cloudsqlBackupRunSource"|undefined} source - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @instance - */ - Object.defineProperty(RestoreFromCloudSQLRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["cloudsqlBackupRunSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest instance - */ - RestoreFromCloudSQLRequest.create = function create(properties) { - return new RestoreFromCloudSQLRequest(properties); - }; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreFromCloudSQLRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) - $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreFromCloudSQLRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreFromCloudSQLRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 101: { - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreFromCloudSQLRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreFromCloudSQLRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreFromCloudSQLRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); - if (error) - return "cloudsqlBackupRunSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - return null; - }; - - /** - * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - */ - RestoreFromCloudSQLRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest(); - if (object.cloudsqlBackupRunSource != null) { - if (typeof object.cloudsqlBackupRunSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.cloudsqlBackupRunSource: object expected"); - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - return message; - }; - - /** - * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreFromCloudSQLRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); - if (options.oneofs) - object.source = "cloudsqlBackupRunSource"; - } - return object; - }; - - /** - * Converts this RestoreFromCloudSQLRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreFromCloudSQLRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreFromCloudSQLRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreFromCloudSQLRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest"; - }; - - return RestoreFromCloudSQLRequest; - })(); - - /** - * InstanceView enum. - * @name google.cloud.alloydb.v1alpha.InstanceView - * @enum {number} - * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value - * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value - * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value - */ - v1alpha.InstanceView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; - values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; - return values; - })(); - - /** - * ClusterView enum. - * @name google.cloud.alloydb.v1alpha.ClusterView - * @enum {number} - * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value - * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value - * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value - */ - v1alpha.ClusterView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; - values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; - return values; - })(); - - /** - * DatabaseVersion enum. - * @name google.cloud.alloydb.v1alpha.DatabaseVersion - * @enum {number} - * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value - * @property {number} POSTGRES_13=1 POSTGRES_13 value - * @property {number} POSTGRES_14=2 POSTGRES_14 value - * @property {number} POSTGRES_15=3 POSTGRES_15 value - * @property {number} POSTGRES_16=4 POSTGRES_16 value - * @property {number} POSTGRES_17=5 POSTGRES_17 value - * @property {number} POSTGRES_18=6 POSTGRES_18 value - */ - v1alpha.DatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "POSTGRES_13"] = 1; - values[valuesById[2] = "POSTGRES_14"] = 2; - values[valuesById[3] = "POSTGRES_15"] = 3; - values[valuesById[4] = "POSTGRES_16"] = 4; - values[valuesById[5] = "POSTGRES_17"] = 5; - values[valuesById[6] = "POSTGRES_18"] = 6; - return values; - })(); - - /** - * SubscriptionType enum. - * @name google.cloud.alloydb.v1alpha.SubscriptionType - * @enum {number} - * @property {number} SUBSCRIPTION_TYPE_UNSPECIFIED=0 SUBSCRIPTION_TYPE_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} TRIAL=2 TRIAL value - */ - v1alpha.SubscriptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SUBSCRIPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "TRIAL"] = 2; - return values; - })(); - - v1alpha.UserPassword = (function() { - - /** - * Properties of a UserPassword. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUserPassword - * @property {string|null} [user] UserPassword user - * @property {string|null} [password] UserPassword password - */ - - /** - * Constructs a new UserPassword. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a UserPassword. - * @implements IUserPassword - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set - */ - function UserPassword(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UserPassword user. - * @member {string} user - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @instance - */ - UserPassword.prototype.user = ""; - - /** - * UserPassword password. - * @member {string} password - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @instance - */ - UserPassword.prototype.password = ""; - - /** - * Creates a new UserPassword instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {google.cloud.alloydb.v1alpha.IUserPassword=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword instance - */ - UserPassword.create = function create(properties) { - return new UserPassword(properties); - }; - - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserPassword.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); - return writer; - }; - - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UserPassword.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {google.cloud.alloydb.v1alpha.IUserPassword} message UserPassword message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserPassword.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserPassword.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.user = reader.string(); - break; - } - case 2: { - message.password = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserPassword.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserPassword message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserPassword.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - return null; - }; - - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UserPassword} UserPassword - */ - UserPassword.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UserPassword) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UserPassword(); - if (object.user != null) - message.user = String(object.user); - if (object.password != null) - message.password = String(object.password); - return message; - }; - - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {google.cloud.alloydb.v1alpha.UserPassword} message UserPassword - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserPassword.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.user = ""; - object.password = ""; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - return object; - }; - - /** - * Converts this UserPassword to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @instance - * @returns {Object.} JSON object - */ - UserPassword.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserPassword - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UserPassword - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UserPassword"; - }; - - return UserPassword; - })(); - - v1alpha.MigrationSource = (function() { - - /** - * Properties of a MigrationSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface IMigrationSource - * @property {string|null} [hostPort] MigrationSource hostPort - * @property {string|null} [referenceId] MigrationSource referenceId - * @property {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType - */ - - /** - * Constructs a new MigrationSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a MigrationSource. - * @implements IMigrationSource - * @constructor - * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set - */ - function MigrationSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MigrationSource hostPort. - * @member {string} hostPort - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @instance - */ - MigrationSource.prototype.hostPort = ""; - - /** - * MigrationSource referenceId. - * @member {string} referenceId - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @instance - */ - MigrationSource.prototype.referenceId = ""; - - /** - * MigrationSource sourceType. - * @member {google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType} sourceType - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @instance - */ - MigrationSource.prototype.sourceType = 0; - - /** - * Creates a new MigrationSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {google.cloud.alloydb.v1alpha.IMigrationSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource instance - */ - MigrationSource.create = function create(properties) { - return new MigrationSource(properties); - }; - - /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); - if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); - return writer; - }; - - /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MigrationSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {google.cloud.alloydb.v1alpha.IMigrationSource} message MigrationSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MigrationSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.hostPort = reader.string(); - break; - } - case 2: { - message.referenceId = reader.string(); - break; - } - case 3: { - message.sourceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MigrationSource message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - if (!$util.isString(message.hostPort)) - return "hostPort: string expected"; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - if (!$util.isString(message.referenceId)) - return "referenceId: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.MigrationSource} MigrationSource - */ - MigrationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.MigrationSource) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.MigrationSource(); - if (object.hostPort != null) - message.hostPort = String(object.hostPort); - if (object.referenceId != null) - message.referenceId = String(object.referenceId); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "DMS": - case 1: - message.sourceType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {google.cloud.alloydb.v1alpha.MigrationSource} message MigrationSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.hostPort = ""; - object.referenceId = ""; - object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; - } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - object.hostPort = message.hostPort; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - object.referenceId = message.referenceId; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; - return object; - }; - - /** - * Converts this MigrationSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @instance - * @returns {Object.} JSON object - */ - MigrationSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MigrationSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.MigrationSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MigrationSource"; - }; - - /** - * MigrationSourceType enum. - * @name google.cloud.alloydb.v1alpha.MigrationSource.MigrationSourceType - * @enum {number} - * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value - * @property {number} DMS=1 DMS value - */ - MigrationSource.MigrationSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DMS"] = 1; - return values; - })(); - - return MigrationSource; - })(); - - v1alpha.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyName = ""; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kmsKeyName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1alpha.EncryptionInfo = (function() { - - /** - * Properties of an EncryptionInfo. - * @memberof google.cloud.alloydb.v1alpha - * @interface IEncryptionInfo - * @property {google.cloud.alloydb.v1alpha.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions - */ - - /** - * Constructs a new EncryptionInfo. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo - * @constructor - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set - */ - function EncryptionInfo(properties) { - this.kmsKeyVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionInfo encryptionType. - * @member {google.cloud.alloydb.v1alpha.EncryptionInfo.Type} encryptionType - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionType = 0; - - /** - * EncryptionInfo kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo instance - */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); - }; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); - return writer; - }; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.EncryptionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { - if (!Array.isArray(message.kmsKeyVersions)) - return "kmsKeyVersions: array expected"; - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - if (!$util.isString(message.kmsKeyVersions[i])) - return "kmsKeyVersions: string[] expected"; - } - return null; - }; - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.EncryptionInfo} EncryptionInfo - */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.EncryptionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - } - if (object.kmsKeyVersions) { - if (!Array.isArray(object.kmsKeyVersions)) - throw TypeError(".google.cloud.alloydb.v1alpha.EncryptionInfo.kmsKeyVersions: array expected"); - message.kmsKeyVersions = []; - for (var i = 0; i < object.kmsKeyVersions.length; ++i) - message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); - } - return message; - }; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.EncryptionInfo} message EncryptionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyVersions = []; - if (options.defaults) - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1alpha.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.kmsKeyVersions && message.kmsKeyVersions.length) { - object.kmsKeyVersions = []; - for (var j = 0; j < message.kmsKeyVersions.length; ++j) - object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; - } - return object; - }; - - /** - * Converts this EncryptionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @instance - * @returns {Object.} JSON object - */ - EncryptionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.EncryptionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.EncryptionInfo"; - }; - - /** - * Type enum. - * @name google.cloud.alloydb.v1alpha.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; - })(); - - v1alpha.SslConfig = (function() { - - /** - * Properties of a SslConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISslConfig - * @property {google.cloud.alloydb.v1alpha.SslConfig.SslMode|null} [sslMode] SslConfig sslMode - * @property {google.cloud.alloydb.v1alpha.SslConfig.CaSource|null} [caSource] SslConfig caSource - */ - - /** - * Constructs a new SslConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SslConfig. - * @implements ISslConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set - */ - function SslConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SslConfig sslMode. - * @member {google.cloud.alloydb.v1alpha.SslConfig.SslMode} sslMode - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @instance - */ - SslConfig.prototype.sslMode = 0; - - /** - * SslConfig caSource. - * @member {google.cloud.alloydb.v1alpha.SslConfig.CaSource} caSource - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @instance - */ - SslConfig.prototype.caSource = 0; - - /** - * Creates a new SslConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {google.cloud.alloydb.v1alpha.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig instance - */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); - }; - - /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SslConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); - if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); - return writer; - }; - - /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SslConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {google.cloud.alloydb.v1alpha.ISslConfig} message SslConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SslConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SslConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sslMode = reader.int32(); - break; - } - case 2: { - message.caSource = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SslConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SslConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - switch (message.sslMode) { - default: - return "sslMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.caSource != null && message.hasOwnProperty("caSource")) - switch (message.caSource) { - default: - return "caSource: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SslConfig} SslConfig - */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SslConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SslConfig(); - switch (object.sslMode) { - default: - if (typeof object.sslMode === "number") { - message.sslMode = object.sslMode; - break; - } - break; - case "SSL_MODE_UNSPECIFIED": - case 0: - message.sslMode = 0; - break; - case "SSL_MODE_ALLOW": - case 1: - message.sslMode = 1; - break; - case "SSL_MODE_REQUIRE": - case 2: - message.sslMode = 2; - break; - case "SSL_MODE_VERIFY_CA": - case 3: - message.sslMode = 3; - break; - case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": - case 4: - message.sslMode = 4; - break; - case "ENCRYPTED_ONLY": - case 5: - message.sslMode = 5; - break; - } - switch (object.caSource) { - default: - if (typeof object.caSource === "number") { - message.caSource = object.caSource; - break; - } - break; - case "CA_SOURCE_UNSPECIFIED": - case 0: - message.caSource = 0; - break; - case "CA_SOURCE_MANAGED": - case 1: - message.caSource = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {google.cloud.alloydb.v1alpha.SslConfig} message SslConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SslConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; - object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; - } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1alpha.SslConfig.SslMode[message.sslMode] : message.sslMode; - if (message.caSource != null && message.hasOwnProperty("caSource")) - object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1alpha.SslConfig.CaSource[message.caSource] : message.caSource; - return object; - }; - - /** - * Converts this SslConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @instance - * @returns {Object.} JSON object - */ - SslConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SslConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SslConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SslConfig"; - }; - - /** - * SslMode enum. - * @name google.cloud.alloydb.v1alpha.SslConfig.SslMode - * @enum {number} - * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value - * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value - * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value - * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value - * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value - * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value - */ - SslConfig.SslMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; - values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; - values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; - values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; - values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; - return values; - })(); - - /** - * CaSource enum. - * @name google.cloud.alloydb.v1alpha.SslConfig.CaSource - * @enum {number} - * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value - * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value - */ - SslConfig.CaSource = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; - return values; - })(); - - return SslConfig; - })(); - - v1alpha.AutomatedBackupPolicy = (function() { - - /** - * Properties of an AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1alpha - * @interface IAutomatedBackupPolicy - * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule - * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention - * @property {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention - * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled - * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig - * @property {string|null} [location] AutomatedBackupPolicy location - * @property {Object.|null} [labels] AutomatedBackupPolicy labels - */ - - /** - * Constructs a new AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an AutomatedBackupPolicy. - * @implements IAutomatedBackupPolicy - * @constructor - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set - */ - function AutomatedBackupPolicy(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutomatedBackupPolicy weeklySchedule. - * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.weeklySchedule = null; - - /** - * AutomatedBackupPolicy timeBasedRetention. - * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.timeBasedRetention = null; - - /** - * AutomatedBackupPolicy quantityBasedRetention. - * @member {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.quantityBasedRetention = null; - - /** - * AutomatedBackupPolicy enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.enabled = null; - - /** - * AutomatedBackupPolicy backupWindow. - * @member {google.protobuf.IDuration|null|undefined} backupWindow - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.backupWindow = null; - - /** - * AutomatedBackupPolicy encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.encryptionConfig = null; - - /** - * AutomatedBackupPolicy location. - * @member {string} location - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.location = ""; - - /** - * AutomatedBackupPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutomatedBackupPolicy schedule. - * @member {"weeklySchedule"|undefined} schedule - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { - get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutomatedBackupPolicy retention. - * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { - get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy instance - */ - AutomatedBackupPolicy.create = function create(properties) { - return new AutomatedBackupPolicy(properties); - }; - - /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutomatedBackupPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) - $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutomatedBackupPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); - break; - } - case 4: { - message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); - break; - } - case 5: { - message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); - break; - } - case 1: { - message.enabled = reader.bool(); - break; - } - case 3: { - message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 8: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.location = reader.string(); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutomatedBackupPolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutomatedBackupPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - properties.schedule = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); - if (error) - return "weeklySchedule." + error; - } - } - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); - if (error) - return "timeBasedRetention." + error; - } - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - if (properties.retention === 1) - return "retention: multiple values"; - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); - if (error) - return "quantityBasedRetention." + error; - } - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { - var error = $root.google.protobuf.Duration.verify(message.backupWindow); - if (error) - return "backupWindow." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} AutomatedBackupPolicy - */ - AutomatedBackupPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy(); - if (object.weeklySchedule != null) { - if (typeof object.weeklySchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.weeklySchedule: object expected"); - message.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); - } - if (object.timeBasedRetention != null) { - if (typeof object.timeBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.timeBasedRetention: object expected"); - message.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); - } - if (object.quantityBasedRetention != null) { - if (typeof object.quantityBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.quantityBasedRetention: object expected"); - message.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); - } - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.backupWindow != null) { - if (typeof object.backupWindow !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.backupWindow: object expected"); - message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy} message AutomatedBackupPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutomatedBackupPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.backupWindow = null; - object.location = ""; - object.encryptionConfig = null; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - object.weeklySchedule = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); - if (options.oneofs) - object.schedule = "weeklySchedule"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) - object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - object.timeBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); - if (options.oneofs) - object.retention = "timeBasedRetention"; - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - object.quantityBasedRetention = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); - if (options.oneofs) - object.retention = "quantityBasedRetention"; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this AutomatedBackupPolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - * @returns {Object.} JSON object - */ - AutomatedBackupPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutomatedBackupPolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy"; - }; - - AutomatedBackupPolicy.WeeklySchedule = (function() { - - /** - * Properties of a WeeklySchedule. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @interface IWeeklySchedule - * @property {Array.|null} [startTimes] WeeklySchedule startTimes - * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek - */ - - /** - * Constructs a new WeeklySchedule. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @classdesc Represents a WeeklySchedule. - * @implements IWeeklySchedule - * @constructor - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - */ - function WeeklySchedule(properties) { - this.startTimes = []; - this.daysOfWeek = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeeklySchedule startTimes. - * @member {Array.} startTimes - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.startTimes = $util.emptyArray; - - /** - * WeeklySchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance - */ - WeeklySchedule.create = function create(properties) { - return new WeeklySchedule(properties); - }; - - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimes != null && message.startTimes.length) - for (var i = 0; i < message.startTimes.length; ++i) - $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.startTimes && message.startTimes.length)) - message.startTimes = []; - message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.daysOfWeek && message.daysOfWeek.length)) - message.daysOfWeek = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfWeek.push(reader.int32()); - } else - message.daysOfWeek.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeeklySchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeeklySchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimes != null && message.hasOwnProperty("startTimes")) { - if (!Array.isArray(message.startTimes)) - return "startTimes: array expected"; - for (var i = 0; i < message.startTimes.length; ++i) { - var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); - if (error) - return "startTimes." + error; - } - } - if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { - if (!Array.isArray(message.daysOfWeek)) - return "daysOfWeek: array expected"; - for (var i = 0; i < message.daysOfWeek.length; ++i) - switch (message.daysOfWeek[i]) { - default: - return "daysOfWeek: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; - - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - */ - WeeklySchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule(); - if (object.startTimes) { - if (!Array.isArray(object.startTimes)) - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); - message.startTimes = []; - for (var i = 0; i < object.startTimes.length; ++i) { - if (typeof object.startTimes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); - message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); - } - } - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - switch (object.daysOfWeek[i]) { - default: - if (typeof object.daysOfWeek[i] === "number") { - message.daysOfWeek[i] = object.daysOfWeek[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.daysOfWeek[i] = 0; - break; - case "MONDAY": - case 1: - message.daysOfWeek[i] = 1; - break; - case "TUESDAY": - case 2: - message.daysOfWeek[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.daysOfWeek[i] = 3; - break; - case "THURSDAY": - case 4: - message.daysOfWeek[i] = 4; - break; - case "FRIDAY": - case 5: - message.daysOfWeek[i] = 5; - break; - case "SATURDAY": - case 6: - message.daysOfWeek[i] = 6; - break; - case "SUNDAY": - case 7: - message.daysOfWeek[i] = 7; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeeklySchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startTimes = []; - object.daysOfWeek = []; - } - if (message.startTimes && message.startTimes.length) { - object.startTimes = []; - for (var j = 0; j < message.startTimes.length; ++j) - object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); - } - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; - } - return object; - }; - - /** - * Converts this WeeklySchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @instance - * @returns {Object.} JSON object - */ - WeeklySchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WeeklySchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.WeeklySchedule"; - }; - - return WeeklySchedule; - })(); - - AutomatedBackupPolicy.TimeBasedRetention = (function() { - - /** - * Properties of a TimeBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @interface ITimeBasedRetention - * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod - */ - - /** - * Constructs a new TimeBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @classdesc Represents a TimeBasedRetention. - * @implements ITimeBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - */ - function TimeBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimeBasedRetention retentionPeriod. - * @member {google.protobuf.IDuration|null|undefined} retentionPeriod - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @instance - */ - TimeBasedRetention.prototype.retentionPeriod = null; - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance - */ - TimeBasedRetention.create = function create(properties) { - return new TimeBasedRetention(properties); - }; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) - $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); - if (error) - return "retentionPeriod." + error; - } - return null; - }; - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - */ - TimeBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention(); - if (object.retentionPeriod != null) { - if (typeof object.retentionPeriod !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); - message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); - } - return message; - }; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.retentionPeriod = null; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) - object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); - return object; - }; - - /** - * Converts this TimeBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @instance - * @returns {Object.} JSON object - */ - TimeBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.TimeBasedRetention"; - }; - - return TimeBasedRetention; - })(); - - AutomatedBackupPolicy.QuantityBasedRetention = (function() { - - /** - * Properties of a QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @interface IQuantityBasedRetention - * @property {number|null} [count] QuantityBasedRetention count - */ - - /** - * Constructs a new QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @classdesc Represents a QuantityBasedRetention. - * @implements IQuantityBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - */ - function QuantityBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedRetention count. - * @member {number} count - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - */ - QuantityBasedRetention.prototype.count = 0; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance - */ - QuantityBasedRetention.create = function create(properties) { - return new QuantityBasedRetention(properties); - }; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - return writer; - }; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - */ - QuantityBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention(); - if (object.count != null) - message.count = object.count | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.QuantityBasedRetention"; - }; - - return QuantityBasedRetention; - })(); - - return AutomatedBackupPolicy; - })(); - - v1alpha.ContinuousBackupConfig = (function() { - - /** - * Properties of a ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IContinuousBackupConfig - * @property {boolean|null} [enabled] ContinuousBackupConfig enabled - * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig - */ - - /** - * Constructs a new ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ContinuousBackupConfig. - * @implements IContinuousBackupConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set - */ - function ContinuousBackupConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.enabled = null; - - /** - * ContinuousBackupConfig recoveryWindowDays. - * @member {number} recoveryWindowDays - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.recoveryWindowDays = 0; - - /** - * ContinuousBackupConfig encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig instance - */ - ContinuousBackupConfig.create = function create(properties) { - return new ContinuousBackupConfig(properties); - }; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 4: { - message.recoveryWindowDays = reader.int32(); - break; - } - case 3: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - if (!$util.isInteger(message.recoveryWindowDays)) - return "recoveryWindowDays: integer expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} ContinuousBackupConfig - */ - ContinuousBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.recoveryWindowDays != null) - message.recoveryWindowDays = object.recoveryWindowDays | 0; - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupConfig} message ContinuousBackupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.encryptionConfig = null; - object.recoveryWindowDays = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - object.recoveryWindowDays = message.recoveryWindowDays; - return object; - }; - - /** - * Converts this ContinuousBackupConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupConfig"; - }; - - return ContinuousBackupConfig; - })(); - - v1alpha.ContinuousBackupInfo = (function() { - - /** - * Properties of a ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1alpha - * @interface IContinuousBackupInfo - * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo - * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime - * @property {Array.|null} [schedule] ContinuousBackupInfo schedule - * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime - */ - - /** - * Constructs a new ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ContinuousBackupInfo. - * @implements IContinuousBackupInfo - * @constructor - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set - */ - function ContinuousBackupInfo(properties) { - this.schedule = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupInfo encryptionInfo. - * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.encryptionInfo = null; - - /** - * ContinuousBackupInfo enabledTime. - * @member {google.protobuf.ITimestamp|null|undefined} enabledTime - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.enabledTime = null; - - /** - * ContinuousBackupInfo schedule. - * @member {Array.} schedule - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.schedule = $util.emptyArray; - - /** - * ContinuousBackupInfo earliestRestorableTime. - * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.earliestRestorableTime = null; - - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo instance - */ - ContinuousBackupInfo.create = function create(properties) { - return new ContinuousBackupInfo(properties); - }; - - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) - $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.schedule != null && message.schedule.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.schedule.length; ++i) - writer.int32(message.schedule[i]); - writer.ldelim(); - } - if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) - $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 2: { - message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.schedule && message.schedule.length)) - message.schedule = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.schedule.push(reader.int32()); - } else - message.schedule.push(reader.int32()); - break; - } - case 4: { - message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); - if (error) - return "enabledTime." + error; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - if (!Array.isArray(message.schedule)) - return "schedule: array expected"; - for (var i = 0; i < message.schedule.length; ++i) - switch (message.schedule[i]) { - default: - return "schedule: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); - if (error) - return "earliestRestorableTime." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} ContinuousBackupInfo - */ - ContinuousBackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo(); - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.enabledTime != null) { - if (typeof object.enabledTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.enabledTime: object expected"); - message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); - } - if (object.schedule) { - if (!Array.isArray(object.schedule)) - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.schedule: array expected"); - message.schedule = []; - for (var i = 0; i < object.schedule.length; ++i) - switch (object.schedule[i]) { - default: - if (typeof object.schedule[i] === "number") { - message.schedule[i] = object.schedule[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.schedule[i] = 0; - break; - case "MONDAY": - case 1: - message.schedule[i] = 1; - break; - case "TUESDAY": - case 2: - message.schedule[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.schedule[i] = 3; - break; - case "THURSDAY": - case 4: - message.schedule[i] = 4; - break; - case "FRIDAY": - case 5: - message.schedule[i] = 5; - break; - case "SATURDAY": - case 6: - message.schedule[i] = 6; - break; - case "SUNDAY": - case 7: - message.schedule[i] = 7; - break; - } - } - if (object.earliestRestorableTime != null) { - if (typeof object.earliestRestorableTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupInfo.earliestRestorableTime: object expected"); - message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupInfo} message ContinuousBackupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schedule = []; - if (options.defaults) { - object.encryptionInfo = null; - object.enabledTime = null; - object.earliestRestorableTime = null; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) - object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); - if (message.schedule && message.schedule.length) { - object.schedule = []; - for (var j = 0; j < message.schedule.length; ++j) - object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; - } - if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) - object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); - return object; - }; - - /** - * Converts this ContinuousBackupInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupInfo"; - }; - - return ContinuousBackupInfo; - })(); - - v1alpha.BackupSource = (function() { - - /** - * Properties of a BackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBackupSource - * @property {string|null} [backupUid] BackupSource backupUid - * @property {string|null} [backupName] BackupSource backupName - */ - - /** - * Constructs a new BackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BackupSource. - * @implements IBackupSource - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set - */ - function BackupSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @instance - */ - BackupSource.prototype.backupUid = ""; - - /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @instance - */ - BackupSource.prototype.backupName = ""; - - /** - * Creates a new BackupSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.IBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource instance - */ - BackupSource.create = function create(properties) { - return new BackupSource(properties); - }; - - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); - if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); - return writer; - }; - - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BackupSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.IBackupSource} message BackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.backupUid = reader.string(); - break; - } - case 1: { - message.backupName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupSource message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - if (!$util.isString(message.backupUid)) - return "backupUid: string expected"; - if (message.backupName != null && message.hasOwnProperty("backupName")) - if (!$util.isString(message.backupName)) - return "backupName: string expected"; - return null; - }; - - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BackupSource} BackupSource - */ - BackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BackupSource) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.BackupSource(); - if (object.backupUid != null) - message.backupUid = String(object.backupUid); - if (object.backupName != null) - message.backupName = String(object.backupName); - return message; - }; - - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.BackupSource} message BackupSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupName = ""; - object.backupUid = ""; - } - if (message.backupName != null && message.hasOwnProperty("backupName")) - object.backupName = message.backupName; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - object.backupUid = message.backupUid; - return object; - }; - - /** - * Converts this BackupSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @instance - * @returns {Object.} JSON object - */ - BackupSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BackupSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BackupSource"; - }; - - return BackupSource; - })(); - - v1alpha.ContinuousBackupSource = (function() { - - /** - * Properties of a ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @interface IContinuousBackupSource - * @property {string|null} [cluster] ContinuousBackupSource cluster - * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime - */ - - /** - * Constructs a new ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ContinuousBackupSource. - * @implements IContinuousBackupSource - * @constructor - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set - */ - function ContinuousBackupSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupSource cluster. - * @member {string} cluster - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @instance - */ - ContinuousBackupSource.prototype.cluster = ""; - - /** - * ContinuousBackupSource pointInTime. - * @member {google.protobuf.ITimestamp|null|undefined} pointInTime - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @instance - */ - ContinuousBackupSource.prototype.pointInTime = null; - - /** - * Creates a new ContinuousBackupSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource instance - */ - ContinuousBackupSource.create = function create(properties) { - return new ContinuousBackupSource(properties); - }; - - /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); - if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cluster = reader.string(); - break; - } - case 2: { - message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupSource message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) - if (!$util.isString(message.cluster)) - return "cluster: string expected"; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); - if (error) - return "pointInTime." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ContinuousBackupSource} ContinuousBackupSource - */ - ContinuousBackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource(); - if (object.cluster != null) - message.cluster = String(object.cluster); - if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ContinuousBackupSource.pointInTime: object expected"); - message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupSource} message ContinuousBackupSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cluster = ""; - object.pointInTime = null; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = message.cluster; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - return object; - }; - - /** - * Converts this ContinuousBackupSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ContinuousBackupSource"; - }; - - return ContinuousBackupSource; - })(); - - v1alpha.MaintenanceUpdatePolicy = (function() { - - /** - * Properties of a MaintenanceUpdatePolicy. - * @memberof google.cloud.alloydb.v1alpha - * @interface IMaintenanceUpdatePolicy - * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows - * @property {Array.|null} [denyMaintenancePeriods] MaintenanceUpdatePolicy denyMaintenancePeriods - */ - - /** - * Constructs a new MaintenanceUpdatePolicy. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a MaintenanceUpdatePolicy. - * @implements IMaintenanceUpdatePolicy - * @constructor - * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy=} [properties] Properties to set - */ - function MaintenanceUpdatePolicy(properties) { - this.maintenanceWindows = []; - this.denyMaintenancePeriods = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceUpdatePolicy maintenanceWindows. - * @member {Array.} maintenanceWindows - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @instance - */ - MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; - - /** - * MaintenanceUpdatePolicy denyMaintenancePeriods. - * @member {Array.} denyMaintenancePeriods - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @instance - */ - MaintenanceUpdatePolicy.prototype.denyMaintenancePeriods = $util.emptyArray; - - /** - * Creates a new MaintenanceUpdatePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance - */ - MaintenanceUpdatePolicy.create = function create(properties) { - return new MaintenanceUpdatePolicy(properties); - }; - - /** - * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceUpdatePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maintenanceWindows != null && message.maintenanceWindows.length) - for (var i = 0; i < message.maintenanceWindows.length; ++i) - $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) - for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) - $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceUpdatePolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.maintenanceWindows && message.maintenanceWindows.length)) - message.maintenanceWindows = []; - message.maintenanceWindows.push($root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.denyMaintenancePeriods && message.denyMaintenancePeriods.length)) - message.denyMaintenancePeriods = []; - message.denyMaintenancePeriods.push($root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceUpdatePolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceUpdatePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { - if (!Array.isArray(message.maintenanceWindows)) - return "maintenanceWindows: array expected"; - for (var i = 0; i < message.maintenanceWindows.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); - if (error) - return "maintenanceWindows." + error; - } - } - if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { - if (!Array.isArray(message.denyMaintenancePeriods)) - return "denyMaintenancePeriods: array expected"; - for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify(message.denyMaintenancePeriods[i]); - if (error) - return "denyMaintenancePeriods." + error; - } - } - return null; - }; - - /** - * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - */ - MaintenanceUpdatePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy(); - if (object.maintenanceWindows) { - if (!Array.isArray(object.maintenanceWindows)) - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); - message.maintenanceWindows = []; - for (var i = 0; i < object.maintenanceWindows.length; ++i) { - if (typeof object.maintenanceWindows[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); - message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); - } - } - if (object.denyMaintenancePeriods) { - if (!Array.isArray(object.denyMaintenancePeriods)) - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.denyMaintenancePeriods: array expected"); - message.denyMaintenancePeriods = []; - for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { - if (typeof object.denyMaintenancePeriods[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.denyMaintenancePeriods: object expected"); - message.denyMaintenancePeriods[i] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceUpdatePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.maintenanceWindows = []; - object.denyMaintenancePeriods = []; - } - if (message.maintenanceWindows && message.maintenanceWindows.length) { - object.maintenanceWindows = []; - for (var j = 0; j < message.maintenanceWindows.length; ++j) - object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); - } - if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { - object.denyMaintenancePeriods = []; - for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) - object.denyMaintenancePeriods[j] = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); - } - return object; - }; - - /** - * Converts this MaintenanceUpdatePolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @instance - * @returns {Object.} JSON object - */ - MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceUpdatePolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy"; - }; - - MaintenanceUpdatePolicy.MaintenanceWindow = (function() { - - /** - * Properties of a MaintenanceWindow. - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @interface IMaintenanceWindow - * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day - * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime - */ - - /** - * Constructs a new MaintenanceWindow. - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @classdesc Represents a MaintenanceWindow. - * @implements IMaintenanceWindow - * @constructor - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set - */ - function MaintenanceWindow(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceWindow day. - * @member {google.type.DayOfWeek} day - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.day = 0; - - /** - * MaintenanceWindow startTime. - * @member {google.type.ITimeOfDay|null|undefined} startTime - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.startTime = null; - - /** - * Creates a new MaintenanceWindow instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance - */ - MaintenanceWindow.create = function create(properties) { - return new MaintenanceWindow(properties); - }; - - /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceWindow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.day = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceWindow message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceWindow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.day != null && message.hasOwnProperty("day")) - switch (message.day) { - default: - return "day: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.type.TimeOfDay.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - */ - MaintenanceWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow(); - switch (object.day) { - default: - if (typeof object.day === "number") { - message.day = object.day; - break; - } - break; - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.day = 0; - break; - case "MONDAY": - case 1: - message.day = 1; - break; - case "TUESDAY": - case 2: - message.day = 2; - break; - case "WEDNESDAY": - case 3: - message.day = 3; - break; - case "THURSDAY": - case 4: - message.day = 4; - break; - case "FRIDAY": - case 5: - message.day = 5; - break; - case "SATURDAY": - case 6: - message.day = 6; - break; - case "SUNDAY": - case 7: - message.day = 7; - break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); - message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceWindow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; - object.startTime = null; - } - if (message.day != null && message.hasOwnProperty("day")) - object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this MaintenanceWindow to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - * @returns {Object.} JSON object - */ - MaintenanceWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceWindow - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.MaintenanceWindow"; - }; - - return MaintenanceWindow; - })(); - - MaintenanceUpdatePolicy.DenyMaintenancePeriod = (function() { - - /** - * Properties of a DenyMaintenancePeriod. - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @interface IDenyMaintenancePeriod - * @property {google.type.IDate|null} [startDate] DenyMaintenancePeriod startDate - * @property {google.type.IDate|null} [endDate] DenyMaintenancePeriod endDate - * @property {google.type.ITimeOfDay|null} [time] DenyMaintenancePeriod time - */ - - /** - * Constructs a new DenyMaintenancePeriod. - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy - * @classdesc Represents a DenyMaintenancePeriod. - * @implements IDenyMaintenancePeriod - * @constructor - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set - */ - function DenyMaintenancePeriod(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenyMaintenancePeriod startDate. - * @member {google.type.IDate|null|undefined} startDate - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.startDate = null; - - /** - * DenyMaintenancePeriod endDate. - * @member {google.type.IDate|null|undefined} endDate - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.endDate = null; - - /** - * DenyMaintenancePeriod time. - * @member {google.type.ITimeOfDay|null|undefined} time - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.time = null; - - /** - * Creates a new DenyMaintenancePeriod instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod instance - */ - DenyMaintenancePeriod.create = function create(properties) { - return new DenyMaintenancePeriod(properties); - }; - - /** - * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenyMaintenancePeriod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) - $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) - $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenyMaintenancePeriod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 3: { - message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenyMaintenancePeriod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenyMaintenancePeriod message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenyMaintenancePeriod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startDate != null && message.hasOwnProperty("startDate")) { - var error = $root.google.type.Date.verify(message.startDate); - if (error) - return "startDate." + error; - } - if (message.endDate != null && message.hasOwnProperty("endDate")) { - var error = $root.google.type.Date.verify(message.endDate); - if (error) - return "endDate." + error; - } - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.type.TimeOfDay.verify(message.time); - if (error) - return "time." + error; - } - return null; - }; - - /** - * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - */ - DenyMaintenancePeriod.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); - if (object.startDate != null) { - if (typeof object.startDate !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.startDate: object expected"); - message.startDate = $root.google.type.Date.fromObject(object.startDate); - } - if (object.endDate != null) { - if (typeof object.endDate !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.endDate: object expected"); - message.endDate = $root.google.type.Date.fromObject(object.endDate); - } - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod.time: object expected"); - message.time = $root.google.type.TimeOfDay.fromObject(object.time); - } - return message; - }; - - /** - * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod} message DenyMaintenancePeriod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenyMaintenancePeriod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startDate = null; - object.endDate = null; - object.time = null; - } - if (message.startDate != null && message.hasOwnProperty("startDate")) - object.startDate = $root.google.type.Date.toObject(message.startDate, options); - if (message.endDate != null && message.hasOwnProperty("endDate")) - object.endDate = $root.google.type.Date.toObject(message.endDate, options); - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.type.TimeOfDay.toObject(message.time, options); - return object; - }; - - /** - * Converts this DenyMaintenancePeriod to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - * @returns {Object.} JSON object - */ - DenyMaintenancePeriod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DenyMaintenancePeriod - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DenyMaintenancePeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.DenyMaintenancePeriod"; - }; - - return DenyMaintenancePeriod; - })(); - - return MaintenanceUpdatePolicy; - })(); - - v1alpha.MaintenanceSchedule = (function() { - - /** - * Properties of a MaintenanceSchedule. - * @memberof google.cloud.alloydb.v1alpha - * @interface IMaintenanceSchedule - * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime - */ - - /** - * Constructs a new MaintenanceSchedule. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a MaintenanceSchedule. - * @implements IMaintenanceSchedule - * @constructor - * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule=} [properties] Properties to set - */ - function MaintenanceSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceSchedule startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @instance - */ - MaintenanceSchedule.prototype.startTime = null; - - /** - * Creates a new MaintenanceSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule instance - */ - MaintenanceSchedule.create = function create(properties) { - return new MaintenanceSchedule(properties); - }; - - /** - * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceSchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.MaintenanceSchedule} MaintenanceSchedule - */ - MaintenanceSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.MaintenanceSchedule.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.MaintenanceSchedule} message MaintenanceSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.startTime = null; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this MaintenanceSchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @instance - * @returns {Object.} JSON object - */ - MaintenanceSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceSchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.MaintenanceSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.MaintenanceSchedule"; - }; - - return MaintenanceSchedule; - })(); - - v1alpha.Cluster = (function() { - - /** - * Properties of a Cluster. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICluster - * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] Cluster backupSource - * @property {google.cloud.alloydb.v1alpha.IMigrationSource|null} [migrationSource] Cluster migrationSource - * @property {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] Cluster cloudsqlBackupRunSource - * @property {string|null} [name] Cluster name - * @property {string|null} [displayName] Cluster displayName - * @property {string|null} [uid] Cluster uid - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.alloydb.v1alpha.Cluster.State|null} [state] Cluster state - * @property {google.cloud.alloydb.v1alpha.Cluster.ClusterType|null} [clusterType] Cluster clusterType - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion - * @property {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig - * @property {string|null} [network] Cluster network - * @property {string|null} [etag] Cluster etag - * @property {Object.|null} [annotations] Cluster annotations - * @property {boolean|null} [reconciling] Cluster reconciling - * @property {google.cloud.alloydb.v1alpha.IUserPassword|null} [initialUser] Cluster initialUser - * @property {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy - * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] Cluster sslConfig - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig - * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo - * @property {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig - * @property {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo - * @property {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig - * @property {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig - * @property {boolean|null} [satisfiesPzi] Cluster satisfiesPzi - * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs - * @property {google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null} [pscConfig] Cluster pscConfig - * @property {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy - * @property {google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule - * @property {google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null} [geminiConfig] Cluster geminiConfig - * @property {google.cloud.alloydb.v1alpha.SubscriptionType|null} [subscriptionType] Cluster subscriptionType - * @property {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata - * @property {Object.|null} [tags] Cluster tags - * @property {string|null} [serviceAccountEmail] Cluster serviceAccountEmail - * @property {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig - */ - - /** - * Constructs a new Cluster. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a Cluster. - * @implements ICluster - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set - */ - function Cluster(properties) { - this.labels = {}; - this.annotations = {}; - this.tags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Cluster backupSource. - * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.backupSource = null; - - /** - * Cluster migrationSource. - * @member {google.cloud.alloydb.v1alpha.IMigrationSource|null|undefined} migrationSource - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.migrationSource = null; - - /** - * Cluster cloudsqlBackupRunSource. - * @member {google.cloud.alloydb.v1alpha.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.cloudsqlBackupRunSource = null; - - /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.name = ""; - - /** - * Cluster displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.displayName = ""; - - /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.uid = ""; - - /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.createTime = null; - - /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.updateTime = null; - - /** - * Cluster deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.deleteTime = null; - - /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.labels = $util.emptyObject; - - /** - * Cluster state. - * @member {google.cloud.alloydb.v1alpha.Cluster.State} state - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.state = 0; - - /** - * Cluster clusterType. - * @member {google.cloud.alloydb.v1alpha.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.clusterType = 0; - - /** - * Cluster databaseVersion. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.databaseVersion = 0; - - /** - * Cluster networkConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.networkConfig = null; - - /** - * Cluster network. - * @member {string} network - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.network = ""; - - /** - * Cluster etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.etag = ""; - - /** - * Cluster annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.annotations = $util.emptyObject; - - /** - * Cluster reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.reconciling = false; - - /** - * Cluster initialUser. - * @member {google.cloud.alloydb.v1alpha.IUserPassword|null|undefined} initialUser - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.initialUser = null; - - /** - * Cluster automatedBackupPolicy. - * @member {google.cloud.alloydb.v1alpha.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.automatedBackupPolicy = null; - - /** - * Cluster sslConfig. - * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.sslConfig = null; - - /** - * Cluster encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.encryptionConfig = null; - - /** - * Cluster encryptionInfo. - * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.encryptionInfo = null; - - /** - * Cluster continuousBackupConfig. - * @member {google.cloud.alloydb.v1alpha.IContinuousBackupConfig|null|undefined} continuousBackupConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.continuousBackupConfig = null; - - /** - * Cluster continuousBackupInfo. - * @member {google.cloud.alloydb.v1alpha.IContinuousBackupInfo|null|undefined} continuousBackupInfo - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.continuousBackupInfo = null; - - /** - * Cluster secondaryConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig|null|undefined} secondaryConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.secondaryConfig = null; - - /** - * Cluster primaryConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig|null|undefined} primaryConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.primaryConfig = null; - - /** - * Cluster satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.satisfiesPzi = false; - - /** - * Cluster satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.satisfiesPzs = false; - - /** - * Cluster pscConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.IPscConfig|null|undefined} pscConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.pscConfig = null; - - /** - * Cluster maintenanceUpdatePolicy. - * @member {google.cloud.alloydb.v1alpha.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.maintenanceUpdatePolicy = null; - - /** - * Cluster maintenanceSchedule. - * @member {google.cloud.alloydb.v1alpha.IMaintenanceSchedule|null|undefined} maintenanceSchedule - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.maintenanceSchedule = null; - - /** - * Cluster geminiConfig. - * @member {google.cloud.alloydb.v1alpha.IGeminiClusterConfig|null|undefined} geminiConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.geminiConfig = null; - - /** - * Cluster subscriptionType. - * @member {google.cloud.alloydb.v1alpha.SubscriptionType} subscriptionType - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.subscriptionType = 0; - - /** - * Cluster trialMetadata. - * @member {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null|undefined} trialMetadata - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.trialMetadata = null; - - /** - * Cluster tags. - * @member {Object.} tags - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.tags = $util.emptyObject; - - /** - * Cluster serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.serviceAccountEmail = ""; - - /** - * Cluster dataplexConfig. - * @member {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null|undefined} dataplexConfig - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Cluster.prototype.dataplexConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|"cloudsqlBackupRunSource"|undefined} source - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource", "cloudsqlBackupRunSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Cluster instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {google.cloud.alloydb.v1alpha.ICluster=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster instance - */ - Cluster.create = function create(properties) { - return new Cluster(properties); - }; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); - if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) - $root.google.cloud.alloydb.v1alpha.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) - $root.google.cloud.alloydb.v1alpha.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) - $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); - if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) - $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) - $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); - if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.encode(message.pscConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) - $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzi); - if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) - $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.encode(message.geminiConfig, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) - $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.subscriptionType != null && Object.hasOwnProperty.call(message, "subscriptionType")) - writer.uint32(/* id 38, wireType 0 =*/304).int32(message.subscriptionType); - if (message.trialMetadata != null && Object.hasOwnProperty.call(message, "trialMetadata")) - $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.encode(message.trialMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); - if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) - $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 46, wireType 2 =*/370).string(message.serviceAccountEmail); - if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) - $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {google.cloud.alloydb.v1alpha.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 15: { - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); - break; - } - case 16: { - message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.decode(reader, reader.uint32()); - break; - } - case 42: { - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 24: { - message.clusterType = reader.int32(); - break; - } - case 9: { - message.databaseVersion = reader.int32(); - break; - } - case 29: { - message.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.network = reader.string(); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 12: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 13: { - message.reconciling = reader.bool(); - break; - } - case 14: { - message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.decode(reader, reader.uint32()); - break; - } - case 17: { - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.decode(reader, reader.uint32()); - break; - } - case 18: { - message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 27: { - message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.decode(reader, reader.uint32()); - break; - } - case 28: { - message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.decode(reader, reader.uint32()); - break; - } - case 22: { - message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.decode(reader, reader.uint32()); - break; - } - case 23: { - message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.decode(reader, reader.uint32()); - break; - } - case 33: { - message.satisfiesPzi = reader.bool(); - break; - } - case 30: { - message.satisfiesPzs = reader.bool(); - break; - } - case 31: { - message.pscConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.decode(reader, reader.uint32()); - break; - } - case 32: { - message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); - break; - } - case 37: { - message.maintenanceSchedule = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.decode(reader, reader.uint32()); - break; - } - case 36: { - message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.decode(reader, reader.uint32()); - break; - } - case 38: { - message.subscriptionType = reader.int32(); - break; - } - case 39: { - message.trialMetadata = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.decode(reader, reader.uint32()); - break; - } - case 41: { - if (message.tags === $util.emptyObject) - message.tags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.tags[key] = value; - break; - } - case 46: { - message.serviceAccountEmail = reader.string(); - break; - } - case 47: { - message.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cluster message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cluster.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.MigrationSource.verify(message.migrationSource); - if (error) - return "migrationSource." + error; - } - } - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); - if (error) - return "cloudsqlBackupRunSource." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) { - var error = $root.google.cloud.alloydb.v1alpha.UserPassword.verify(message.initialUser); - if (error) - return "initialUser." + error; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { - var error = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); - if (error) - return "automatedBackupPolicy." + error; - } - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.verify(message.continuousBackupConfig); - if (error) - return "continuousBackupConfig." + error; - } - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.verify(message.continuousBackupInfo); - if (error) - return "continuousBackupInfo." + error; - } - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify(message.secondaryConfig); - if (error) - return "secondaryConfig." + error; - } - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify(message.primaryConfig); - if (error) - return "primaryConfig." + error; - } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify(message.pscConfig); - if (error) - return "pscConfig." + error; - } - if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { - var error = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); - if (error) - return "maintenanceUpdatePolicy." + error; - } - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { - var error = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.verify(message.maintenanceSchedule); - if (error) - return "maintenanceSchedule." + error; - } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify(message.geminiConfig); - if (error) - return "geminiConfig." + error; - } - if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) - switch (message.subscriptionType) { - default: - return "subscriptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify(message.trialMetadata); - if (error) - return "trialMetadata." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!$util.isObject(message.tags)) - return "tags: object expected"; - var key = Object.keys(message.tags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.tags[key[i]])) - return "tags: string{k:string} expected"; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify(message.dataplexConfig); - if (error) - return "dataplexConfig." + error; - } - return null; - }; - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster} Cluster - */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); - } - if (object.migrationSource != null) { - if (typeof object.migrationSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.migrationSource: object expected"); - message.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.fromObject(object.migrationSource); - } - if (object.cloudsqlBackupRunSource != null) { - if (typeof object.cloudsqlBackupRunSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.cloudsqlBackupRunSource: object expected"); - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "EMPTY": - case 3: - message.state = 3; - break; - case "CREATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 7: - message.state = 7; - break; - case "MAINTENANCE": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.databaseVersion = 6; - break; - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.fromObject(object.networkConfig); - } - if (object.network != null) - message.network = String(object.network); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.initialUser != null) { - if (typeof object.initialUser !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.initialUser: object expected"); - message.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.fromObject(object.initialUser); - } - if (object.automatedBackupPolicy != null) { - if (typeof object.automatedBackupPolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.automatedBackupPolicy: object expected"); - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); - } - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.continuousBackupConfig != null) { - if (typeof object.continuousBackupConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupConfig: object expected"); - message.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); - } - if (object.continuousBackupInfo != null) { - if (typeof object.continuousBackupInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.continuousBackupInfo: object expected"); - message.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); - } - if (object.secondaryConfig != null) { - if (typeof object.secondaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.secondaryConfig: object expected"); - message.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); - } - if (object.primaryConfig != null) { - if (typeof object.primaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.primaryConfig: object expected"); - message.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.fromObject(object.primaryConfig); - } - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.pscConfig != null) { - if (typeof object.pscConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.pscConfig: object expected"); - message.pscConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.fromObject(object.pscConfig); - } - if (object.maintenanceUpdatePolicy != null) { - if (typeof object.maintenanceUpdatePolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.maintenanceUpdatePolicy: object expected"); - message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); - } - if (object.maintenanceSchedule != null) { - if (typeof object.maintenanceSchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.maintenanceSchedule: object expected"); - message.maintenanceSchedule = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.fromObject(object.maintenanceSchedule); - } - if (object.geminiConfig != null) { - if (typeof object.geminiConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.geminiConfig: object expected"); - message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.fromObject(object.geminiConfig); - } - switch (object.subscriptionType) { - default: - if (typeof object.subscriptionType === "number") { - message.subscriptionType = object.subscriptionType; - break; - } - break; - case "SUBSCRIPTION_TYPE_UNSPECIFIED": - case 0: - message.subscriptionType = 0; - break; - case "STANDARD": - case 1: - message.subscriptionType = 1; - break; - case "TRIAL": - case 2: - message.subscriptionType = 2; - break; - } - if (object.trialMetadata != null) { - if (typeof object.trialMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.trialMetadata: object expected"); - message.trialMetadata = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.fromObject(object.trialMetadata); - } - if (object.tags) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.tags: object expected"); - message.tags = {}; - for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) - message.tags[keys[i]] = String(object.tags[keys[i]]); - } - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.dataplexConfig != null) { - if (typeof object.dataplexConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.dataplexConfig: object expected"); - message.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.fromObject(object.dataplexConfig); - } - return message; - }; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster} message Cluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cluster.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - object.tags = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.network = ""; - object.etag = ""; - object.reconciling = false; - object.initialUser = null; - object.automatedBackupPolicy = null; - object.sslConfig = null; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.secondaryConfig = null; - object.primaryConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.continuousBackupConfig = null; - object.continuousBackupInfo = null; - object.networkConfig = null; - object.satisfiesPzs = false; - object.pscConfig = null; - object.maintenanceUpdatePolicy = null; - object.satisfiesPzi = false; - object.geminiConfig = null; - object.maintenanceSchedule = null; - object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; - object.trialMetadata = null; - object.serviceAccountEmail = ""; - object.dataplexConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Cluster.State[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) - object.initialUser = $root.google.cloud.alloydb.v1alpha.UserPassword.toObject(message.initialUser, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - object.migrationSource = $root.google.cloud.alloydb.v1alpha.MigrationSource.toObject(message.migrationSource, options); - if (options.oneofs) - object.source = "migrationSource"; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) - object.automatedBackupPolicy = $root.google.cloud.alloydb.v1alpha.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) - object.secondaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) - object.primaryConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) - object.continuousBackupConfig = $root.google.cloud.alloydb.v1alpha.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) - object.continuousBackupInfo = $root.google.cloud.alloydb.v1alpha.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.toObject(message.networkConfig, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) - object.pscConfig = $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig.toObject(message.pscConfig, options); - if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) - object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1alpha.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) - object.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig.toObject(message.geminiConfig, options); - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) - object.maintenanceSchedule = $root.google.cloud.alloydb.v1alpha.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); - if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) - object.subscriptionType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SubscriptionType[message.subscriptionType] === undefined ? message.subscriptionType : $root.google.cloud.alloydb.v1alpha.SubscriptionType[message.subscriptionType] : message.subscriptionType; - if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) - object.trialMetadata = $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.toObject(message.trialMetadata, options); - if (message.tags && (keys2 = Object.keys(message.tags)).length) { - object.tags = {}; - for (var j = 0; j < keys2.length; ++j) - object.tags[keys2[j]] = message.tags[keys2[j]]; - } - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); - if (options.oneofs) - object.source = "cloudsqlBackupRunSource"; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) - object.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); - return object; - }; - - /** - * Converts this Cluster to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - * @returns {Object.} JSON object - */ - Cluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cluster - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster"; - }; - - Cluster.NetworkConfig = (function() { - - /** - * Properties of a NetworkConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface INetworkConfig - * @property {string|null} [network] NetworkConfig network - * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange - */ - - /** - * Constructs a new NetworkConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a NetworkConfig. - * @implements INetworkConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig=} [properties] Properties to set - */ - function NetworkConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkConfig network. - * @member {string} network - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @instance - */ - NetworkConfig.prototype.network = ""; - - /** - * NetworkConfig allocatedIpRange. - * @member {string} allocatedIpRange - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @instance - */ - NetworkConfig.prototype.allocatedIpRange = ""; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig instance - */ - NetworkConfig.create = function create(properties) { - return new NetworkConfig(properties); - }; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); - return writer; - }; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.NetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.allocatedIpRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) - if (!$util.isString(message.allocatedIpRange)) - return "allocatedIpRange: string expected"; - return null; - }; - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} NetworkConfig - */ - NetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.NetworkConfig(); - if (object.network != null) - message.network = String(object.network); - if (object.allocatedIpRange != null) - message.allocatedIpRange = String(object.allocatedIpRange); - return message; - }; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.NetworkConfig} message NetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.allocatedIpRange = ""; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) - object.allocatedIpRange = message.allocatedIpRange; - return object; - }; - - /** - * Converts this NetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @instance - * @returns {Object.} JSON object - */ - NetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.NetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.NetworkConfig"; - }; - - return NetworkConfig; - })(); - - Cluster.SecondaryConfig = (function() { - - /** - * Properties of a SecondaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface ISecondaryConfig - * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName - */ - - /** - * Constructs a new SecondaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a SecondaryConfig. - * @implements ISecondaryConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set - */ - function SecondaryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecondaryConfig primaryClusterName. - * @member {string} primaryClusterName - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @instance - */ - SecondaryConfig.prototype.primaryClusterName = ""; - - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig instance - */ - SecondaryConfig.create = function create(properties) { - return new SecondaryConfig(properties); - }; - - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); - return writer; - }; - - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.primaryClusterName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecondaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecondaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - if (!$util.isString(message.primaryClusterName)) - return "primaryClusterName: string expected"; - return null; - }; - - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} SecondaryConfig - */ - SecondaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig(); - if (object.primaryClusterName != null) - message.primaryClusterName = String(object.primaryClusterName); - return message; - }; - - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig} message SecondaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecondaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.primaryClusterName = ""; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - object.primaryClusterName = message.primaryClusterName; - return object; - }; - - /** - * Converts this SecondaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @instance - * @returns {Object.} JSON object - */ - SecondaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecondaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.SecondaryConfig"; - }; - - return SecondaryConfig; - })(); - - Cluster.PrimaryConfig = (function() { - - /** - * Properties of a PrimaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface IPrimaryConfig - * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames - */ - - /** - * Constructs a new PrimaryConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a PrimaryConfig. - * @implements IPrimaryConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set - */ - function PrimaryConfig(properties) { - this.secondaryClusterNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PrimaryConfig secondaryClusterNames. - * @member {Array.} secondaryClusterNames - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @instance - */ - PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; - - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig instance - */ - PrimaryConfig.create = function create(properties) { - return new PrimaryConfig(properties); - }; - - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); - return writer; - }; - - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) - message.secondaryClusterNames = []; - message.secondaryClusterNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PrimaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrimaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { - if (!Array.isArray(message.secondaryClusterNames)) - return "secondaryClusterNames: array expected"; - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - if (!$util.isString(message.secondaryClusterNames[i])) - return "secondaryClusterNames: string[] expected"; - } - return null; - }; - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} PrimaryConfig - */ - PrimaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig(); - if (object.secondaryClusterNames) { - if (!Array.isArray(object.secondaryClusterNames)) - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); - message.secondaryClusterNames = []; - for (var i = 0; i < object.secondaryClusterNames.length; ++i) - message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig} message PrimaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrimaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.secondaryClusterNames = []; - if (message.secondaryClusterNames && message.secondaryClusterNames.length) { - object.secondaryClusterNames = []; - for (var j = 0; j < message.secondaryClusterNames.length; ++j) - object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; - } - return object; - }; - - /** - * Converts this PrimaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @instance - * @returns {Object.} JSON object - */ - PrimaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PrimaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.PrimaryConfig"; - }; - - return PrimaryConfig; - })(); - - Cluster.PscConfig = (function() { - - /** - * Properties of a PscConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface IPscConfig - * @property {boolean|null} [pscEnabled] PscConfig pscEnabled - * @property {number|Long|null} [serviceOwnedProjectNumber] PscConfig serviceOwnedProjectNumber - */ - - /** - * Constructs a new PscConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a PscConfig. - * @implements IPscConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig=} [properties] Properties to set - */ - function PscConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscConfig pscEnabled. - * @member {boolean} pscEnabled - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @instance - */ - PscConfig.prototype.pscEnabled = false; - - /** - * PscConfig serviceOwnedProjectNumber. - * @member {number|Long} serviceOwnedProjectNumber - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @instance - */ - PscConfig.prototype.serviceOwnedProjectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PscConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig instance - */ - PscConfig.create = function create(properties) { - return new PscConfig(properties); - }; - - /** - * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig} message PscConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); - if (message.serviceOwnedProjectNumber != null && Object.hasOwnProperty.call(message, "serviceOwnedProjectNumber")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.serviceOwnedProjectNumber); - return writer; - }; - - /** - * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.PscConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IPscConfig} message PscConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pscEnabled = reader.bool(); - break; - } - case 3: { - message.serviceOwnedProjectNumber = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - if (typeof message.pscEnabled !== "boolean") - return "pscEnabled: boolean expected"; - if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) - if (!$util.isInteger(message.serviceOwnedProjectNumber) && !(message.serviceOwnedProjectNumber && $util.isInteger(message.serviceOwnedProjectNumber.low) && $util.isInteger(message.serviceOwnedProjectNumber.high))) - return "serviceOwnedProjectNumber: integer|Long expected"; - return null; - }; - - /** - * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.PscConfig} PscConfig - */ - PscConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.PscConfig(); - if (object.pscEnabled != null) - message.pscEnabled = Boolean(object.pscEnabled); - if (object.serviceOwnedProjectNumber != null) - if ($util.Long) - (message.serviceOwnedProjectNumber = $util.Long.fromValue(object.serviceOwnedProjectNumber)).unsigned = false; - else if (typeof object.serviceOwnedProjectNumber === "string") - message.serviceOwnedProjectNumber = parseInt(object.serviceOwnedProjectNumber, 10); - else if (typeof object.serviceOwnedProjectNumber === "number") - message.serviceOwnedProjectNumber = object.serviceOwnedProjectNumber; - else if (typeof object.serviceOwnedProjectNumber === "object") - message.serviceOwnedProjectNumber = new $util.LongBits(object.serviceOwnedProjectNumber.low >>> 0, object.serviceOwnedProjectNumber.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PscConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.PscConfig} message PscConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pscEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.serviceOwnedProjectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.serviceOwnedProjectNumber = options.longs === String ? "0" : 0; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) - if (typeof message.serviceOwnedProjectNumber === "number") - object.serviceOwnedProjectNumber = options.longs === String ? String(message.serviceOwnedProjectNumber) : message.serviceOwnedProjectNumber; - else - object.serviceOwnedProjectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.serviceOwnedProjectNumber) : options.longs === Number ? new $util.LongBits(message.serviceOwnedProjectNumber.low >>> 0, message.serviceOwnedProjectNumber.high >>> 0).toNumber() : message.serviceOwnedProjectNumber; - return object; - }; - - /** - * Converts this PscConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @instance - * @returns {Object.} JSON object - */ - PscConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.PscConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.PscConfig"; - }; - - return PscConfig; - })(); - - Cluster.TrialMetadata = (function() { - - /** - * Properties of a TrialMetadata. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface ITrialMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] TrialMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TrialMetadata endTime - * @property {google.protobuf.ITimestamp|null} [upgradeTime] TrialMetadata upgradeTime - * @property {google.protobuf.ITimestamp|null} [graceEndTime] TrialMetadata graceEndTime - */ - - /** - * Constructs a new TrialMetadata. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a TrialMetadata. - * @implements ITrialMetadata - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata=} [properties] Properties to set - */ - function TrialMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrialMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.startTime = null; - - /** - * TrialMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.endTime = null; - - /** - * TrialMetadata upgradeTime. - * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.upgradeTime = null; - - /** - * TrialMetadata graceEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} graceEndTime - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.graceEndTime = null; - - /** - * Creates a new TrialMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata instance - */ - TrialMetadata.create = function create(properties) { - return new TrialMetadata(properties); - }; - - /** - * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrialMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) - $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.graceEndTime != null && Object.hasOwnProperty.call(message, "graceEndTime")) - $root.google.protobuf.Timestamp.encode(message.graceEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrialMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrialMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.graceEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrialMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrialMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrialMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); - if (error) - return "upgradeTime." + error; - } - if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.graceEndTime); - if (error) - return "graceEndTime." + error; - } - return null; - }; - - /** - * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} TrialMetadata - */ - TrialMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.TrialMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.upgradeTime != null) { - if (typeof object.upgradeTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.upgradeTime: object expected"); - message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); - } - if (object.graceEndTime != null) { - if (typeof object.graceEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.TrialMetadata.graceEndTime: object expected"); - message.graceEndTime = $root.google.protobuf.Timestamp.fromObject(object.graceEndTime); - } - return message; - }; - - /** - * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.TrialMetadata} message TrialMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrialMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.upgradeTime = null; - object.graceEndTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) - object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); - if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) - object.graceEndTime = $root.google.protobuf.Timestamp.toObject(message.graceEndTime, options); - return object; - }; - - /** - * Converts this TrialMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @instance - * @returns {Object.} JSON object - */ - TrialMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrialMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.TrialMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrialMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.TrialMetadata"; - }; - - return TrialMetadata; - })(); - - Cluster.DataplexConfig = (function() { - - /** - * Properties of a DataplexConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @interface IDataplexConfig - * @property {boolean|null} [enabled] DataplexConfig enabled - */ - - /** - * Constructs a new DataplexConfig. - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @classdesc Represents a DataplexConfig. - * @implements IDataplexConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig=} [properties] Properties to set - */ - function DataplexConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataplexConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @instance - */ - DataplexConfig.prototype.enabled = false; - - /** - * Creates a new DataplexConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig instance - */ - DataplexConfig.create = function create(properties) { - return new DataplexConfig(properties); - }; - - /** - * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataplexConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - return writer; - }; - - /** - * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataplexConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataplexConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataplexConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataplexConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - return null; - }; - - /** - * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig - */ - DataplexConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - return message; - }; - - /** - * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} message DataplexConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataplexConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enabled = false; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - return object; - }; - - /** - * Converts this DataplexConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @instance - * @returns {Object.} JSON object - */ - DataplexConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataplexConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.DataplexConfig"; - }; - - return DataplexConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.Cluster.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} EMPTY=3 EMPTY value - * @property {number} CREATING=4 CREATING value - * @property {number} DELETING=5 DELETING value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value - * @property {number} MAINTENANCE=8 MAINTENANCE value - * @property {number} PROMOTING=9 PROMOTING value - */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "EMPTY"] = 3; - values[valuesById[4] = "CREATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "BOOTSTRAPPING"] = 7; - values[valuesById[8] = "MAINTENANCE"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * ClusterType enum. - * @name google.cloud.alloydb.v1alpha.Cluster.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} SECONDARY=2 SECONDARY value - */ - Cluster.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "SECONDARY"] = 2; - return values; - })(); - - return Cluster; - })(); - - v1alpha.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.cloud.alloydb.v1alpha - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {string|null} [uid] Instance uid - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {Object.|null} [labels] Instance labels - * @property {google.cloud.alloydb.v1alpha.Instance.State|null} [state] Instance state - * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig - * @property {google.cloud.alloydb.v1alpha.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType - * @property {string|null} [gceZone] Instance gceZone - * @property {Object.|null} [databaseFlags] Instance databaseFlags - * @property {google.cloud.alloydb.v1alpha.Instance.INode|null} [writableNode] Instance writableNode - * @property {Array.|null} [nodes] Instance nodes - * @property {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig - * @property {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null} [observabilityConfig] Instance observabilityConfig - * @property {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig - * @property {string|null} [ipAddress] Instance ipAddress - * @property {string|null} [publicIpAddress] Instance publicIpAddress - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - * @property {Object.|null} [annotations] Instance annotations - * @property {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy - * @property {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig - * @property {boolean|null} [satisfiesPzi] Instance satisfiesPzi - * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs - * @property {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig - * @property {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig - * @property {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null} [geminiConfig] Instance geminiConfig - * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses - * @property {google.cloud.alloydb.v1alpha.Instance.ActivationPolicy|null} [activationPolicy] Instance activationPolicy - * @property {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null} [connectionPoolConfig] Instance connectionPoolConfig - * @property {google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null} [gcaConfig] Instance gcaConfig - */ - - /** - * Constructs a new Instance. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.labels = {}; - this.databaseFlags = {}; - this.nodes = []; - this.annotations = {}; - this.outboundPublicIpAddresses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Instance name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.displayName = ""; - - /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.uid = ""; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.deleteTime = null; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance state. - * @member {google.cloud.alloydb.v1alpha.Instance.State} state - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance instanceType. - * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.instanceType = 0; - - /** - * Instance machineConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IMachineConfig|null|undefined} machineConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.machineConfig = null; - - /** - * Instance availabilityType. - * @member {google.cloud.alloydb.v1alpha.Instance.AvailabilityType} availabilityType - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.availabilityType = 0; - - /** - * Instance gceZone. - * @member {string} gceZone - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.gceZone = ""; - - /** - * Instance databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.databaseFlags = $util.emptyObject; - - /** - * Instance writableNode. - * @member {google.cloud.alloydb.v1alpha.Instance.INode|null|undefined} writableNode - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.writableNode = null; - - /** - * Instance nodes. - * @member {Array.} nodes - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.nodes = $util.emptyArray; - - /** - * Instance queryInsightsConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.queryInsightsConfig = null; - - /** - * Instance observabilityConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig|null|undefined} observabilityConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.observabilityConfig = null; - - /** - * Instance readPoolConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig|null|undefined} readPoolConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.readPoolConfig = null; - - /** - * Instance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.ipAddress = ""; - - /** - * Instance publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.publicIpAddress = ""; - - /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.reconciling = false; - - /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.etag = ""; - - /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.annotations = $util.emptyObject; - - /** - * Instance updatePolicy. - * @member {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null|undefined} updatePolicy - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.updatePolicy = null; - - /** - * Instance clientConnectionConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.clientConnectionConfig = null; - - /** - * Instance satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.satisfiesPzi = false; - - /** - * Instance satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.satisfiesPzs = false; - - /** - * Instance pscInstanceConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig|null|undefined} pscInstanceConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.pscInstanceConfig = null; - - /** - * Instance networkConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.networkConfig = null; - - /** - * Instance geminiConfig. - * @member {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig|null|undefined} geminiConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.geminiConfig = null; - - /** - * Instance outboundPublicIpAddresses. - * @member {Array.} outboundPublicIpAddresses - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; - - /** - * Instance activationPolicy. - * @member {google.cloud.alloydb.v1alpha.Instance.ActivationPolicy} activationPolicy - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.activationPolicy = 0; - - /** - * Instance connectionPoolConfig. - * @member {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig|null|undefined} connectionPoolConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.connectionPoolConfig = null; - - /** - * Instance gcaConfig. - * @member {google.cloud.alloydb.v1alpha.IGCAInstanceConfig|null|undefined} gcaConfig - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - */ - Instance.prototype.gcaConfig = null; - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {google.cloud.alloydb.v1alpha.IInstance=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); - if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); - if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) - $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) - $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); - if (message.observabilityConfig != null && Object.hasOwnProperty.call(message, "observabilityConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.encode(message.observabilityConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.publicIpAddress); - if (message.pscInstanceConfig != null && Object.hasOwnProperty.call(message, "pscInstanceConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzi); - if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) - $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) - for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); - if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) - writer.uint32(/* id 35, wireType 0 =*/280).int32(message.activationPolicy); - if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) - $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.gcaConfig != null && Object.hasOwnProperty.call(message, "gcaConfig")) - $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.encode(message.gcaConfig, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {google.cloud.alloydb.v1alpha.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 9: { - message.instanceType = reader.int32(); - break; - } - case 10: { - message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.availabilityType = reader.int32(); - break; - } - case 12: { - message.gceZone = reader.string(); - break; - } - case 13: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.databaseFlags[key] = value; - break; - } - case 19: { - message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32()); - break; - } - case 20: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.alloydb.v1alpha.Instance.Node.decode(reader, reader.uint32())); - break; - } - case 21: { - message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 26: { - message.observabilityConfig = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 14: { - message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.ipAddress = reader.string(); - break; - } - case 27: { - message.publicIpAddress = reader.string(); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { - message.etag = reader.string(); - break; - } - case 18: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 22: { - message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.decode(reader, reader.uint32()); - break; - } - case 23: { - message.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); - break; - } - case 30: { - message.satisfiesPzi = reader.bool(); - break; - } - case 24: { - message.satisfiesPzs = reader.bool(); - break; - } - case 28: { - message.pscInstanceConfig = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 29: { - message.networkConfig = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); - break; - } - case 33: { - message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 34: { - if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) - message.outboundPublicIpAddresses = []; - message.outboundPublicIpAddresses.push(reader.string()); - break; - } - case 35: { - message.activationPolicy = reader.int32(); - break; - } - case 37: { - message.connectionPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.decode(reader, reader.uint32()); - break; - } - case 38: { - message.gcaConfig = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify(message.machineConfig); - if (error) - return "machineConfig." + error; - } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - switch (message.availabilityType) { - default: - return "availabilityType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - if (!$util.isString(message.gceZone)) - return "gceZone: string expected"; - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.writableNode); - if (error) - return "writableNode." + error; - } - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); - if (error) - return "queryInsightsConfig." + error; - } - if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify(message.observabilityConfig); - if (error) - return "observabilityConfig." + error; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify(message.readPoolConfig); - if (error) - return "readPoolConfig." + error; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify(message.updatePolicy); - if (error) - return "updatePolicy." + error; - } - if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); - if (error) - return "clientConnectionConfig." + error; - } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify(message.pscInstanceConfig); - if (error) - return "pscInstanceConfig." + error; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify(message.geminiConfig); - if (error) - return "geminiConfig." + error; - } - if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { - if (!Array.isArray(message.outboundPublicIpAddresses)) - return "outboundPublicIpAddresses: array expected"; - for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) - if (!$util.isString(message.outboundPublicIpAddresses[i])) - return "outboundPublicIpAddresses: string[] expected"; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - switch (message.activationPolicy) { - default: - return "activationPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify(message.connectionPoolConfig); - if (error) - return "connectionPoolConfig." + error; - } - if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify(message.gcaConfig); - if (error) - return "gcaConfig." + error; - } - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "MAINTENANCE": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - if (object.machineConfig != null) { - if (typeof object.machineConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.machineConfig: object expected"); - message.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.fromObject(object.machineConfig); - } - switch (object.availabilityType) { - default: - if (typeof object.availabilityType === "number") { - message.availabilityType = object.availabilityType; - break; - } - break; - case "AVAILABILITY_TYPE_UNSPECIFIED": - case 0: - message.availabilityType = 0; - break; - case "ZONAL": - case 1: - message.availabilityType = 1; - break; - case "REGIONAL": - case 2: - message.availabilityType = 2; - break; - } - if (object.gceZone != null) - message.gceZone = String(object.gceZone); - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - if (object.writableNode != null) { - if (typeof object.writableNode !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.writableNode: object expected"); - message.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.writableNode); - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.nodes: object expected"); - message.nodes[i] = $root.google.cloud.alloydb.v1alpha.Instance.Node.fromObject(object.nodes[i]); - } - } - if (object.queryInsightsConfig != null) { - if (typeof object.queryInsightsConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.queryInsightsConfig: object expected"); - message.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); - } - if (object.observabilityConfig != null) { - if (typeof object.observabilityConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.observabilityConfig: object expected"); - message.observabilityConfig = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.fromObject(object.observabilityConfig); - } - if (object.readPoolConfig != null) { - if (typeof object.readPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.readPoolConfig: object expected"); - message.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); - } - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.updatePolicy != null) { - if (typeof object.updatePolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.updatePolicy: object expected"); - message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.fromObject(object.updatePolicy); - } - if (object.clientConnectionConfig != null) { - if (typeof object.clientConnectionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.clientConnectionConfig: object expected"); - message.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); - } - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.pscInstanceConfig != null) { - if (typeof object.pscInstanceConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.pscInstanceConfig: object expected"); - message.pscInstanceConfig = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.fromObject(object.pscInstanceConfig); - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); - } - if (object.geminiConfig != null) { - if (typeof object.geminiConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.geminiConfig: object expected"); - message.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.fromObject(object.geminiConfig); - } - if (object.outboundPublicIpAddresses) { - if (!Array.isArray(object.outboundPublicIpAddresses)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.outboundPublicIpAddresses: array expected"); - message.outboundPublicIpAddresses = []; - for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) - message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); - } - switch (object.activationPolicy) { - default: - if (typeof object.activationPolicy === "number") { - message.activationPolicy = object.activationPolicy; - break; - } - break; - case "ACTIVATION_POLICY_UNSPECIFIED": - case 0: - message.activationPolicy = 0; - break; - case "ALWAYS": - case 1: - message.activationPolicy = 1; - break; - case "NEVER": - case 2: - message.activationPolicy = 2; - break; - } - if (object.connectionPoolConfig != null) { - if (typeof object.connectionPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.connectionPoolConfig: object expected"); - message.connectionPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.fromObject(object.connectionPoolConfig); - } - if (object.gcaConfig != null) { - if (typeof object.gcaConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.gcaConfig: object expected"); - message.gcaConfig = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.fromObject(object.gcaConfig); - } - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {google.cloud.alloydb.v1alpha.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.nodes = []; - object.outboundPublicIpAddresses = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.databaseFlags = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.machineConfig = null; - object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; - object.gceZone = ""; - object.readPoolConfig = null; - object.ipAddress = ""; - object.reconciling = false; - object.etag = ""; - object.writableNode = null; - object.queryInsightsConfig = null; - object.updatePolicy = null; - object.clientConnectionConfig = null; - object.satisfiesPzs = false; - object.observabilityConfig = null; - object.publicIpAddress = ""; - object.pscInstanceConfig = null; - object.networkConfig = null; - object.satisfiesPzi = false; - object.geminiConfig = null; - object.activationPolicy = options.enums === String ? "ACTIVATION_POLICY_UNSPECIFIED" : 0; - object.connectionPoolConfig = null; - object.gcaConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Instance.State[message.state] : message.state; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) - object.machineConfig = $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig.toObject(message.machineConfig, options); - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1alpha.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - object.gceZone = message.gceZone; - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) - object.readPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) - object.writableNode = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.writableNode, options); - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.alloydb.v1alpha.Instance.Node.toObject(message.nodes[j], options); - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) - object.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); - if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) - object.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.toObject(message.updatePolicy, options); - if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) - object.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) - object.observabilityConfig = $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.toObject(message.observabilityConfig, options); - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) - object.pscInstanceConfig = $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) - object.geminiConfig = $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig.toObject(message.geminiConfig, options); - if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { - object.outboundPublicIpAddresses = []; - for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) - object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - object.activationPolicy = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.ActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.alloydb.v1alpha.Instance.ActivationPolicy[message.activationPolicy] : message.activationPolicy; - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) - object.connectionPoolConfig = $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); - if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) - object.gcaConfig = $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig.toObject(message.gcaConfig, options); - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance"; - }; - - Instance.MachineConfig = (function() { - - /** - * Properties of a MachineConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IMachineConfig - * @property {number|null} [cpuCount] MachineConfig cpuCount - * @property {string|null} [machineType] MachineConfig machineType - */ - - /** - * Constructs a new MachineConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a MachineConfig. - * @implements IMachineConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set - */ - function MachineConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MachineConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.cpuCount = 0; - - /** - * MachineConfig machineType. - * @member {string} machineType - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.machineType = ""; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig instance - */ - MachineConfig.create = function create(properties) { - return new MachineConfig(properties); - }; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineType); - return writer; - }; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.MachineConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - break; - } - case 4: { - message.machineType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MachineConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MachineConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - return null; - }; - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.MachineConfig} MachineConfig - */ - MachineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.MachineConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; - if (object.machineType != null) - message.machineType = String(object.machineType); - return message; - }; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.MachineConfig} message MachineConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MachineConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpuCount = 0; - object.machineType = ""; - } - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - return object; - }; - - /** - * Converts this MachineConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @instance - * @returns {Object.} JSON object - */ - MachineConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MachineConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.MachineConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.MachineConfig"; - }; - - return MachineConfig; - })(); - - Instance.Node = (function() { - - /** - * Properties of a Node. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface INode - * @property {string|null} [zoneId] Node zoneId - * @property {string|null} [id] Node id - * @property {string|null} [ip] Node ip - * @property {string|null} [state] Node state - */ - - /** - * Constructs a new Node. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Node zoneId. - * @member {string} zoneId - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.zoneId = ""; - - /** - * Node id. - * @member {string} id - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.id = ""; - - /** - * Node ip. - * @member {string} ip - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.ip = ""; - - /** - * Node state. - * @member {string} state - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - */ - Node.prototype.state = ""; - - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); - return writer; - }; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.zoneId = reader.string(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.ip = reader.string(); - break; - } - case 4: { - message.state = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - if (!$util.isString(message.zoneId)) - return "zoneId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.ip != null && message.hasOwnProperty("ip")) - if (!$util.isString(message.ip)) - return "ip: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; - return null; - }; - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.Node) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.Node(); - if (object.zoneId != null) - message.zoneId = String(object.zoneId); - if (object.id != null) - message.id = String(object.id); - if (object.ip != null) - message.ip = String(object.ip); - if (object.state != null) - message.state = String(object.state); - return message; - }; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.zoneId = ""; - object.id = ""; - object.ip = ""; - object.state = ""; - } - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - object.zoneId = message.zoneId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.ip != null && message.hasOwnProperty("ip")) - object.ip = message.ip; - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - return object; - }; - - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.Node - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.Node"; - }; - - return Node; - })(); - - Instance.QueryInsightsInstanceConfig = (function() { - - /** - * Properties of a QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IQueryInsightsInstanceConfig - * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags - * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress - * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength - * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute - */ - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a QueryInsightsInstanceConfig. - * @implements IQueryInsightsInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - */ - function QueryInsightsInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInsightsInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - - /** - * QueryInsightsInstanceConfig recordClientAddress. - * @member {boolean|null|undefined} recordClientAddress - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordClientAddress = null; - - /** - * QueryInsightsInstanceConfig queryStringLength. - * @member {number} queryStringLength - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryStringLength = 0; - - /** - * QueryInsightsInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance - */ - QueryInsightsInstanceConfig.create = function create(properties) { - return new QueryInsightsInstanceConfig(properties); - }; - - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); - if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); - if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); - return writer; - }; - - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.recordApplicationTags = reader.bool(); - break; - } - case 3: { - message.recordClientAddress = reader.bool(); - break; - } - case 4: { - message.queryStringLength = reader.uint32(); - break; - } - case 5: { - message.queryPlansPerMinute = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInsightsInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInsightsInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - properties._recordClientAddress = 1; - if (typeof message.recordClientAddress !== "boolean") - return "recordClientAddress: boolean expected"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - if (!$util.isInteger(message.queryStringLength)) - return "queryStringLength: integer expected"; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - return null; - }; - - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - */ - QueryInsightsInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig(); - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.recordClientAddress != null) - message.recordClientAddress = Boolean(object.recordClientAddress); - if (object.queryStringLength != null) - message.queryStringLength = object.queryStringLength >>> 0; - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; - return message; - }; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInsightsInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.queryStringLength = 0; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - object.recordClientAddress = message.recordClientAddress; - if (options.oneofs) - object._recordClientAddress = "recordClientAddress"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = message.queryStringLength; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - return object; - }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig"; - }; - - return QueryInsightsInstanceConfig; - })(); - - Instance.ObservabilityInstanceConfig = (function() { - - /** - * Properties of an ObservabilityInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IObservabilityInstanceConfig - * @property {boolean|null} [enabled] ObservabilityInstanceConfig enabled - * @property {boolean|null} [preserveComments] ObservabilityInstanceConfig preserveComments - * @property {boolean|null} [trackWaitEvents] ObservabilityInstanceConfig trackWaitEvents - * @property {boolean|null} [trackWaitEventTypes] ObservabilityInstanceConfig trackWaitEventTypes - * @property {number|null} [maxQueryStringLength] ObservabilityInstanceConfig maxQueryStringLength - * @property {boolean|null} [recordApplicationTags] ObservabilityInstanceConfig recordApplicationTags - * @property {number|null} [queryPlansPerMinute] ObservabilityInstanceConfig queryPlansPerMinute - * @property {boolean|null} [trackActiveQueries] ObservabilityInstanceConfig trackActiveQueries - * @property {boolean|null} [trackClientAddress] ObservabilityInstanceConfig trackClientAddress - * @property {boolean|null} [assistiveExperiencesEnabled] ObservabilityInstanceConfig assistiveExperiencesEnabled - */ - - /** - * Constructs a new ObservabilityInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents an ObservabilityInstanceConfig. - * @implements IObservabilityInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig=} [properties] Properties to set - */ - function ObservabilityInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ObservabilityInstanceConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.enabled = null; - - /** - * ObservabilityInstanceConfig preserveComments. - * @member {boolean|null|undefined} preserveComments - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.preserveComments = null; - - /** - * ObservabilityInstanceConfig trackWaitEvents. - * @member {boolean|null|undefined} trackWaitEvents - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackWaitEvents = null; - - /** - * ObservabilityInstanceConfig trackWaitEventTypes. - * @member {boolean|null|undefined} trackWaitEventTypes - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackWaitEventTypes = null; - - /** - * ObservabilityInstanceConfig maxQueryStringLength. - * @member {number|null|undefined} maxQueryStringLength - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.maxQueryStringLength = null; - - /** - * ObservabilityInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.recordApplicationTags = null; - - /** - * ObservabilityInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.queryPlansPerMinute = null; - - /** - * ObservabilityInstanceConfig trackActiveQueries. - * @member {boolean|null|undefined} trackActiveQueries - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackActiveQueries = null; - - /** - * ObservabilityInstanceConfig trackClientAddress. - * @member {boolean|null|undefined} trackClientAddress - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackClientAddress = null; - - /** - * ObservabilityInstanceConfig assistiveExperiencesEnabled. - * @member {boolean|null|undefined} assistiveExperiencesEnabled - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.assistiveExperiencesEnabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_preserveComments", { - get: $util.oneOfGetter($oneOfFields = ["preserveComments"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEvents", { - get: $util.oneOfGetter($oneOfFields = ["trackWaitEvents"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEventTypes", { - get: $util.oneOfGetter($oneOfFields = ["trackWaitEventTypes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_maxQueryStringLength", { - get: $util.oneOfGetter($oneOfFields = ["maxQueryStringLength"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackActiveQueries", { - get: $util.oneOfGetter($oneOfFields = ["trackActiveQueries"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["trackClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_assistiveExperiencesEnabled", { - get: $util.oneOfGetter($oneOfFields = ["assistiveExperiencesEnabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ObservabilityInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig instance - */ - ObservabilityInstanceConfig.create = function create(properties) { - return new ObservabilityInstanceConfig(properties); - }; - - /** - * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservabilityInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.preserveComments != null && Object.hasOwnProperty.call(message, "preserveComments")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.preserveComments); - if (message.trackWaitEvents != null && Object.hasOwnProperty.call(message, "trackWaitEvents")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trackWaitEvents); - if (message.trackWaitEventTypes != null && Object.hasOwnProperty.call(message, "trackWaitEventTypes")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.trackWaitEventTypes); - if (message.maxQueryStringLength != null && Object.hasOwnProperty.call(message, "maxQueryStringLength")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxQueryStringLength); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recordApplicationTags); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryPlansPerMinute); - if (message.trackActiveQueries != null && Object.hasOwnProperty.call(message, "trackActiveQueries")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.trackActiveQueries); - if (message.trackClientAddress != null && Object.hasOwnProperty.call(message, "trackClientAddress")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trackClientAddress); - if (message.assistiveExperiencesEnabled != null && Object.hasOwnProperty.call(message, "assistiveExperiencesEnabled")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.assistiveExperiencesEnabled); - return writer; - }; - - /** - * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservabilityInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservabilityInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 2: { - message.preserveComments = reader.bool(); - break; - } - case 3: { - message.trackWaitEvents = reader.bool(); - break; - } - case 4: { - message.trackWaitEventTypes = reader.bool(); - break; - } - case 5: { - message.maxQueryStringLength = reader.int32(); - break; - } - case 6: { - message.recordApplicationTags = reader.bool(); - break; - } - case 7: { - message.queryPlansPerMinute = reader.int32(); - break; - } - case 8: { - message.trackActiveQueries = reader.bool(); - break; - } - case 9: { - message.trackClientAddress = reader.bool(); - break; - } - case 10: { - message.assistiveExperiencesEnabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservabilityInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObservabilityInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObservabilityInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { - properties._preserveComments = 1; - if (typeof message.preserveComments !== "boolean") - return "preserveComments: boolean expected"; - } - if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { - properties._trackWaitEvents = 1; - if (typeof message.trackWaitEvents !== "boolean") - return "trackWaitEvents: boolean expected"; - } - if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { - properties._trackWaitEventTypes = 1; - if (typeof message.trackWaitEventTypes !== "boolean") - return "trackWaitEventTypes: boolean expected"; - } - if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { - properties._maxQueryStringLength = 1; - if (!$util.isInteger(message.maxQueryStringLength)) - return "maxQueryStringLength: integer expected"; - } - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { - properties._trackActiveQueries = 1; - if (typeof message.trackActiveQueries !== "boolean") - return "trackActiveQueries: boolean expected"; - } - if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { - properties._trackClientAddress = 1; - if (typeof message.trackClientAddress !== "boolean") - return "trackClientAddress: boolean expected"; - } - if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { - properties._assistiveExperiencesEnabled = 1; - if (typeof message.assistiveExperiencesEnabled !== "boolean") - return "assistiveExperiencesEnabled: boolean expected"; - } - return null; - }; - - /** - * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - */ - ObservabilityInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.preserveComments != null) - message.preserveComments = Boolean(object.preserveComments); - if (object.trackWaitEvents != null) - message.trackWaitEvents = Boolean(object.trackWaitEvents); - if (object.trackWaitEventTypes != null) - message.trackWaitEventTypes = Boolean(object.trackWaitEventTypes); - if (object.maxQueryStringLength != null) - message.maxQueryStringLength = object.maxQueryStringLength | 0; - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute | 0; - if (object.trackActiveQueries != null) - message.trackActiveQueries = Boolean(object.trackActiveQueries); - if (object.trackClientAddress != null) - message.trackClientAddress = Boolean(object.trackClientAddress); - if (object.assistiveExperiencesEnabled != null) - message.assistiveExperiencesEnabled = Boolean(object.assistiveExperiencesEnabled); - return message; - }; - - /** - * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig} message ObservabilityInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObservabilityInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { - object.preserveComments = message.preserveComments; - if (options.oneofs) - object._preserveComments = "preserveComments"; - } - if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { - object.trackWaitEvents = message.trackWaitEvents; - if (options.oneofs) - object._trackWaitEvents = "trackWaitEvents"; - } - if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { - object.trackWaitEventTypes = message.trackWaitEventTypes; - if (options.oneofs) - object._trackWaitEventTypes = "trackWaitEventTypes"; - } - if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { - object.maxQueryStringLength = message.maxQueryStringLength; - if (options.oneofs) - object._maxQueryStringLength = "maxQueryStringLength"; - } - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { - object.trackActiveQueries = message.trackActiveQueries; - if (options.oneofs) - object._trackActiveQueries = "trackActiveQueries"; - } - if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { - object.trackClientAddress = message.trackClientAddress; - if (options.oneofs) - object._trackClientAddress = "trackClientAddress"; - } - if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { - object.assistiveExperiencesEnabled = message.assistiveExperiencesEnabled; - if (options.oneofs) - object._assistiveExperiencesEnabled = "assistiveExperiencesEnabled"; - } - return object; - }; - - /** - * Converts this ObservabilityInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - ObservabilityInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ObservabilityInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ObservabilityInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ObservabilityInstanceConfig"; - }; - - return ObservabilityInstanceConfig; - })(); - - Instance.ReadPoolConfig = (function() { - - /** - * Properties of a ReadPoolConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount - */ - - /** - * Constructs a new ReadPoolConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set - */ - function ReadPoolConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @instance - */ - ReadPoolConfig.prototype.nodeCount = 0; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig instance - */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); - }; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); - return writer; - }; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - return null; - }; - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} ReadPoolConfig - */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig} message ReadPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeCount = 0; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - return object; - }; - - /** - * Converts this ReadPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ReadPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ReadPoolConfig"; - }; - - return ReadPoolConfig; - })(); - - Instance.UpdatePolicy = (function() { - - /** - * Properties of an UpdatePolicy. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IUpdatePolicy - * @property {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode|null} [mode] UpdatePolicy mode - */ - - /** - * Constructs a new UpdatePolicy. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents an UpdatePolicy. - * @implements IUpdatePolicy - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy=} [properties] Properties to set - */ - function UpdatePolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdatePolicy mode. - * @member {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode} mode - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @instance - */ - UpdatePolicy.prototype.mode = 0; - - /** - * Creates a new UpdatePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy instance - */ - UpdatePolicy.create = function create(properties) { - return new UpdatePolicy(properties); - }; - - /** - * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdatePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdatePolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdatePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdatePolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdatePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} UpdatePolicy - */ - UpdatePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy(); - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "DEFAULT": - case 1: - message.mode = 1; - break; - case "FORCE_APPLY": - case 2: - message.mode = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.UpdatePolicy} message UpdatePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdatePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode[message.mode] : message.mode; - return object; - }; - - /** - * Converts this UpdatePolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @instance - * @returns {Object.} JSON object - */ - UpdatePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdatePolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.UpdatePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.UpdatePolicy"; - }; - - /** - * Mode enum. - * @name google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} DEFAULT=1 DEFAULT value - * @property {number} FORCE_APPLY=2 FORCE_APPLY value - */ - UpdatePolicy.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - values[valuesById[2] = "FORCE_APPLY"] = 2; - return values; - })(); - - return UpdatePolicy; - })(); - - Instance.ClientConnectionConfig = (function() { - - /** - * Properties of a ClientConnectionConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IClientConnectionConfig - * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors - * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig - */ - - /** - * Constructs a new ClientConnectionConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a ClientConnectionConfig. - * @implements IClientConnectionConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig=} [properties] Properties to set - */ - function ClientConnectionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientConnectionConfig requireConnectors. - * @member {boolean} requireConnectors - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @instance - */ - ClientConnectionConfig.prototype.requireConnectors = false; - - /** - * ClientConnectionConfig sslConfig. - * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @instance - */ - ClientConnectionConfig.prototype.sslConfig = null; - - /** - * Creates a new ClientConnectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig instance - */ - ClientConnectionConfig.create = function create(properties) { - return new ClientConnectionConfig(properties); - }; - - /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConnectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConnectionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requireConnectors = reader.bool(); - break; - } - case 2: { - message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientConnectionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientConnectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) - if (typeof message.requireConnectors !== "boolean") - return "requireConnectors: boolean expected"; - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - return null; - }; - - /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig - */ - ClientConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig(); - if (object.requireConnectors != null) - message.requireConnectors = Boolean(object.requireConnectors); - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); - } - return message; - }; - - /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} message ClientConnectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientConnectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.requireConnectors = false; - object.sslConfig = null; - } - if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) - object.requireConnectors = message.requireConnectors; - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); - return object; - }; - - /** - * Converts this ClientConnectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @instance - * @returns {Object.} JSON object - */ - ClientConnectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientConnectionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig"; - }; - - return ClientConnectionConfig; - })(); - - Instance.PscInterfaceConfig = (function() { - - /** - * Properties of a PscInterfaceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IPscInterfaceConfig - * @property {string|null} [networkAttachmentResource] PscInterfaceConfig networkAttachmentResource - */ - - /** - * Constructs a new PscInterfaceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a PscInterfaceConfig. - * @implements IPscInterfaceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig=} [properties] Properties to set - */ - function PscInterfaceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscInterfaceConfig networkAttachmentResource. - * @member {string} networkAttachmentResource - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.networkAttachmentResource = ""; - - /** - * Creates a new PscInterfaceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig instance - */ - PscInterfaceConfig.create = function create(properties) { - return new PscInterfaceConfig(properties); - }; - - /** - * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInterfaceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkAttachmentResource != null && Object.hasOwnProperty.call(message, "networkAttachmentResource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkAttachmentResource); - return writer; - }; - - /** - * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInterfaceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInterfaceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.networkAttachmentResource = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInterfaceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscInterfaceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscInterfaceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) - if (!$util.isString(message.networkAttachmentResource)) - return "networkAttachmentResource: string expected"; - return null; - }; - - /** - * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} PscInterfaceConfig - */ - PscInterfaceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig(); - if (object.networkAttachmentResource != null) - message.networkAttachmentResource = String(object.networkAttachmentResource); - return message; - }; - - /** - * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig} message PscInterfaceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscInterfaceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.networkAttachmentResource = ""; - if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) - object.networkAttachmentResource = message.networkAttachmentResource; - return object; - }; - - /** - * Converts this PscInterfaceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @instance - * @returns {Object.} JSON object - */ - PscInterfaceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscInterfaceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscInterfaceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig"; - }; - - return PscInterfaceConfig; - })(); - - Instance.PscAutoConnectionConfig = (function() { - - /** - * Properties of a PscAutoConnectionConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IPscAutoConnectionConfig - * @property {string|null} [consumerProject] PscAutoConnectionConfig consumerProject - * @property {string|null} [consumerNetwork] PscAutoConnectionConfig consumerNetwork - * @property {string|null} [ipAddress] PscAutoConnectionConfig ipAddress - * @property {string|null} [status] PscAutoConnectionConfig status - * @property {string|null} [consumerNetworkStatus] PscAutoConnectionConfig consumerNetworkStatus - */ - - /** - * Constructs a new PscAutoConnectionConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a PscAutoConnectionConfig. - * @implements IPscAutoConnectionConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig=} [properties] Properties to set - */ - function PscAutoConnectionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscAutoConnectionConfig consumerProject. - * @member {string} consumerProject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerProject = ""; - - /** - * PscAutoConnectionConfig consumerNetwork. - * @member {string} consumerNetwork - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerNetwork = ""; - - /** - * PscAutoConnectionConfig ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.ipAddress = ""; - - /** - * PscAutoConnectionConfig status. - * @member {string} status - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.status = ""; - - /** - * PscAutoConnectionConfig consumerNetworkStatus. - * @member {string} consumerNetworkStatus - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerNetworkStatus = ""; - - /** - * Creates a new PscAutoConnectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig instance - */ - PscAutoConnectionConfig.create = function create(properties) { - return new PscAutoConnectionConfig(properties); - }; - - /** - * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscAutoConnectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); - if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNetwork); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); - if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.consumerNetworkStatus); - return writer; - }; - - /** - * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscAutoConnectionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.consumerProject = reader.string(); - break; - } - case 2: { - message.consumerNetwork = reader.string(); - break; - } - case 3: { - message.ipAddress = reader.string(); - break; - } - case 4: { - message.status = reader.string(); - break; - } - case 5: { - message.consumerNetworkStatus = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscAutoConnectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscAutoConnectionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscAutoConnectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) - if (!$util.isString(message.consumerProject)) - return "consumerProject: string expected"; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) - if (!$util.isString(message.consumerNetwork)) - return "consumerNetwork: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) - if (!$util.isString(message.consumerNetworkStatus)) - return "consumerNetworkStatus: string expected"; - return null; - }; - - /** - * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - */ - PscAutoConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig(); - if (object.consumerProject != null) - message.consumerProject = String(object.consumerProject); - if (object.consumerNetwork != null) - message.consumerNetwork = String(object.consumerNetwork); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.status != null) - message.status = String(object.status); - if (object.consumerNetworkStatus != null) - message.consumerNetworkStatus = String(object.consumerNetworkStatus); - return message; - }; - - /** - * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig} message PscAutoConnectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscAutoConnectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.consumerProject = ""; - object.consumerNetwork = ""; - object.ipAddress = ""; - object.status = ""; - object.consumerNetworkStatus = ""; - } - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) - object.consumerProject = message.consumerProject; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) - object.consumerNetwork = message.consumerNetwork; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) - object.consumerNetworkStatus = message.consumerNetworkStatus; - return object; - }; - - /** - * Converts this PscAutoConnectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @instance - * @returns {Object.} JSON object - */ - PscAutoConnectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscAutoConnectionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscAutoConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig"; - }; - - return PscAutoConnectionConfig; - })(); - - Instance.PscInstanceConfig = (function() { - - /** - * Properties of a PscInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IPscInstanceConfig - * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink - * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects - * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName - * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs - * @property {Array.|null} [pscAutoConnections] PscInstanceConfig pscAutoConnections - */ - - /** - * Constructs a new PscInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a PscInstanceConfig. - * @implements IPscInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig=} [properties] Properties to set - */ - function PscInstanceConfig(properties) { - this.allowedConsumerProjects = []; - this.pscInterfaceConfigs = []; - this.pscAutoConnections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscInstanceConfig serviceAttachmentLink. - * @member {string} serviceAttachmentLink - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.serviceAttachmentLink = ""; - - /** - * PscInstanceConfig allowedConsumerProjects. - * @member {Array.} allowedConsumerProjects - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.allowedConsumerProjects = $util.emptyArray; - - /** - * PscInstanceConfig pscDnsName. - * @member {string} pscDnsName - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscDnsName = ""; - - /** - * PscInstanceConfig pscInterfaceConfigs. - * @member {Array.} pscInterfaceConfigs - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; - - /** - * PscInstanceConfig pscAutoConnections. - * @member {Array.} pscAutoConnections - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscAutoConnections = $util.emptyArray; - - /** - * Creates a new PscInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig instance - */ - PscInstanceConfig.create = function create(properties) { - return new PscInstanceConfig(properties); - }; - - /** - * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAttachmentLink != null && Object.hasOwnProperty.call(message, "serviceAttachmentLink")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachmentLink); - if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) - for (var i = 0; i < message.allowedConsumerProjects.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); - if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscDnsName); - if (message.pscInterfaceConfigs != null && message.pscInterfaceConfigs.length) - for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.encode(message.pscInterfaceConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.pscAutoConnections != null && message.pscAutoConnections.length) - for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serviceAttachmentLink = reader.string(); - break; - } - case 2: { - if (!(message.allowedConsumerProjects && message.allowedConsumerProjects.length)) - message.allowedConsumerProjects = []; - message.allowedConsumerProjects.push(reader.string()); - break; - } - case 7: { - message.pscDnsName = reader.string(); - break; - } - case 8: { - if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) - message.pscInterfaceConfigs = []; - message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.pscAutoConnections && message.pscAutoConnections.length)) - message.pscAutoConnections = []; - message.pscAutoConnections.push($root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) - if (!$util.isString(message.serviceAttachmentLink)) - return "serviceAttachmentLink: string expected"; - if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { - if (!Array.isArray(message.allowedConsumerProjects)) - return "allowedConsumerProjects: array expected"; - for (var i = 0; i < message.allowedConsumerProjects.length; ++i) - if (!$util.isString(message.allowedConsumerProjects[i])) - return "allowedConsumerProjects: string[] expected"; - } - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - if (!$util.isString(message.pscDnsName)) - return "pscDnsName: string expected"; - if (message.pscInterfaceConfigs != null && message.hasOwnProperty("pscInterfaceConfigs")) { - if (!Array.isArray(message.pscInterfaceConfigs)) - return "pscInterfaceConfigs: array expected"; - for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.verify(message.pscInterfaceConfigs[i]); - if (error) - return "pscInterfaceConfigs." + error; - } - } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { - if (!Array.isArray(message.pscAutoConnections)) - return "pscAutoConnections: array expected"; - for (var i = 0; i < message.pscAutoConnections.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.verify(message.pscAutoConnections[i]); - if (error) - return "pscAutoConnections." + error; - } - } - return null; - }; - - /** - * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} PscInstanceConfig - */ - PscInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig(); - if (object.serviceAttachmentLink != null) - message.serviceAttachmentLink = String(object.serviceAttachmentLink); - if (object.allowedConsumerProjects) { - if (!Array.isArray(object.allowedConsumerProjects)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.allowedConsumerProjects: array expected"); - message.allowedConsumerProjects = []; - for (var i = 0; i < object.allowedConsumerProjects.length; ++i) - message.allowedConsumerProjects[i] = String(object.allowedConsumerProjects[i]); - } - if (object.pscDnsName != null) - message.pscDnsName = String(object.pscDnsName); - if (object.pscInterfaceConfigs) { - if (!Array.isArray(object.pscInterfaceConfigs)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscInterfaceConfigs: array expected"); - message.pscInterfaceConfigs = []; - for (var i = 0; i < object.pscInterfaceConfigs.length; ++i) { - if (typeof object.pscInterfaceConfigs[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscInterfaceConfigs: object expected"); - message.pscInterfaceConfigs[i] = $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.fromObject(object.pscInterfaceConfigs[i]); - } - } - if (object.pscAutoConnections) { - if (!Array.isArray(object.pscAutoConnections)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscAutoConnections: array expected"); - message.pscAutoConnections = []; - for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.pscAutoConnections: object expected"); - message.pscAutoConnections[i] = $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig} message PscInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedConsumerProjects = []; - object.pscInterfaceConfigs = []; - object.pscAutoConnections = []; - } - if (options.defaults) { - object.serviceAttachmentLink = ""; - object.pscDnsName = ""; - } - if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) - object.serviceAttachmentLink = message.serviceAttachmentLink; - if (message.allowedConsumerProjects && message.allowedConsumerProjects.length) { - object.allowedConsumerProjects = []; - for (var j = 0; j < message.allowedConsumerProjects.length; ++j) - object.allowedConsumerProjects[j] = message.allowedConsumerProjects[j]; - } - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - object.pscDnsName = message.pscDnsName; - if (message.pscInterfaceConfigs && message.pscInterfaceConfigs.length) { - object.pscInterfaceConfigs = []; - for (var j = 0; j < message.pscInterfaceConfigs.length; ++j) - object.pscInterfaceConfigs[j] = $root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.toObject(message.pscInterfaceConfigs[j], options); - } - if (message.pscAutoConnections && message.pscAutoConnections.length) { - object.pscAutoConnections = []; - for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.alloydb.v1alpha.Instance.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); - } - return object; - }; - - /** - * Converts this PscInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - PscInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig"; - }; - - return PscInstanceConfig; - })(); - - Instance.InstanceNetworkConfig = (function() { - - /** - * Properties of an InstanceNetworkConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IInstanceNetworkConfig - * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks - * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp - * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp - * @property {string|null} [network] InstanceNetworkConfig network - * @property {string|null} [allocatedIpRangeOverride] InstanceNetworkConfig allocatedIpRangeOverride - */ - - /** - * Constructs a new InstanceNetworkConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents an InstanceNetworkConfig. - * @implements IInstanceNetworkConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig=} [properties] Properties to set - */ - function InstanceNetworkConfig(properties) { - this.authorizedExternalNetworks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceNetworkConfig authorizedExternalNetworks. - * @member {Array.} authorizedExternalNetworks - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; - - /** - * InstanceNetworkConfig enablePublicIp. - * @member {boolean} enablePublicIp - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.enablePublicIp = false; - - /** - * InstanceNetworkConfig enableOutboundPublicIp. - * @member {boolean} enableOutboundPublicIp - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; - - /** - * InstanceNetworkConfig network. - * @member {string} network - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.network = ""; - - /** - * InstanceNetworkConfig allocatedIpRangeOverride. - * @member {string} allocatedIpRangeOverride - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.allocatedIpRangeOverride = ""; - - /** - * Creates a new InstanceNetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance - */ - InstanceNetworkConfig.create = function create(properties) { - return new InstanceNetworkConfig(properties); - }; - - /** - * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceNetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.authorizedExternalNetworks != null && message.authorizedExternalNetworks.length) - for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); - if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); - if (message.allocatedIpRangeOverride != null && Object.hasOwnProperty.call(message, "allocatedIpRangeOverride")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRangeOverride); - return writer; - }; - - /** - * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceNetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.authorizedExternalNetworks && message.authorizedExternalNetworks.length)) - message.authorizedExternalNetworks = []; - message.authorizedExternalNetworks.push($root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.decode(reader, reader.uint32())); - break; - } - case 2: { - message.enablePublicIp = reader.bool(); - break; - } - case 3: { - message.enableOutboundPublicIp = reader.bool(); - break; - } - case 4: { - message.network = reader.string(); - break; - } - case 5: { - message.allocatedIpRangeOverride = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceNetworkConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceNetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.authorizedExternalNetworks != null && message.hasOwnProperty("authorizedExternalNetworks")) { - if (!Array.isArray(message.authorizedExternalNetworks)) - return "authorizedExternalNetworks: array expected"; - for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify(message.authorizedExternalNetworks[i]); - if (error) - return "authorizedExternalNetworks." + error; - } - } - if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) - if (typeof message.enablePublicIp !== "boolean") - return "enablePublicIp: boolean expected"; - if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) - if (typeof message.enableOutboundPublicIp !== "boolean") - return "enableOutboundPublicIp: boolean expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) - if (!$util.isString(message.allocatedIpRangeOverride)) - return "allocatedIpRangeOverride: string expected"; - return null; - }; - - /** - * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} InstanceNetworkConfig - */ - InstanceNetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig(); - if (object.authorizedExternalNetworks) { - if (!Array.isArray(object.authorizedExternalNetworks)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.authorizedExternalNetworks: array expected"); - message.authorizedExternalNetworks = []; - for (var i = 0; i < object.authorizedExternalNetworks.length; ++i) { - if (typeof object.authorizedExternalNetworks[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.authorizedExternalNetworks: object expected"); - message.authorizedExternalNetworks[i] = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.fromObject(object.authorizedExternalNetworks[i]); - } - } - if (object.enablePublicIp != null) - message.enablePublicIp = Boolean(object.enablePublicIp); - if (object.enableOutboundPublicIp != null) - message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); - if (object.network != null) - message.network = String(object.network); - if (object.allocatedIpRangeOverride != null) - message.allocatedIpRangeOverride = String(object.allocatedIpRangeOverride); - return message; - }; - - /** - * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig} message InstanceNetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceNetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.authorizedExternalNetworks = []; - if (options.defaults) { - object.enablePublicIp = false; - object.enableOutboundPublicIp = false; - object.network = ""; - object.allocatedIpRangeOverride = ""; - } - if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { - object.authorizedExternalNetworks = []; - for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) - object.authorizedExternalNetworks[j] = $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.toObject(message.authorizedExternalNetworks[j], options); - } - if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) - object.enablePublicIp = message.enablePublicIp; - if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) - object.enableOutboundPublicIp = message.enableOutboundPublicIp; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) - object.allocatedIpRangeOverride = message.allocatedIpRangeOverride; - return object; - }; - - /** - * Converts this InstanceNetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceNetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceNetworkConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceNetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig"; - }; - - InstanceNetworkConfig.AuthorizedNetwork = (function() { - - /** - * Properties of an AuthorizedNetwork. - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @interface IAuthorizedNetwork - * @property {string|null} [cidrRange] AuthorizedNetwork cidrRange - */ - - /** - * Constructs a new AuthorizedNetwork. - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig - * @classdesc Represents an AuthorizedNetwork. - * @implements IAuthorizedNetwork - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set - */ - function AuthorizedNetwork(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuthorizedNetwork cidrRange. - * @member {string} cidrRange - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @instance - */ - AuthorizedNetwork.prototype.cidrRange = ""; - - /** - * Creates a new AuthorizedNetwork instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork instance - */ - AuthorizedNetwork.create = function create(properties) { - return new AuthorizedNetwork(properties); - }; - - /** - * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthorizedNetwork.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cidrRange != null && Object.hasOwnProperty.call(message, "cidrRange")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cidrRange); - return writer; - }; - - /** - * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthorizedNetwork.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthorizedNetwork.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cidrRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthorizedNetwork.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuthorizedNetwork message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuthorizedNetwork.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) - if (!$util.isString(message.cidrRange)) - return "cidrRange: string expected"; - return null; - }; - - /** - * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - */ - AuthorizedNetwork.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork(); - if (object.cidrRange != null) - message.cidrRange = String(object.cidrRange); - return message; - }; - - /** - * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork} message AuthorizedNetwork - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuthorizedNetwork.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cidrRange = ""; - if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) - object.cidrRange = message.cidrRange; - return object; - }; - - /** - * Converts this AuthorizedNetwork to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @instance - * @returns {Object.} JSON object - */ - AuthorizedNetwork.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuthorizedNetwork - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuthorizedNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.InstanceNetworkConfig.AuthorizedNetwork"; - }; - - return AuthorizedNetwork; - })(); - - return InstanceNetworkConfig; - })(); - - Instance.ConnectionPoolConfig = (function() { - - /** - * Properties of a ConnectionPoolConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @interface IConnectionPoolConfig - * @property {boolean|null} [enabled] ConnectionPoolConfig enabled - * @property {Object.|null} [flags] ConnectionPoolConfig flags - * @property {number|null} [poolerCount] ConnectionPoolConfig poolerCount - */ - - /** - * Constructs a new ConnectionPoolConfig. - * @memberof google.cloud.alloydb.v1alpha.Instance - * @classdesc Represents a ConnectionPoolConfig. - * @implements IConnectionPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig=} [properties] Properties to set - */ - function ConnectionPoolConfig(properties) { - this.flags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionPoolConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.enabled = false; - - /** - * ConnectionPoolConfig flags. - * @member {Object.} flags - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.flags = $util.emptyObject; - - /** - * ConnectionPoolConfig poolerCount. - * @member {number} poolerCount - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.poolerCount = 0; - - /** - * Creates a new ConnectionPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig instance - */ - ConnectionPoolConfig.create = function create(properties) { - return new ConnectionPoolConfig(properties); - }; - - /** - * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enabled); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) - for (var keys = Object.keys(message.flags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.flags[keys[i]]).ldelim(); - if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.poolerCount); - return writer; - }; - - /** - * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 12: { - message.enabled = reader.bool(); - break; - } - case 13: { - if (message.flags === $util.emptyObject) - message.flags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.flags[key] = value; - break; - } - case 14: { - message.poolerCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isObject(message.flags)) - return "flags: object expected"; - var key = Object.keys(message.flags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.flags[key[i]])) - return "flags: string{k:string} expected"; - } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) - if (!$util.isInteger(message.poolerCount)) - return "poolerCount: integer expected"; - return null; - }; - - /** - * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} ConnectionPoolConfig - */ - ConnectionPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.flags) { - if (typeof object.flags !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig.flags: object expected"); - message.flags = {}; - for (var keys = Object.keys(object.flags), i = 0; i < keys.length; ++i) - message.flags[keys[i]] = String(object.flags[keys[i]]); - } - if (object.poolerCount != null) - message.poolerCount = object.poolerCount | 0; - return message; - }; - - /** - * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig} message ConnectionPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.flags = {}; - if (options.defaults) { - object.enabled = false; - object.poolerCount = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - var keys2; - if (message.flags && (keys2 = Object.keys(message.flags)).length) { - object.flags = {}; - for (var j = 0; j < keys2.length; ++j) - object.flags[keys2[j]] = message.flags[keys2[j]]; - } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) - object.poolerCount = message.poolerCount; - return object; - }; - - /** - * Converts this ConnectionPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ConnectionPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectionPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectionPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ConnectionPoolConfig"; - }; - - return ConnectionPoolConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * InstanceType enum. - * @name google.cloud.alloydb.v1alpha.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} READ_POOL=2 READ_POOL value - * @property {number} SECONDARY=3 SECONDARY value - */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "READ_POOL"] = 2; - values[valuesById[3] = "SECONDARY"] = 3; - return values; - })(); - - /** - * AvailabilityType enum. - * @name google.cloud.alloydb.v1alpha.Instance.AvailabilityType - * @enum {number} - * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value - */ - Instance.AvailabilityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; - return values; - })(); - - /** - * ActivationPolicy enum. - * @name google.cloud.alloydb.v1alpha.Instance.ActivationPolicy - * @enum {number} - * @property {number} ACTIVATION_POLICY_UNSPECIFIED=0 ACTIVATION_POLICY_UNSPECIFIED value - * @property {number} ALWAYS=1 ALWAYS value - * @property {number} NEVER=2 NEVER value - */ - Instance.ActivationPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVATION_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALWAYS"] = 1; - values[valuesById[2] = "NEVER"] = 2; - return values; - })(); - - return Instance; - })(); - - v1alpha.ConnectionInfo = (function() { - - /** - * Properties of a ConnectionInfo. - * @memberof google.cloud.alloydb.v1alpha - * @interface IConnectionInfo - * @property {string|null} [name] ConnectionInfo name - * @property {string|null} [ipAddress] ConnectionInfo ipAddress - * @property {string|null} [publicIpAddress] ConnectionInfo publicIpAddress - * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain - * @property {string|null} [instanceUid] ConnectionInfo instanceUid - * @property {string|null} [pscDnsName] ConnectionInfo pscDnsName - */ - - /** - * Constructs a new ConnectionInfo. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ConnectionInfo. - * @implements IConnectionInfo - * @constructor - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set - */ - function ConnectionInfo(properties) { - this.pemCertificateChain = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionInfo name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.name = ""; - - /** - * ConnectionInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.ipAddress = ""; - - /** - * ConnectionInfo publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.publicIpAddress = ""; - - /** - * ConnectionInfo pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; - - /** - * ConnectionInfo instanceUid. - * @member {string} instanceUid - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.instanceUid = ""; - - /** - * ConnectionInfo pscDnsName. - * @member {string} pscDnsName - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.pscDnsName = ""; - - /** - * Creates a new ConnectionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo instance - */ - ConnectionInfo.create = function create(properties) { - return new ConnectionInfo(properties); - }; - - /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); - if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicIpAddress); - if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pscDnsName); - return writer; - }; - - /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ConnectionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.ipAddress = reader.string(); - break; - } - case 5: { - message.publicIpAddress = reader.string(); - break; - } - case 3: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 4: { - message.instanceUid = reader.string(); - break; - } - case 6: { - message.pscDnsName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - if (!$util.isString(message.instanceUid)) - return "instanceUid: string expected"; - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - if (!$util.isString(message.pscDnsName)) - return "pscDnsName: string expected"; - return null; - }; - - /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ConnectionInfo} ConnectionInfo - */ - ConnectionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ConnectionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ConnectionInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1alpha.ConnectionInfo.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.instanceUid != null) - message.instanceUid = String(object.instanceUid); - if (object.pscDnsName != null) - message.pscDnsName = String(object.pscDnsName); - return message; - }; - - /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} message ConnectionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) { - object.name = ""; - object.ipAddress = ""; - object.instanceUid = ""; - object.publicIpAddress = ""; - object.pscDnsName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - object.instanceUid = message.instanceUid; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - object.pscDnsName = message.pscDnsName; - return object; - }; - - /** - * Converts this ConnectionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @instance - * @returns {Object.} JSON object - */ - ConnectionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ConnectionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ConnectionInfo"; - }; - - return ConnectionInfo; - })(); - - v1alpha.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [displayName] Backup displayName - * @property {string|null} [uid] Backup uid - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime - * @property {google.protobuf.ITimestamp|null} [createCompletionTime] Backup createCompletionTime - * @property {Object.|null} [labels] Backup labels - * @property {google.cloud.alloydb.v1alpha.Backup.State|null} [state] Backup state - * @property {google.cloud.alloydb.v1alpha.Backup.Type|null} [type] Backup type - * @property {string|null} [description] Backup description - * @property {string|null} [clusterUid] Backup clusterUid - * @property {string|null} [clusterName] Backup clusterName - * @property {boolean|null} [reconciling] Backup reconciling - * @property {google.cloud.alloydb.v1alpha.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig - * @property {google.cloud.alloydb.v1alpha.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {string|null} [etag] Backup etag - * @property {Object.|null} [annotations] Backup annotations - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime - * @property {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity - * @property {boolean|null} [satisfiesPzi] Backup satisfiesPzi - * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Backup databaseVersion - * @property {Object.|null} [tags] Backup tags - */ - - /** - * Constructs a new Backup. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set - */ - function Backup(properties) { - this.labels = {}; - this.annotations = {}; - this.tags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.displayName = ""; - - /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.uid = ""; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.updateTime = null; - - /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.deleteTime = null; - - /** - * Backup createCompletionTime. - * @member {google.protobuf.ITimestamp|null|undefined} createCompletionTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.createCompletionTime = null; - - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; - - /** - * Backup state. - * @member {google.cloud.alloydb.v1alpha.Backup.State} state - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup type. - * @member {google.cloud.alloydb.v1alpha.Backup.Type} type - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.type = 0; - - /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.description = ""; - - /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.clusterUid = ""; - - /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.clusterName = ""; - - /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.reconciling = false; - - /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1alpha.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.encryptionConfig = null; - - /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1alpha.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; - - /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.etag = ""; - - /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.annotations = $util.emptyObject; - - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.expiryTime = null; - - /** - * Backup expiryQuantity. - * @member {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.expiryQuantity = null; - - /** - * Backup satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.satisfiesPzi = false; - - /** - * Backup satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.satisfiesPzs = false; - - /** - * Backup databaseVersion. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.databaseVersion = 0; - - /** - * Backup tags. - * @member {Object.} tags - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - */ - Backup.prototype.tags = $util.emptyObject; - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1alpha.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1alpha.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); - if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) - $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.satisfiesPzi); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); - if (message.createCompletionTime != null && Object.hasOwnProperty.call(message, "createCompletionTime")) - $root.google.protobuf.Timestamp.encode(message.createCompletionTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Backup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 26: { - message.createCompletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.description = reader.string(); - break; - } - case 18: { - message.clusterUid = reader.string(); - break; - } - case 10: { - message.clusterName = reader.string(); - break; - } - case 11: { - message.reconciling = reader.bool(); - break; - } - case 12: { - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 16: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 17: { - message.sizeBytes = reader.int64(); - break; - } - case 19: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 20: { - message.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); - break; - } - case 23: { - message.satisfiesPzi = reader.bool(); - break; - } - case 21: { - message.satisfiesPzs = reader.bool(); - break; - } - case 22: { - message.databaseVersion = reader.int32(); - break; - } - case 25: { - if (message.tags === $util.emptyObject) - message.tags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.tags[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Backup message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Backup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createCompletionTime); - if (error) - return "createCompletionTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - if (!$util.isString(message.clusterUid)) - return "clusterUid: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } - if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); - if (error) - return "expiryQuantity." + error; - } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!$util.isObject(message.tags)) - return "tags: object expected"; - var key = Object.keys(message.tags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.tags[key[i]])) - return "tags: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Backup} Backup - */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Backup) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Backup(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.createCompletionTime != null) { - if (typeof object.createCompletionTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.createCompletionTime: object expected"); - message.createCompletionTime = $root.google.protobuf.Timestamp.fromObject(object.createCompletionTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ON_DEMAND": - case 1: - message.type = 1; - break; - case "AUTOMATED": - case 2: - message.type = 2; - break; - case "CONTINUOUS": - case 3: - message.type = 3; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.clusterUid != null) - message.clusterUid = String(object.clusterUid); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } - if (object.expiryQuantity != null) { - if (typeof object.expiryQuantity !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.expiryQuantity: object expected"); - message.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); - } - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.databaseVersion = 6; - break; - } - if (object.tags) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.Backup.tags: object expected"); - message.tags = {}; - for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) - message.tags[keys[i]] = String(object.tags[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {google.cloud.alloydb.v1alpha.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - object.tags = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.clusterName = ""; - object.reconciling = false; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.etag = ""; - object.deleteTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.clusterUid = ""; - object.expiryTime = null; - object.expiryQuantity = null; - object.satisfiesPzs = false; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.satisfiesPzi = false; - object.createCompletionTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.Backup.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Backup.Type[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1alpha.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1alpha.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - object.clusterUid = message.clusterUid; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); - if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) - object.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - if (message.tags && (keys2 = Object.keys(message.tags)).length) { - object.tags = {}; - for (var j = 0; j < keys2.length; ++j) - object.tags[keys2[j]] = message.tags[keys2[j]]; - } - if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) - object.createCompletionTime = $root.google.protobuf.Timestamp.toObject(message.createCompletionTime, options); - return object; - }; - - /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Backup - * @instance - * @returns {Object.} JSON object - */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Backup"; - }; - - Backup.QuantityBasedExpiry = (function() { - - /** - * Properties of a QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1alpha.Backup - * @interface IQuantityBasedExpiry - * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount - * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount - */ - - /** - * Constructs a new QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1alpha.Backup - * @classdesc Represents a QuantityBasedExpiry. - * @implements IQuantityBasedExpiry - * @constructor - * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry=} [properties] Properties to set - */ - function QuantityBasedExpiry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedExpiry retentionCount. - * @member {number} retentionCount - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @instance - */ - QuantityBasedExpiry.prototype.retentionCount = 0; - - /** - * QuantityBasedExpiry totalRetentionCount. - * @member {number} totalRetentionCount - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @instance - */ - QuantityBasedExpiry.prototype.totalRetentionCount = 0; - - /** - * Creates a new QuantityBasedExpiry instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance - */ - QuantityBasedExpiry.create = function create(properties) { - return new QuantityBasedExpiry(properties); - }; - - /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedExpiry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); - if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); - return writer; - }; - - /** - * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedExpiry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionCount = reader.int32(); - break; - } - case 2: { - message.totalRetentionCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedExpiry message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedExpiry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - if (!$util.isInteger(message.retentionCount)) - return "retentionCount: integer expected"; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - if (!$util.isInteger(message.totalRetentionCount)) - return "totalRetentionCount: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} QuantityBasedExpiry - */ - QuantityBasedExpiry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry(); - if (object.retentionCount != null) - message.retentionCount = object.retentionCount | 0; - if (object.totalRetentionCount != null) - message.totalRetentionCount = object.totalRetentionCount | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry} message QuantityBasedExpiry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedExpiry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.retentionCount = 0; - object.totalRetentionCount = 0; - } - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - object.retentionCount = message.retentionCount; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - object.totalRetentionCount = message.totalRetentionCount; - return object; - }; - - /** - * Converts this QuantityBasedExpiry to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedExpiry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedExpiry - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry"; - }; - - return QuantityBasedExpiry; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} FAILED=3 FAILED value - * @property {number} DELETING=4 DELETING value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "DELETING"] = 4; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.alloydb.v1alpha.Backup.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ON_DEMAND=1 ON_DEMAND value - * @property {number} AUTOMATED=2 AUTOMATED value - * @property {number} CONTINUOUS=3 CONTINUOUS value - */ - Backup.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ON_DEMAND"] = 1; - values[valuesById[2] = "AUTOMATED"] = 2; - values[valuesById[3] = "CONTINUOUS"] = 3; - return values; - })(); - - return Backup; - })(); - - v1alpha.SupportedDatabaseFlag = (function() { - - /** - * Properties of a SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISupportedDatabaseFlag - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions - * @property {string|null} [recommendedStringValue] SupportedDatabaseFlag recommendedStringValue - * @property {google.protobuf.IInt64Value|null} [recommendedIntegerValue] SupportedDatabaseFlag recommendedIntegerValue - * @property {string|null} [name] SupportedDatabaseFlag name - * @property {string|null} [flagName] SupportedDatabaseFlag flagName - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType - * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues - * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions - * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null} [scope] SupportedDatabaseFlag scope - */ - - /** - * Constructs a new SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set - */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; - - /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; - - /** - * SupportedDatabaseFlag recommendedStringValue. - * @member {string|null|undefined} recommendedStringValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.recommendedStringValue = null; - - /** - * SupportedDatabaseFlag recommendedIntegerValue. - * @member {google.protobuf.IInt64Value|null|undefined} recommendedIntegerValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.recommendedIntegerValue = null; - - /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.name = ""; - - /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.flagName = ""; - - /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.valueType = 0; - - /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; - - /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; - - /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; - - /** - * SupportedDatabaseFlag scope. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} scope - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.scope = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SupportedDatabaseFlag recommendedValue. - * @member {"recommendedStringValue"|"recommendedIntegerValue"|undefined} recommendedValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "recommendedValue", { - get: $util.oneOfGetter($oneOfFields = ["recommendedStringValue", "recommendedIntegerValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag instance - */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); - }; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); - if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); - if (message.supportedDbVersions != null && message.supportedDbVersions.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedDbVersions.length; ++i) - writer.int32(message.supportedDbVersions[i]); - writer.ldelim(); - } - if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); - if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) - $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) - $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); - if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.recommendedStringValue); - if (message.recommendedIntegerValue != null && Object.hasOwnProperty.call(message, "recommendedIntegerValue")) - $root.google.protobuf.Int64Value.encode(message.recommendedIntegerValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 7: { - message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); - break; - } - case 10: { - message.recommendedStringValue = reader.string(); - break; - } - case 11: { - message.recommendedIntegerValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.flagName = reader.string(); - break; - } - case 3: { - message.valueType = reader.int32(); - break; - } - case 4: { - message.acceptsMultipleValues = reader.bool(); - break; - } - case 5: { - if (!(message.supportedDbVersions && message.supportedDbVersions.length)) - message.supportedDbVersions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.supportedDbVersions.push(reader.int32()); - } else - message.supportedDbVersions.push(reader.int32()); - break; - } - case 6: { - message.requiresDbRestart = reader.bool(); - break; - } - case 9: { - message.scope = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SupportedDatabaseFlag message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SupportedDatabaseFlag.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); - if (error) - return "stringRestrictions." + error; - } - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - if (properties.restrictions === 1) - return "restrictions: multiple values"; - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); - if (error) - return "integerRestrictions." + error; - } - } - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { - properties.recommendedValue = 1; - if (!$util.isString(message.recommendedStringValue)) - return "recommendedStringValue: string expected"; - } - if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { - if (properties.recommendedValue === 1) - return "recommendedValue: multiple values"; - properties.recommendedValue = 1; - { - var error = $root.google.protobuf.Int64Value.verify(message.recommendedIntegerValue); - if (error) - return "recommendedIntegerValue." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.flagName != null && message.hasOwnProperty("flagName")) - if (!$util.isString(message.flagName)) - return "flagName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - if (typeof message.acceptsMultipleValues !== "boolean") - return "acceptsMultipleValues: boolean expected"; - if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { - if (!Array.isArray(message.supportedDbVersions)) - return "supportedDbVersions: array expected"; - for (var i = 0; i < message.supportedDbVersions.length; ++i) - switch (message.supportedDbVersions[i]) { - default: - return "supportedDbVersions: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} SupportedDatabaseFlag - */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag(); - if (object.stringRestrictions != null) { - if (typeof object.stringRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.stringRestrictions: object expected"); - message.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); - } - if (object.integerRestrictions != null) { - if (typeof object.integerRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.integerRestrictions: object expected"); - message.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); - } - if (object.recommendedStringValue != null) - message.recommendedStringValue = String(object.recommendedStringValue); - if (object.recommendedIntegerValue != null) { - if (typeof object.recommendedIntegerValue !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.recommendedIntegerValue: object expected"); - message.recommendedIntegerValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntegerValue); - } - if (object.name != null) - message.name = String(object.name); - if (object.flagName != null) - message.flagName = String(object.flagName); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "STRING": - case 1: - message.valueType = 1; - break; - case "INTEGER": - case 2: - message.valueType = 2; - break; - case "FLOAT": - case 3: - message.valueType = 3; - break; - case "NONE": - case 4: - message.valueType = 4; - break; - } - if (object.acceptsMultipleValues != null) - message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); - if (object.supportedDbVersions) { - if (!Array.isArray(object.supportedDbVersions)) - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.supportedDbVersions: array expected"); - message.supportedDbVersions = []; - for (var i = 0; i < object.supportedDbVersions.length; ++i) - switch (object.supportedDbVersions[i]) { - default: - if (typeof object.supportedDbVersions[i] === "number") { - message.supportedDbVersions[i] = object.supportedDbVersions[i]; - break; - } - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.supportedDbVersions[i] = 0; - break; - case "POSTGRES_13": - case 1: - message.supportedDbVersions[i] = 1; - break; - case "POSTGRES_14": - case 2: - message.supportedDbVersions[i] = 2; - break; - case "POSTGRES_15": - case 3: - message.supportedDbVersions[i] = 3; - break; - case "POSTGRES_16": - case 4: - message.supportedDbVersions[i] = 4; - break; - case "POSTGRES_17": - case 5: - message.supportedDbVersions[i] = 5; - break; - case "POSTGRES_18": - case 6: - message.supportedDbVersions[i] = 6; - break; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "DATABASE": - case 1: - message.scope = 1; - break; - case "CONNECTION_POOL": - case 2: - message.scope = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag} message SupportedDatabaseFlag - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDbVersions = []; - if (options.defaults) { - object.name = ""; - object.flagName = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.acceptsMultipleValues = false; - object.requiresDbRestart = false; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.flagName != null && message.hasOwnProperty("flagName")) - object.flagName = message.flagName; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - object.acceptsMultipleValues = message.acceptsMultipleValues; - if (message.supportedDbVersions && message.supportedDbVersions.length) { - object.supportedDbVersions = []; - for (var j = 0; j < message.supportedDbVersions.length; ++j) - object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - object.requiresDbRestart = message.requiresDbRestart; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - object.stringRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); - if (options.oneofs) - object.restrictions = "stringRestrictions"; - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - object.integerRestrictions = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); - if (options.oneofs) - object.restrictions = "integerRestrictions"; - } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] : message.scope; - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { - object.recommendedStringValue = message.recommendedStringValue; - if (options.oneofs) - object.recommendedValue = "recommendedStringValue"; - } - if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { - object.recommendedIntegerValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntegerValue, options); - if (options.oneofs) - object.recommendedValue = "recommendedIntegerValue"; - } - return object; - }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @instance - * @returns {Object.} JSON object - */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag"; - }; - - SupportedDatabaseFlag.StringRestrictions = (function() { - - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ - - /** - * Constructs a new StringRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @classdesc Represents a StringRestrictions. - * @implements IStringRestrictions - * @constructor - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - */ - function StringRestrictions(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance - */ - StringRestrictions.create = function create(properties) { - return new StringRestrictions(properties); - }; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); - return writer; - }; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) - if (!$util.isString(message.allowedValues[i])) - return "allowedValues: string[] expected"; - } - return null; - }; - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - */ - StringRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) - message.allowedValues[i] = String(object.allowedValues[i]); - } - return message; - }; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = message.allowedValues[j]; - } - return object; - }; - - /** - * Converts this StringRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @instance - * @returns {Object.} JSON object - */ - StringRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.StringRestrictions"; - }; - - return StringRestrictions; - })(); - - SupportedDatabaseFlag.IntegerRestrictions = (function() { - - /** - * Properties of an IntegerRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @interface IIntegerRestrictions - * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue - * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue - */ - - /** - * Constructs a new IntegerRestrictions. - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag - * @classdesc Represents an IntegerRestrictions. - * @implements IIntegerRestrictions - * @constructor - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - */ - function IntegerRestrictions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.minValue = null; - - /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.maxValue = null; - - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance - */ - IntegerRestrictions.create = function create(properties) { - return new IntegerRestrictions(properties); - }; - - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntegerRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minValue != null && message.hasOwnProperty("minValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.minValue); - if (error) - return "minValue." + error; - } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.maxValue); - if (error) - return "maxValue." + error; - } - return null; - }; - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - */ - IntegerRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions(); - if (object.minValue != null) { - if (typeof object.minValue !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); - message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); - } - if (object.maxValue != null) { - if (typeof object.maxValue !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); - message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); - } - return message; - }; - - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minValue = null; - object.maxValue = null; - } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); - return object; - }; - - /** - * Converts this IntegerRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @instance - * @returns {Object.} JSON object - */ - IntegerRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IntegerRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.IntegerRestrictions"; - }; - - return IntegerRestrictions; - })(); - - /** - * ValueType enum. - * @name google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} FLOAT=3 FLOAT value - * @property {number} NONE=4 NONE value - */ - SupportedDatabaseFlag.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "FLOAT"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); - - /** - * Scope enum. - * @name google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope - * @enum {number} - * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value - * @property {number} DATABASE=1 DATABASE value - * @property {number} CONNECTION_POOL=2 CONNECTION_POOL value - */ - SupportedDatabaseFlag.Scope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATABASE"] = 1; - values[valuesById[2] = "CONNECTION_POOL"] = 2; - return values; - })(); - - return SupportedDatabaseFlag; - })(); - - v1alpha.User = (function() { - - /** - * Properties of a User. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUser - * @property {string|null} [name] User name - * @property {string|null} [password] User password - * @property {Array.|null} [databaseRoles] User databaseRoles - * @property {google.cloud.alloydb.v1alpha.User.UserType|null} [userType] User userType - * @property {boolean|null} [keepExtraRoles] User keepExtraRoles - */ - - /** - * Constructs a new User. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a User. - * @implements IUser - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUser=} [properties] Properties to set - */ - function User(properties) { - this.databaseRoles = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * User name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.User - * @instance - */ - User.prototype.name = ""; - - /** - * User password. - * @member {string} password - * @memberof google.cloud.alloydb.v1alpha.User - * @instance - */ - User.prototype.password = ""; - - /** - * User databaseRoles. - * @member {Array.} databaseRoles - * @memberof google.cloud.alloydb.v1alpha.User - * @instance - */ - User.prototype.databaseRoles = $util.emptyArray; - - /** - * User userType. - * @member {google.cloud.alloydb.v1alpha.User.UserType} userType - * @memberof google.cloud.alloydb.v1alpha.User - * @instance - */ - User.prototype.userType = 0; - - /** - * User keepExtraRoles. - * @member {boolean} keepExtraRoles - * @memberof google.cloud.alloydb.v1alpha.User - * @instance - */ - User.prototype.keepExtraRoles = false; - - /** - * Creates a new User instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {google.cloud.alloydb.v1alpha.IUser=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.User} User instance - */ - User.create = function create(properties) { - return new User(properties); - }; - - /** - * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {google.cloud.alloydb.v1alpha.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); - if (message.databaseRoles != null && message.databaseRoles.length) - for (var i = 0; i < message.databaseRoles.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); - if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); - if (message.keepExtraRoles != null && Object.hasOwnProperty.call(message, "keepExtraRoles")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.keepExtraRoles); - return writer; - }; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.User.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {google.cloud.alloydb.v1alpha.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a User message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.User(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.password = reader.string(); - break; - } - case 4: { - if (!(message.databaseRoles && message.databaseRoles.length)) - message.databaseRoles = []; - message.databaseRoles.push(reader.string()); - break; - } - case 5: { - message.userType = reader.int32(); - break; - } - case 6: { - message.keepExtraRoles = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a User message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - User.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { - if (!Array.isArray(message.databaseRoles)) - return "databaseRoles: array expected"; - for (var i = 0; i < message.databaseRoles.length; ++i) - if (!$util.isString(message.databaseRoles[i])) - return "databaseRoles: string[] expected"; - } - if (message.userType != null && message.hasOwnProperty("userType")) - switch (message.userType) { - default: - return "userType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) - if (typeof message.keepExtraRoles !== "boolean") - return "keepExtraRoles: boolean expected"; - return null; - }; - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.User} User - */ - User.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.User) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.User(); - if (object.name != null) - message.name = String(object.name); - if (object.password != null) - message.password = String(object.password); - if (object.databaseRoles) { - if (!Array.isArray(object.databaseRoles)) - throw TypeError(".google.cloud.alloydb.v1alpha.User.databaseRoles: array expected"); - message.databaseRoles = []; - for (var i = 0; i < object.databaseRoles.length; ++i) - message.databaseRoles[i] = String(object.databaseRoles[i]); - } - switch (object.userType) { - default: - if (typeof object.userType === "number") { - message.userType = object.userType; - break; - } - break; - case "USER_TYPE_UNSPECIFIED": - case 0: - message.userType = 0; - break; - case "ALLOYDB_BUILT_IN": - case 1: - message.userType = 1; - break; - case "ALLOYDB_IAM_USER": - case 2: - message.userType = 2; - break; - } - if (object.keepExtraRoles != null) - message.keepExtraRoles = Boolean(object.keepExtraRoles); - return message; - }; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {google.cloud.alloydb.v1alpha.User} message User - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - User.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databaseRoles = []; - if (options.defaults) { - object.name = ""; - object.password = ""; - object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; - object.keepExtraRoles = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.databaseRoles && message.databaseRoles.length) { - object.databaseRoles = []; - for (var j = 0; j < message.databaseRoles.length; ++j) - object.databaseRoles[j] = message.databaseRoles[j]; - } - if (message.userType != null && message.hasOwnProperty("userType")) - object.userType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1alpha.User.UserType[message.userType] : message.userType; - if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) - object.keepExtraRoles = message.keepExtraRoles; - return object; - }; - - /** - * Converts this User to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.User - * @instance - * @returns {Object.} JSON object - */ - User.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for User - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.User - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.User"; - }; - - /** - * UserType enum. - * @name google.cloud.alloydb.v1alpha.User.UserType - * @enum {number} - * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value - * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value - * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value - */ - User.UserType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; - values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; - return values; - })(); - - return User; - })(); - - v1alpha.Database = (function() { - - /** - * Properties of a Database. - * @memberof google.cloud.alloydb.v1alpha - * @interface IDatabase - * @property {string|null} [name] Database name - * @property {string|null} [charset] Database charset - * @property {string|null} [collation] Database collation - * @property {string|null} [characterType] Database characterType - * @property {boolean|null} [isTemplate] Database isTemplate - * @property {string|null} [databaseTemplate] Database databaseTemplate - * @property {boolean|null} [isTemplateDatabase] Database isTemplateDatabase - */ - - /** - * Constructs a new Database. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a Database. - * @implements IDatabase - * @constructor - * @param {google.cloud.alloydb.v1alpha.IDatabase=} [properties] Properties to set - */ - function Database(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Database name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.name = ""; - - /** - * Database charset. - * @member {string} charset - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.charset = ""; - - /** - * Database collation. - * @member {string} collation - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.collation = ""; - - /** - * Database characterType. - * @member {string} characterType - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.characterType = ""; - - /** - * Database isTemplate. - * @member {boolean} isTemplate - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.isTemplate = false; - - /** - * Database databaseTemplate. - * @member {string} databaseTemplate - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.databaseTemplate = ""; - - /** - * Database isTemplateDatabase. - * @member {boolean|null|undefined} isTemplateDatabase - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - */ - Database.prototype.isTemplateDatabase = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Database.prototype, "_isTemplateDatabase", { - get: $util.oneOfGetter($oneOfFields = ["isTemplateDatabase"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Database instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {google.cloud.alloydb.v1alpha.IDatabase=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.Database} Database instance - */ - Database.create = function create(properties) { - return new Database(properties); - }; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {google.cloud.alloydb.v1alpha.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.charset); - if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.collation); - if (message.characterType != null && Object.hasOwnProperty.call(message, "characterType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.characterType); - if (message.isTemplate != null && Object.hasOwnProperty.call(message, "isTemplate")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isTemplate); - if (message.databaseTemplate != null && Object.hasOwnProperty.call(message, "databaseTemplate")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseTemplate); - if (message.isTemplateDatabase != null && Object.hasOwnProperty.call(message, "isTemplateDatabase")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isTemplateDatabase); - return writer; - }; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Database.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {google.cloud.alloydb.v1alpha.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Database message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Database(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.charset = reader.string(); - break; - } - case 3: { - message.collation = reader.string(); - break; - } - case 4: { - message.characterType = reader.string(); - break; - } - case 5: { - message.isTemplate = reader.bool(); - break; - } - case 6: { - message.databaseTemplate = reader.string(); - break; - } - case 7: { - message.isTemplateDatabase = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Database message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Database.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.charset != null && message.hasOwnProperty("charset")) - if (!$util.isString(message.charset)) - return "charset: string expected"; - if (message.collation != null && message.hasOwnProperty("collation")) - if (!$util.isString(message.collation)) - return "collation: string expected"; - if (message.characterType != null && message.hasOwnProperty("characterType")) - if (!$util.isString(message.characterType)) - return "characterType: string expected"; - if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) - if (typeof message.isTemplate !== "boolean") - return "isTemplate: boolean expected"; - if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) - if (!$util.isString(message.databaseTemplate)) - return "databaseTemplate: string expected"; - if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { - properties._isTemplateDatabase = 1; - if (typeof message.isTemplateDatabase !== "boolean") - return "isTemplateDatabase: boolean expected"; - } - return null; - }; - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.Database} Database - */ - Database.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.Database) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.Database(); - if (object.name != null) - message.name = String(object.name); - if (object.charset != null) - message.charset = String(object.charset); - if (object.collation != null) - message.collation = String(object.collation); - if (object.characterType != null) - message.characterType = String(object.characterType); - if (object.isTemplate != null) - message.isTemplate = Boolean(object.isTemplate); - if (object.databaseTemplate != null) - message.databaseTemplate = String(object.databaseTemplate); - if (object.isTemplateDatabase != null) - message.isTemplateDatabase = Boolean(object.isTemplateDatabase); - return message; - }; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {google.cloud.alloydb.v1alpha.Database} message Database - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Database.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.charset = ""; - object.collation = ""; - object.characterType = ""; - object.isTemplate = false; - object.databaseTemplate = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.charset != null && message.hasOwnProperty("charset")) - object.charset = message.charset; - if (message.collation != null && message.hasOwnProperty("collation")) - object.collation = message.collation; - if (message.characterType != null && message.hasOwnProperty("characterType")) - object.characterType = message.characterType; - if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) - object.isTemplate = message.isTemplate; - if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) - object.databaseTemplate = message.databaseTemplate; - if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { - object.isTemplateDatabase = message.isTemplateDatabase; - if (options.oneofs) - object._isTemplateDatabase = "isTemplateDatabase"; - } - return object; - }; - - /** - * Converts this Database to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.Database - * @instance - * @returns {Object.} JSON object - */ - Database.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Database - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.Database - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Database"; - }; - - return Database; - })(); - - /** - * GCAEntitlementType enum. - * @name google.cloud.alloydb.v1alpha.GCAEntitlementType - * @enum {number} - * @property {number} GCA_ENTITLEMENT_TYPE_UNSPECIFIED=0 GCA_ENTITLEMENT_TYPE_UNSPECIFIED value - * @property {number} GCA_STANDARD=1 GCA_STANDARD value - */ - v1alpha.GCAEntitlementType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GCA_ENTITLEMENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GCA_STANDARD"] = 1; - return values; - })(); - - v1alpha.GeminiClusterConfig = (function() { - - /** - * Properties of a GeminiClusterConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGeminiClusterConfig - * @property {boolean|null} [entitled] GeminiClusterConfig entitled - */ - - /** - * Constructs a new GeminiClusterConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GeminiClusterConfig. - * @implements IGeminiClusterConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig=} [properties] Properties to set - */ - function GeminiClusterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeminiClusterConfig entitled. - * @member {boolean} entitled - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @instance - */ - GeminiClusterConfig.prototype.entitled = false; - - /** - * Creates a new GeminiClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig instance - */ - GeminiClusterConfig.create = function create(properties) { - return new GeminiClusterConfig(properties); - }; - - /** - * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); - return writer; - }; - - /** - * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entitled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeminiClusterConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeminiClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entitled != null && message.hasOwnProperty("entitled")) - if (typeof message.entitled !== "boolean") - return "entitled: boolean expected"; - return null; - }; - - /** - * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GeminiClusterConfig} GeminiClusterConfig - */ - GeminiClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GeminiClusterConfig(); - if (object.entitled != null) - message.entitled = Boolean(object.entitled); - return message; - }; - - /** - * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1alpha.GeminiClusterConfig} message GeminiClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeminiClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.entitled = false; - if (message.entitled != null && message.hasOwnProperty("entitled")) - object.entitled = message.entitled; - return object; - }; - - /** - * Converts this GeminiClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @instance - * @returns {Object.} JSON object - */ - GeminiClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeminiClusterConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GeminiClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeminiClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GeminiClusterConfig"; - }; - - return GeminiClusterConfig; - })(); - - v1alpha.GeminiInstanceConfig = (function() { - - /** - * Properties of a GeminiInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGeminiInstanceConfig - * @property {boolean|null} [entitled] GeminiInstanceConfig entitled - */ - - /** - * Constructs a new GeminiInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GeminiInstanceConfig. - * @implements IGeminiInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig=} [properties] Properties to set - */ - function GeminiInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeminiInstanceConfig entitled. - * @member {boolean} entitled - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @instance - */ - GeminiInstanceConfig.prototype.entitled = false; - - /** - * Creates a new GeminiInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig instance - */ - GeminiInstanceConfig.create = function create(properties) { - return new GeminiInstanceConfig(properties); - }; - - /** - * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); - return writer; - }; - - /** - * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GeminiInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entitled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeminiInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeminiInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entitled != null && message.hasOwnProperty("entitled")) - if (typeof message.entitled !== "boolean") - return "entitled: boolean expected"; - return null; - }; - - /** - * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} GeminiInstanceConfig - */ - GeminiInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GeminiInstanceConfig(); - if (object.entitled != null) - message.entitled = Boolean(object.entitled); - return message; - }; - - /** - * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.GeminiInstanceConfig} message GeminiInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeminiInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.entitled = false; - if (message.entitled != null && message.hasOwnProperty("entitled")) - object.entitled = message.entitled; - return object; - }; - - /** - * Converts this GeminiInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - GeminiInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeminiInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GeminiInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeminiInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GeminiInstanceConfig"; - }; - - return GeminiInstanceConfig; - })(); - - v1alpha.GCAInstanceConfig = (function() { - - /** - * Properties of a GCAInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGCAInstanceConfig - * @property {google.cloud.alloydb.v1alpha.GCAEntitlementType|null} [gcaEntitlement] GCAInstanceConfig gcaEntitlement - */ - - /** - * Constructs a new GCAInstanceConfig. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GCAInstanceConfig. - * @implements IGCAInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig=} [properties] Properties to set - */ - function GCAInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCAInstanceConfig gcaEntitlement. - * @member {google.cloud.alloydb.v1alpha.GCAEntitlementType} gcaEntitlement - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @instance - */ - GCAInstanceConfig.prototype.gcaEntitlement = 0; - - /** - * Creates a new GCAInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig instance - */ - GCAInstanceConfig.create = function create(properties) { - return new GCAInstanceConfig(properties); - }; - - /** - * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCAInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcaEntitlement != null && Object.hasOwnProperty.call(message, "gcaEntitlement")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.gcaEntitlement); - return writer; - }; - - /** - * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GCAInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCAInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCAInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcaEntitlement = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCAInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCAInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCAInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) - switch (message.gcaEntitlement) { - default: - return "gcaEntitlement: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GCAInstanceConfig} GCAInstanceConfig - */ - GCAInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GCAInstanceConfig(); - switch (object.gcaEntitlement) { - default: - if (typeof object.gcaEntitlement === "number") { - message.gcaEntitlement = object.gcaEntitlement; - break; - } - break; - case "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": - case 0: - message.gcaEntitlement = 0; - break; - case "GCA_STANDARD": - case 1: - message.gcaEntitlement = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1alpha.GCAInstanceConfig} message GCAInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCAInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcaEntitlement = options.enums === String ? "GCA_ENTITLEMENT_TYPE_UNSPECIFIED" : 0; - if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) - object.gcaEntitlement = options.enums === String ? $root.google.cloud.alloydb.v1alpha.GCAEntitlementType[message.gcaEntitlement] === undefined ? message.gcaEntitlement : $root.google.cloud.alloydb.v1alpha.GCAEntitlementType[message.gcaEntitlement] : message.gcaEntitlement; - return object; - }; - - /** - * Converts this GCAInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - GCAInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCAInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GCAInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCAInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GCAInstanceConfig"; - }; - - return GCAInstanceConfig; - })(); - - v1alpha.AlloyDBAdmin = (function() { - - /** - * Constructs a new AlloyDBAdmin service. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an AlloyDBAdmin - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; - - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listClusters}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} [response] ListClustersResponse - */ - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1alpha.ListClustersRequest, $root.google.cloud.alloydb.v1alpha.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Cluster} [response] Cluster - */ - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1alpha.GetClusterRequest, $root.google.cloud.alloydb.v1alpha.Cluster, request, callback); - }, "name", { value: "GetCluster" }); - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1alpha.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|exportCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ExportClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportCluster. - * @function exportCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} request ExportClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.exportCluster = function exportCluster(request, callback) { - return this.rpcCall(exportCluster, $root.google.cloud.alloydb.v1alpha.ExportClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportCluster" }); - - /** - * Calls ExportCluster. - * @function exportCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} request ExportClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|importCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ImportClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportCluster. - * @function importCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} request ImportClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.importCluster = function importCluster(request, callback) { - return this.rpcCall(importCluster, $root.google.cloud.alloydb.v1alpha.ImportClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportCluster" }); - - /** - * Calls ImportCluster. - * @function importCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} request ImportClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|upgradeCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpgradeClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpgradeCluster. - * @function upgradeCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.upgradeCluster = function upgradeCluster(request, callback) { - return this.rpcCall(upgradeCluster, $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpgradeCluster" }); - - /** - * Calls UpgradeCluster. - * @function upgradeCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|promoteCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef PromoteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { - return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PromoteCluster" }); - - /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|switchoverCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef SwitchoverClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SwitchoverCluster. - * @function switchoverCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.switchoverCluster = function switchoverCluster(request, callback) { - return this.rpcCall(switchoverCluster, $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SwitchoverCluster" }); - - /** - * Calls SwitchoverCluster. - * @function switchoverCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restoreCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef RestoreClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryCluster}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateSecondaryClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { - return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryCluster" }); - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listInstances}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1alpha.ListInstancesRequest, $root.google.cloud.alloydb.v1alpha.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1alpha.GetInstanceRequest, $root.google.cloud.alloydb.v1alpha.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createSecondaryInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateSecondaryInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { - return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryInstance" }); - - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|batchCreateInstances}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef BatchCreateInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { - return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateInstances" }); - - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|failoverInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef FailoverInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { - return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "FailoverInstance" }); - - /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|injectFault}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef InjectFaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls InjectFault. - * @function injectFault - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} request InjectFaultRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { - return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1alpha.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "InjectFault" }); - - /** - * Calls InjectFault. - * @function injectFault - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} request InjectFaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|restartInstance}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef RestartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { - return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartInstance" }); - - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|executeSql}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ExecuteSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} [response] ExecuteSqlResponse - */ - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ExecuteSqlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest, $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse, request, callback); - }, "name", { value: "ExecuteSql" }); - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listBackups}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} [response] ListBackupsResponse - */ - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1alpha.ListBackupsRequest, $root.google.cloud.alloydb.v1alpha.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Backup} [response] Backup - */ - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1alpha.GetBackupRequest, $root.google.cloud.alloydb.v1alpha.Backup, request, callback); - }, "name", { value: "GetBackup" }); - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1alpha.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteBackup}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListSupportedDatabaseFlagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse - */ - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { - return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse, request, callback); - }, "name", { value: "ListSupportedDatabaseFlags" }); - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|generateClientCertificate}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GenerateClientCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse - */ - - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { - return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse, request, callback); - }, "name", { value: "GenerateClientCertificate" }); - - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getConnectionInfo}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetConnectionInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ConnectionInfo} [response] ConnectionInfo - */ - - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { - return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1alpha.ConnectionInfo, request, callback); - }, "name", { value: "GetConnectionInfo" }); - - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listUsers}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListUsersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListUsersResponse} [response] ListUsersResponse - */ - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} request ListUsersRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { - return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1alpha.ListUsersRequest, $root.google.cloud.alloydb.v1alpha.ListUsersResponse, request, callback); - }, "name", { value: "ListUsers" }); - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} request ListUsersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|getUser}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef GetUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.User} [response] User - */ - - /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} request GetUserRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { - return this.rpcCall(getUser, $root.google.cloud.alloydb.v1alpha.GetUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); - }, "name", { value: "GetUser" }); - - /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} request GetUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createUser}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.User} [response] User - */ - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} request CreateUserRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { - return this.rpcCall(createUser, $root.google.cloud.alloydb.v1alpha.CreateUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); - }, "name", { value: "CreateUser" }); - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} request CreateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|updateUser}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef UpdateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.User} [response] User - */ - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { - return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1alpha.UpdateUserRequest, $root.google.cloud.alloydb.v1alpha.User, request, callback); - }, "name", { value: "UpdateUser" }); - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|deleteUser}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef DeleteUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { - return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1alpha.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteUser" }); - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|listDatabases}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef ListDatabasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.ListDatabasesResponse} [response] ListDatabasesResponse - */ - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listDatabases = function listDatabases(request, callback) { - return this.rpcCall(listDatabases, $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest, $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse, request, callback); - }, "name", { value: "ListDatabases" }); - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1alpha.AlloyDBAdmin|createDatabase}. - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @typedef CreateDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1alpha.Database} [response] Database - */ - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @param {google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Database - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createDatabase = function createDatabase(request, callback) { - return this.rpcCall(createDatabase, $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest, $root.google.cloud.alloydb.v1alpha.Database, request, callback); - }, "name", { value: "CreateDatabase" }); - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.cloud.alloydb.v1alpha.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBAdmin; - })(); - - v1alpha.ListClustersRequest = (function() { - - /** - * Properties of a ListClustersRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - * @property {string|null} [filter] ListClustersRequest filter - * @property {string|null} [orderBy] ListClustersRequest orderBy - */ - - /** - * Constructs a new ListClustersRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set - */ - function ListClustersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.parent = ""; - - /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageSize = 0; - - /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageToken = ""; - - /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.filter = ""; - - /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest instance - */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); - }; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListClustersRequest} ListClustersRequest - */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListClustersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListClustersRequest} message ListClustersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListClustersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @instance - * @returns {Object.} JSON object - */ - ListClustersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListClustersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersRequest"; - }; - - return ListClustersRequest; - })(); - - v1alpha.ListClustersResponse = (function() { - - /** - * Properties of a ListClustersResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - * @property {Array.|null} [unreachable] ListClustersResponse unreachable - */ - - /** - * Constructs a new ListClustersResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set - */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.clusters = $util.emptyArray; - - /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.nextPageToken = ""; - - /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse instance - */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); - }; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListClustersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.clusters[i]); - if (error) - return "clusters." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListClustersResponse} ListClustersResponse - */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListClustersResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.clusters[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListClustersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListClustersResponse} message ListClustersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.clusters = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.clusters[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListClustersResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @instance - * @returns {Object.} JSON object - */ - ListClustersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListClustersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListClustersResponse"; - }; - - return ListClustersResponse; - })(); - - v1alpha.GetClusterRequest = (function() { - - /** - * Properties of a GetClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name - * @property {google.cloud.alloydb.v1alpha.ClusterView|null} [view] GetClusterRequest view - */ - - /** - * Constructs a new GetClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set - */ - function GetClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.name = ""; - - /** - * GetClusterRequest view. - * @member {google.cloud.alloydb.v1alpha.ClusterView} view - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.view = 0; - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest instance - */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); - }; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetClusterRequest} GetClusterRequest - */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "CLUSTER_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "CLUSTER_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "CLUSTER_VIEW_CONTINUOUS_BACKUP": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetClusterRequest} message GetClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.ClusterView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @instance - * @returns {Object.} JSON object - */ - GetClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetClusterRequest"; - }; - - return GetClusterRequest; - })(); - - v1alpha.CreateSecondaryClusterRequest = (function() { - - /** - * Properties of a CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateSecondaryClusterRequest - * @property {string|null} [parent] CreateSecondaryClusterRequest parent - * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster - * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly - */ - - /** - * Constructs a new CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateSecondaryClusterRequest. - * @implements ICreateSecondaryClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set - */ - function CreateSecondaryClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecondaryClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.parent = ""; - - /** - * CreateSecondaryClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.clusterId = ""; - - /** - * CreateSecondaryClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.cluster = null; - - /** - * CreateSecondaryClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.requestId = ""; - - /** - * CreateSecondaryClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance - */ - CreateSecondaryClusterRequest.create = function create(properties) { - return new CreateSecondaryClusterRequest(properties); - }; - - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecondaryClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - */ - CreateSecondaryClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest"; - }; - - return CreateSecondaryClusterRequest; - })(); - - v1alpha.CreateClusterRequest = (function() { - - /** - * Properties of a CreateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateClusterRequest - * @property {string|null} [parent] CreateClusterRequest parent - * @property {string|null} [clusterId] CreateClusterRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly - */ - - /** - * Constructs a new CreateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set - */ - function CreateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.parent = ""; - - /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.clusterId = ""; - - /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.cluster = null; - - /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.requestId = ""; - - /** - * CreateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest instance - */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); - }; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateClusterRequest} CreateClusterRequest - */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateClusterRequest} message CreateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateClusterRequest"; - }; - - return CreateClusterRequest; - })(); - - v1alpha.UpdateClusterRequest = (function() { - - /** - * Properties of an UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateClusterRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {string|null} [requestId] UpdateClusterRequest requestId - * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing - */ - - /** - * Constructs a new UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set - */ - function UpdateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.updateMask = null; - - /** - * UpdateClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.cluster = null; - - /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.requestId = ""; - - /** - * UpdateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.validateOnly = false; - - /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest instance - */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); - }; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateClusterRequest} UpdateClusterRequest - */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateClusterRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.UpdateClusterRequest} message UpdateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateClusterRequest"; - }; - - return UpdateClusterRequest; - })(); - - v1alpha.GcsDestination = (function() { - - /** - * Properties of a GcsDestination. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - */ - - /** - * Constructs a new GcsDestination. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGcsDestination=} [properties] Properties to set - */ - function GcsDestination(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {google.cloud.alloydb.v1alpha.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination instance - */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); - }; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {google.cloud.alloydb.v1alpha.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GcsDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {google.cloud.alloydb.v1alpha.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GcsDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDestination message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GcsDestination} GcsDestination - */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GcsDestination) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {google.cloud.alloydb.v1alpha.GcsDestination} message GcsDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this GcsDestination to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @instance - * @returns {Object.} JSON object - */ - GcsDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDestination - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GcsDestination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GcsDestination"; - }; - - return GcsDestination; - })(); - - v1alpha.ExportClusterRequest = (function() { - - /** - * Properties of an ExportClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IExportClusterRequest - * @property {google.cloud.alloydb.v1alpha.IGcsDestination|null} [gcsDestination] ExportClusterRequest gcsDestination - * @property {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null} [csvExportOptions] ExportClusterRequest csvExportOptions - * @property {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null} [sqlExportOptions] ExportClusterRequest sqlExportOptions - * @property {string|null} [name] ExportClusterRequest name - * @property {string|null} [database] ExportClusterRequest database - */ - - /** - * Constructs a new ExportClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ExportClusterRequest. - * @implements IExportClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest=} [properties] Properties to set - */ - function ExportClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportClusterRequest gcsDestination. - * @member {google.cloud.alloydb.v1alpha.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.gcsDestination = null; - - /** - * ExportClusterRequest csvExportOptions. - * @member {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions|null|undefined} csvExportOptions - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.csvExportOptions = null; - - /** - * ExportClusterRequest sqlExportOptions. - * @member {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions|null|undefined} sqlExportOptions - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.sqlExportOptions = null; - - /** - * ExportClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.name = ""; - - /** - * ExportClusterRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.database = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportClusterRequest destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - Object.defineProperty(ExportClusterRequest.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * ExportClusterRequest exportOptions. - * @member {"csvExportOptions"|"sqlExportOptions"|undefined} exportOptions - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - */ - Object.defineProperty(ExportClusterRequest.prototype, "exportOptions", { - get: $util.oneOfGetter($oneOfFields = ["csvExportOptions", "sqlExportOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest instance - */ - ExportClusterRequest.create = function create(properties) { - return new ExportClusterRequest(properties); - }; - - /** - * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} message ExportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.alloydb.v1alpha.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); - if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) - $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) - $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IExportClusterRequest} message ExportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.decode(reader, reader.uint32()); - break; - } - case 4: { - message.csvExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.sqlExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { - properties.exportOptions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify(message.csvExportOptions); - if (error) - return "csvExportOptions." + error; - } - } - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { - if (properties.exportOptions === 1) - return "exportOptions: multiple values"; - properties.exportOptions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify(message.sqlExportOptions); - if (error) - return "sqlExportOptions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest} ExportClusterRequest - */ - ExportClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.fromObject(object.gcsDestination); - } - if (object.csvExportOptions != null) { - if (typeof object.csvExportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.csvExportOptions: object expected"); - message.csvExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.fromObject(object.csvExportOptions); - } - if (object.sqlExportOptions != null) { - if (typeof object.sqlExportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.sqlExportOptions: object expected"); - message.sqlExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.fromObject(object.sqlExportOptions); - } - if (object.name != null) - message.name = String(object.name); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest} message ExportClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.database = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { - object.csvExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.toObject(message.csvExportOptions, options); - if (options.oneofs) - object.exportOptions = "csvExportOptions"; - } - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { - object.sqlExportOptions = $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.toObject(message.sqlExportOptions, options); - if (options.oneofs) - object.exportOptions = "sqlExportOptions"; - } - return object; - }; - - /** - * Converts this ExportClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @instance - * @returns {Object.} JSON object - */ - ExportClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterRequest"; - }; - - ExportClusterRequest.CsvExportOptions = (function() { - - /** - * Properties of a CsvExportOptions. - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @interface ICsvExportOptions - * @property {string|null} [selectQuery] CsvExportOptions selectQuery - * @property {string|null} [fieldDelimiter] CsvExportOptions fieldDelimiter - * @property {string|null} [quoteCharacter] CsvExportOptions quoteCharacter - * @property {string|null} [escapeCharacter] CsvExportOptions escapeCharacter - */ - - /** - * Constructs a new CsvExportOptions. - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @classdesc Represents a CsvExportOptions. - * @implements ICsvExportOptions - * @constructor - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set - */ - function CsvExportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CsvExportOptions selectQuery. - * @member {string} selectQuery - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.selectQuery = ""; - - /** - * CsvExportOptions fieldDelimiter. - * @member {string} fieldDelimiter - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.fieldDelimiter = ""; - - /** - * CsvExportOptions quoteCharacter. - * @member {string} quoteCharacter - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.quoteCharacter = ""; - - /** - * CsvExportOptions escapeCharacter. - * @member {string} escapeCharacter - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.escapeCharacter = ""; - - /** - * Creates a new CsvExportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions instance - */ - CsvExportOptions.create = function create(properties) { - return new CsvExportOptions(properties); - }; - - /** - * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvExportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); - if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldDelimiter); - if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.quoteCharacter); - if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.escapeCharacter); - return writer; - }; - - /** - * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvExportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selectQuery = reader.string(); - break; - } - case 2: { - message.fieldDelimiter = reader.string(); - break; - } - case 3: { - message.quoteCharacter = reader.string(); - break; - } - case 4: { - message.escapeCharacter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvExportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CsvExportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CsvExportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) - if (!$util.isString(message.selectQuery)) - return "selectQuery: string expected"; - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - if (!$util.isString(message.fieldDelimiter)) - return "fieldDelimiter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - if (!$util.isString(message.quoteCharacter)) - return "quoteCharacter: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - if (!$util.isString(message.escapeCharacter)) - return "escapeCharacter: string expected"; - return null; - }; - - /** - * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} CsvExportOptions - */ - CsvExportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions(); - if (object.selectQuery != null) - message.selectQuery = String(object.selectQuery); - if (object.fieldDelimiter != null) - message.fieldDelimiter = String(object.fieldDelimiter); - if (object.quoteCharacter != null) - message.quoteCharacter = String(object.quoteCharacter); - if (object.escapeCharacter != null) - message.escapeCharacter = String(object.escapeCharacter); - return message; - }; - - /** - * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} message CsvExportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CsvExportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.selectQuery = ""; - object.fieldDelimiter = ""; - object.quoteCharacter = ""; - object.escapeCharacter = ""; - } - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) - object.selectQuery = message.selectQuery; - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - object.fieldDelimiter = message.fieldDelimiter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - object.quoteCharacter = message.quoteCharacter; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - object.escapeCharacter = message.escapeCharacter; - return object; - }; - - /** - * Converts this CsvExportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @instance - * @returns {Object.} JSON object - */ - CsvExportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CsvExportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CsvExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions"; - }; - - return CsvExportOptions; - })(); - - ExportClusterRequest.SqlExportOptions = (function() { - - /** - * Properties of a SqlExportOptions. - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @interface ISqlExportOptions - * @property {Array.|null} [tables] SqlExportOptions tables - * @property {boolean|null} [schemaOnly] SqlExportOptions schemaOnly - * @property {boolean|null} [cleanTargetObjects] SqlExportOptions cleanTargetObjects - * @property {boolean|null} [ifExistTargetObjects] SqlExportOptions ifExistTargetObjects - */ - - /** - * Constructs a new SqlExportOptions. - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest - * @classdesc Represents a SqlExportOptions. - * @implements ISqlExportOptions - * @constructor - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set - */ - function SqlExportOptions(properties) { - this.tables = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlExportOptions tables. - * @member {Array.} tables - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.tables = $util.emptyArray; - - /** - * SqlExportOptions schemaOnly. - * @member {boolean|null|undefined} schemaOnly - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.schemaOnly = null; - - /** - * SqlExportOptions cleanTargetObjects. - * @member {boolean|null|undefined} cleanTargetObjects - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.cleanTargetObjects = null; - - /** - * SqlExportOptions ifExistTargetObjects. - * @member {boolean|null|undefined} ifExistTargetObjects - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.ifExistTargetObjects = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_schemaOnly", { - get: $util.oneOfGetter($oneOfFields = ["schemaOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_cleanTargetObjects", { - get: $util.oneOfGetter($oneOfFields = ["cleanTargetObjects"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_ifExistTargetObjects", { - get: $util.oneOfGetter($oneOfFields = ["ifExistTargetObjects"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SqlExportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions instance - */ - SqlExportOptions.create = function create(properties) { - return new SqlExportOptions(properties); - }; - - /** - * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlExportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tables != null && message.tables.length) - for (var i = 0; i < message.tables.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); - if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.schemaOnly); - if (message.cleanTargetObjects != null && Object.hasOwnProperty.call(message, "cleanTargetObjects")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanTargetObjects); - if (message.ifExistTargetObjects != null && Object.hasOwnProperty.call(message, "ifExistTargetObjects")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ifExistTargetObjects); - return writer; - }; - - /** - * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlExportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tables && message.tables.length)) - message.tables = []; - message.tables.push(reader.string()); - break; - } - case 2: { - message.schemaOnly = reader.bool(); - break; - } - case 3: { - message.cleanTargetObjects = reader.bool(); - break; - } - case 4: { - message.ifExistTargetObjects = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlExportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlExportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlExportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tables != null && message.hasOwnProperty("tables")) { - if (!Array.isArray(message.tables)) - return "tables: array expected"; - for (var i = 0; i < message.tables.length; ++i) - if (!$util.isString(message.tables[i])) - return "tables: string[] expected"; - } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { - properties._schemaOnly = 1; - if (typeof message.schemaOnly !== "boolean") - return "schemaOnly: boolean expected"; - } - if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { - properties._cleanTargetObjects = 1; - if (typeof message.cleanTargetObjects !== "boolean") - return "cleanTargetObjects: boolean expected"; - } - if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { - properties._ifExistTargetObjects = 1; - if (typeof message.ifExistTargetObjects !== "boolean") - return "ifExistTargetObjects: boolean expected"; - } - return null; - }; - - /** - * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} SqlExportOptions - */ - SqlExportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions(); - if (object.tables) { - if (!Array.isArray(object.tables)) - throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions.tables: array expected"); - message.tables = []; - for (var i = 0; i < object.tables.length; ++i) - message.tables[i] = String(object.tables[i]); - } - if (object.schemaOnly != null) - message.schemaOnly = Boolean(object.schemaOnly); - if (object.cleanTargetObjects != null) - message.cleanTargetObjects = Boolean(object.cleanTargetObjects); - if (object.ifExistTargetObjects != null) - message.ifExistTargetObjects = Boolean(object.ifExistTargetObjects); - return message; - }; - - /** - * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} message SqlExportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlExportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tables = []; - if (message.tables && message.tables.length) { - object.tables = []; - for (var j = 0; j < message.tables.length; ++j) - object.tables[j] = message.tables[j]; - } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { - object.schemaOnly = message.schemaOnly; - if (options.oneofs) - object._schemaOnly = "schemaOnly"; - } - if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { - object.cleanTargetObjects = message.cleanTargetObjects; - if (options.oneofs) - object._cleanTargetObjects = "cleanTargetObjects"; - } - if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { - object.ifExistTargetObjects = message.ifExistTargetObjects; - if (options.oneofs) - object._ifExistTargetObjects = "ifExistTargetObjects"; - } - return object; - }; - - /** - * Converts this SqlExportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @instance - * @returns {Object.} JSON object - */ - SqlExportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlExportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions"; - }; - - return SqlExportOptions; - })(); - - return ExportClusterRequest; - })(); - - v1alpha.ExportClusterResponse = (function() { - - /** - * Properties of an ExportClusterResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IExportClusterResponse - * @property {google.cloud.alloydb.v1alpha.IGcsDestination|null} [gcsDestination] ExportClusterResponse gcsDestination - */ - - /** - * Constructs a new ExportClusterResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ExportClusterResponse. - * @implements IExportClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse=} [properties] Properties to set - */ - function ExportClusterResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportClusterResponse gcsDestination. - * @member {google.cloud.alloydb.v1alpha.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @instance - */ - ExportClusterResponse.prototype.gcsDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportClusterResponse destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @instance - */ - Object.defineProperty(ExportClusterResponse.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse instance - */ - ExportClusterResponse.create = function create(properties) { - return new ExportClusterResponse(properties); - }; - - /** - * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse} message ExportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.alloydb.v1alpha.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExportClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IExportClusterResponse} message ExportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExportClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - return null; - }; - - /** - * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExportClusterResponse} ExportClusterResponse - */ - ExportClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExportClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExportClusterResponse(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExportClusterResponse.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.fromObject(object.gcsDestination); - } - return message; - }; - - /** - * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ExportClusterResponse} message ExportClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.alloydb.v1alpha.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - return object; - }; - - /** - * Converts this ExportClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @instance - * @returns {Object.} JSON object - */ - ExportClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExportClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExportClusterResponse"; - }; - - return ExportClusterResponse; - })(); - - v1alpha.ImportClusterRequest = (function() { - - /** - * Properties of an ImportClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IImportClusterRequest - * @property {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null} [sqlImportOptions] ImportClusterRequest sqlImportOptions - * @property {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null} [csvImportOptions] ImportClusterRequest csvImportOptions - * @property {string|null} [name] ImportClusterRequest name - * @property {string|null} [gcsUri] ImportClusterRequest gcsUri - * @property {string|null} [database] ImportClusterRequest database - * @property {string|null} [user] ImportClusterRequest user - */ - - /** - * Constructs a new ImportClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ImportClusterRequest. - * @implements IImportClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest=} [properties] Properties to set - */ - function ImportClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportClusterRequest sqlImportOptions. - * @member {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions|null|undefined} sqlImportOptions - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.sqlImportOptions = null; - - /** - * ImportClusterRequest csvImportOptions. - * @member {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions|null|undefined} csvImportOptions - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.csvImportOptions = null; - - /** - * ImportClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.name = ""; - - /** - * ImportClusterRequest gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.gcsUri = ""; - - /** - * ImportClusterRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.database = ""; - - /** - * ImportClusterRequest user. - * @member {string} user - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.user = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportClusterRequest importOptions. - * @member {"sqlImportOptions"|"csvImportOptions"|undefined} importOptions - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - */ - Object.defineProperty(ImportClusterRequest.prototype, "importOptions", { - get: $util.oneOfGetter($oneOfFields = ["sqlImportOptions", "csvImportOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest instance - */ - ImportClusterRequest.create = function create(properties) { - return new ImportClusterRequest(properties); - }; - - /** - * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} message ImportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); - if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) - $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.user); - if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) - $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IImportClusterRequest} message ImportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.sqlImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.decode(reader, reader.uint32()); - break; - } - case 7: { - message.csvImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.gcsUri = reader.string(); - break; - } - case 3: { - message.database = reader.string(); - break; - } - case 5: { - message.user = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { - properties.importOptions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify(message.sqlImportOptions); - if (error) - return "sqlImportOptions." + error; - } - } - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { - if (properties.importOptions === 1) - return "importOptions: multiple values"; - properties.importOptions = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify(message.csvImportOptions); - if (error) - return "csvImportOptions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - return null; - }; - - /** - * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest} ImportClusterRequest - */ - ImportClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest(); - if (object.sqlImportOptions != null) { - if (typeof object.sqlImportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ImportClusterRequest.sqlImportOptions: object expected"); - message.sqlImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.fromObject(object.sqlImportOptions); - } - if (object.csvImportOptions != null) { - if (typeof object.csvImportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ImportClusterRequest.csvImportOptions: object expected"); - message.csvImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.fromObject(object.csvImportOptions); - } - if (object.name != null) - message.name = String(object.name); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.database != null) - message.database = String(object.database); - if (object.user != null) - message.user = String(object.user); - return message; - }; - - /** - * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest} message ImportClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.gcsUri = ""; - object.database = ""; - object.user = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { - object.sqlImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.toObject(message.sqlImportOptions, options); - if (options.oneofs) - object.importOptions = "sqlImportOptions"; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { - object.csvImportOptions = $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.toObject(message.csvImportOptions, options); - if (options.oneofs) - object.importOptions = "csvImportOptions"; - } - return object; - }; - - /** - * Converts this ImportClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @instance - * @returns {Object.} JSON object - */ - ImportClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterRequest"; - }; - - ImportClusterRequest.SqlImportOptions = (function() { - - /** - * Properties of a SqlImportOptions. - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @interface ISqlImportOptions - */ - - /** - * Constructs a new SqlImportOptions. - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @classdesc Represents a SqlImportOptions. - * @implements ISqlImportOptions - * @constructor - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set - */ - function SqlImportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new SqlImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions instance - */ - SqlImportOptions.create = function create(properties) { - return new SqlImportOptions(properties); - }; - - /** - * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlImportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} SqlImportOptions - */ - SqlImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions) - return object; - return new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions(); - }; - - /** - * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} message SqlImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlImportOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SqlImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @instance - * @returns {Object.} JSON object - */ - SqlImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlImportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions"; - }; - - return SqlImportOptions; - })(); - - ImportClusterRequest.CsvImportOptions = (function() { - - /** - * Properties of a CsvImportOptions. - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @interface ICsvImportOptions - * @property {string|null} [table] CsvImportOptions table - * @property {Array.|null} [columns] CsvImportOptions columns - * @property {string|null} [fieldDelimiter] CsvImportOptions fieldDelimiter - * @property {string|null} [quoteCharacter] CsvImportOptions quoteCharacter - * @property {string|null} [escapeCharacter] CsvImportOptions escapeCharacter - */ - - /** - * Constructs a new CsvImportOptions. - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest - * @classdesc Represents a CsvImportOptions. - * @implements ICsvImportOptions - * @constructor - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set - */ - function CsvImportOptions(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CsvImportOptions table. - * @member {string} table - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.table = ""; - - /** - * CsvImportOptions columns. - * @member {Array.} columns - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.columns = $util.emptyArray; - - /** - * CsvImportOptions fieldDelimiter. - * @member {string} fieldDelimiter - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.fieldDelimiter = ""; - - /** - * CsvImportOptions quoteCharacter. - * @member {string} quoteCharacter - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.quoteCharacter = ""; - - /** - * CsvImportOptions escapeCharacter. - * @member {string} escapeCharacter - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.escapeCharacter = ""; - - /** - * Creates a new CsvImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions instance - */ - CsvImportOptions.create = function create(properties) { - return new CsvImportOptions(properties); - }; - - /** - * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); - if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldDelimiter); - if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.quoteCharacter); - if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.escapeCharacter); - return writer; - }; - - /** - * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 3: { - message.fieldDelimiter = reader.string(); - break; - } - case 4: { - message.quoteCharacter = reader.string(); - break; - } - case 5: { - message.escapeCharacter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CsvImportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CsvImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - if (!$util.isString(message.fieldDelimiter)) - return "fieldDelimiter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - if (!$util.isString(message.quoteCharacter)) - return "quoteCharacter: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - if (!$util.isString(message.escapeCharacter)) - return "escapeCharacter: string expected"; - return null; - }; - - /** - * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} CsvImportOptions - */ - CsvImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions(); - if (object.table != null) - message.table = String(object.table); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.fieldDelimiter != null) - message.fieldDelimiter = String(object.fieldDelimiter); - if (object.quoteCharacter != null) - message.quoteCharacter = String(object.quoteCharacter); - if (object.escapeCharacter != null) - message.escapeCharacter = String(object.escapeCharacter); - return message; - }; - - /** - * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} message CsvImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CsvImportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.table = ""; - object.fieldDelimiter = ""; - object.quoteCharacter = ""; - object.escapeCharacter = ""; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - object.fieldDelimiter = message.fieldDelimiter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - object.quoteCharacter = message.quoteCharacter; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - object.escapeCharacter = message.escapeCharacter; - return object; - }; - - /** - * Converts this CsvImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @instance - * @returns {Object.} JSON object - */ - CsvImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CsvImportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CsvImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions"; - }; - - return CsvImportOptions; - })(); - - return ImportClusterRequest; - })(); - - v1alpha.ImportClusterResponse = (function() { - - /** - * Properties of an ImportClusterResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IImportClusterResponse - * @property {number|Long|null} [bytesDownloaded] ImportClusterResponse bytesDownloaded - */ - - /** - * Constructs a new ImportClusterResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ImportClusterResponse. - * @implements IImportClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse=} [properties] Properties to set - */ - function ImportClusterResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportClusterResponse bytesDownloaded. - * @member {number|Long} bytesDownloaded - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @instance - */ - ImportClusterResponse.prototype.bytesDownloaded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ImportClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse instance - */ - ImportClusterResponse.create = function create(properties) { - return new ImportClusterResponse(properties); - }; - - /** - * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse} message ImportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bytesDownloaded != null && Object.hasOwnProperty.call(message, "bytesDownloaded")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bytesDownloaded); - return writer; - }; - - /** - * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ImportClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IImportClusterResponse} message ImportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ImportClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bytesDownloaded = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) - if (!$util.isInteger(message.bytesDownloaded) && !(message.bytesDownloaded && $util.isInteger(message.bytesDownloaded.low) && $util.isInteger(message.bytesDownloaded.high))) - return "bytesDownloaded: integer|Long expected"; - return null; - }; - - /** - * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ImportClusterResponse} ImportClusterResponse - */ - ImportClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ImportClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ImportClusterResponse(); - if (object.bytesDownloaded != null) - if ($util.Long) - (message.bytesDownloaded = $util.Long.fromValue(object.bytesDownloaded)).unsigned = false; - else if (typeof object.bytesDownloaded === "string") - message.bytesDownloaded = parseInt(object.bytesDownloaded, 10); - else if (typeof object.bytesDownloaded === "number") - message.bytesDownloaded = object.bytesDownloaded; - else if (typeof object.bytesDownloaded === "object") - message.bytesDownloaded = new $util.LongBits(object.bytesDownloaded.low >>> 0, object.bytesDownloaded.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ImportClusterResponse} message ImportClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesDownloaded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesDownloaded = options.longs === String ? "0" : 0; - if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) - if (typeof message.bytesDownloaded === "number") - object.bytesDownloaded = options.longs === String ? String(message.bytesDownloaded) : message.bytesDownloaded; - else - object.bytesDownloaded = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDownloaded) : options.longs === Number ? new $util.LongBits(message.bytesDownloaded.low >>> 0, message.bytesDownloaded.high >>> 0).toNumber() : message.bytesDownloaded; - return object; - }; - - /** - * Converts this ImportClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @instance - * @returns {Object.} JSON object - */ - ImportClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ImportClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ImportClusterResponse"; - }; - - return ImportClusterResponse; - })(); - - v1alpha.UpgradeClusterRequest = (function() { - - /** - * Properties of an UpgradeClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpgradeClusterRequest - * @property {string|null} [name] UpgradeClusterRequest name - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [version] UpgradeClusterRequest version - * @property {string|null} [requestId] UpgradeClusterRequest requestId - * @property {boolean|null} [validateOnly] UpgradeClusterRequest validateOnly - * @property {string|null} [etag] UpgradeClusterRequest etag - */ - - /** - * Constructs a new UpgradeClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpgradeClusterRequest. - * @implements IUpgradeClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest=} [properties] Properties to set - */ - function UpgradeClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.name = ""; - - /** - * UpgradeClusterRequest version. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} version - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.version = 0; - - /** - * UpgradeClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.requestId = ""; - - /** - * UpgradeClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.validateOnly = false; - - /** - * UpgradeClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.etag = ""; - - /** - * Creates a new UpgradeClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest instance - */ - UpgradeClusterRequest.create = function create(properties) { - return new UpgradeClusterRequest(properties); - }; - - /** - * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.version = reader.int32(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - switch (message.version) { - default: - return "version: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} UpgradeClusterRequest - */ - UpgradeClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.version) { - default: - if (typeof object.version === "number") { - message.version = object.version; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.version = 0; - break; - case "POSTGRES_13": - case 1: - message.version = 1; - break; - case "POSTGRES_14": - case 2: - message.version = 2; - break; - case "POSTGRES_15": - case 3: - message.version = 3; - break; - case "POSTGRES_16": - case 4: - message.version = 4; - break; - case "POSTGRES_17": - case 5: - message.version = 5; - break; - case "POSTGRES_18": - case 6: - message.version = 6; - break; - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterRequest} message UpgradeClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.version = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.version] === undefined ? message.version : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.version] : message.version; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this UpgradeClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterRequest"; - }; - - return UpgradeClusterRequest; - })(); - - v1alpha.UpgradeClusterResponse = (function() { - - /** - * Properties of an UpgradeClusterResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpgradeClusterResponse - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [status] UpgradeClusterResponse status - * @property {string|null} [message] UpgradeClusterResponse message - * @property {Array.|null} [clusterUpgradeDetails] UpgradeClusterResponse clusterUpgradeDetails - */ - - /** - * Constructs a new UpgradeClusterResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpgradeClusterResponse. - * @implements IUpgradeClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse=} [properties] Properties to set - */ - function UpgradeClusterResponse(properties) { - this.clusterUpgradeDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterResponse status. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} status - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.status = 0; - - /** - * UpgradeClusterResponse message. - * @member {string} message - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.message = ""; - - /** - * UpgradeClusterResponse clusterUpgradeDetails. - * @member {Array.} clusterUpgradeDetails - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.clusterUpgradeDetails = $util.emptyArray; - - /** - * Creates a new UpgradeClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse instance - */ - UpgradeClusterResponse.create = function create(properties) { - return new UpgradeClusterResponse(properties); - }; - - /** - * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.clusterUpgradeDetails != null && message.clusterUpgradeDetails.length) - for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.encode(message.clusterUpgradeDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.status = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.clusterUpgradeDetails && message.clusterUpgradeDetails.length)) - message.clusterUpgradeDetails = []; - message.clusterUpgradeDetails.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.clusterUpgradeDetails != null && message.hasOwnProperty("clusterUpgradeDetails")) { - if (!Array.isArray(message.clusterUpgradeDetails)) - return "clusterUpgradeDetails: array expected"; - for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify(message.clusterUpgradeDetails[i]); - if (error) - return "clusterUpgradeDetails." + error; - } - } - return null; - }; - - /** - * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} UpgradeClusterResponse - */ - UpgradeClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse(); - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "NOT_STARTED": - case 4: - message.status = 4; - break; - case "IN_PROGRESS": - case 5: - message.status = 5; - break; - case "SUCCESS": - case 1: - message.status = 1; - break; - case "FAILED": - case 2: - message.status = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.status = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.status = 6; - break; - case "CANCELLED": - case 7: - message.status = 7; - break; - } - if (object.message != null) - message.message = String(object.message); - if (object.clusterUpgradeDetails) { - if (!Array.isArray(object.clusterUpgradeDetails)) - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.clusterUpgradeDetails: array expected"); - message.clusterUpgradeDetails = []; - for (var i = 0; i < object.clusterUpgradeDetails.length; ++i) { - if (typeof object.clusterUpgradeDetails[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.clusterUpgradeDetails: object expected"); - message.clusterUpgradeDetails[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.fromObject(object.clusterUpgradeDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse} message UpgradeClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clusterUpgradeDetails = []; - if (options.defaults) { - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.message = ""; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] : message.status; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.clusterUpgradeDetails && message.clusterUpgradeDetails.length) { - object.clusterUpgradeDetails = []; - for (var j = 0; j < message.clusterUpgradeDetails.length; ++j) - object.clusterUpgradeDetails[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.toObject(message.clusterUpgradeDetails[j], options); - } - return object; - }; - - /** - * Converts this UpgradeClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse"; - }; - - UpgradeClusterResponse.StageInfo = (function() { - - /** - * Properties of a StageInfo. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @interface IStageInfo - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null} [stage] StageInfo stage - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [status] StageInfo status - * @property {string|null} [logsUrl] StageInfo logsUrl - */ - - /** - * Constructs a new StageInfo. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @classdesc Represents a StageInfo. - * @implements IStageInfo - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set - */ - function StageInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageInfo stage. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage} stage - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.stage = 0; - - /** - * StageInfo status. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} status - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.status = 0; - - /** - * StageInfo logsUrl. - * @member {string} logsUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.logsUrl = ""; - - /** - * Creates a new StageInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo instance - */ - StageInfo.create = function create(properties) { - return new StageInfo(properties); - }; - - /** - * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); - if (message.logsUrl != null && Object.hasOwnProperty.call(message, "logsUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.logsUrl); - return writer; - }; - - /** - * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stage = reader.int32(); - break; - } - case 2: { - message.status = reader.int32(); - break; - } - case 3: { - message.logsUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stage != null && message.hasOwnProperty("stage")) - switch (message.stage) { - default: - return "stage: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) - if (!$util.isString(message.logsUrl)) - return "logsUrl: string expected"; - return null; - }; - - /** - * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} StageInfo - */ - StageInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo(); - switch (object.stage) { - default: - if (typeof object.stage === "number") { - message.stage = object.stage; - break; - } - break; - case "STAGE_UNSPECIFIED": - case 0: - message.stage = 0; - break; - case "ALLOYDB_PRECHECK": - case 1: - message.stage = 1; - break; - case "PG_UPGRADE_CHECK": - case 2: - message.stage = 2; - break; - case "PREPARE_FOR_UPGRADE": - case 5: - message.stage = 5; - break; - case "PRIMARY_INSTANCE_UPGRADE": - case 3: - message.stage = 3; - break; - case "READ_POOL_INSTANCES_UPGRADE": - case 4: - message.stage = 4; - break; - case "ROLLBACK": - case 6: - message.stage = 6; - break; - case "CLEANUP": - case 7: - message.stage = 7; - break; - } - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "NOT_STARTED": - case 4: - message.status = 4; - break; - case "IN_PROGRESS": - case 5: - message.status = 5; - break; - case "SUCCESS": - case 1: - message.status = 1; - break; - case "FAILED": - case 2: - message.status = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.status = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.status = 6; - break; - case "CANCELLED": - case 7: - message.status = 7; - break; - } - if (object.logsUrl != null) - message.logsUrl = String(object.logsUrl); - return message; - }; - - /** - * Creates a plain object from a StageInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo} message StageInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.logsUrl = ""; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] : message.stage; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.status] : message.status; - if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) - object.logsUrl = message.logsUrl; - return object; - }; - - /** - * Converts this StageInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @instance - * @returns {Object.} JSON object - */ - StageInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo"; - }; - - return StageInfo; - })(); - - UpgradeClusterResponse.InstanceUpgradeDetails = (function() { - - /** - * Properties of an InstanceUpgradeDetails. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @interface IInstanceUpgradeDetails - * @property {string|null} [name] InstanceUpgradeDetails name - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [upgradeStatus] InstanceUpgradeDetails upgradeStatus - * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [instanceType] InstanceUpgradeDetails instanceType - */ - - /** - * Constructs a new InstanceUpgradeDetails. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @classdesc Represents an InstanceUpgradeDetails. - * @implements IInstanceUpgradeDetails - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set - */ - function InstanceUpgradeDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceUpgradeDetails name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.name = ""; - - /** - * InstanceUpgradeDetails upgradeStatus. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} upgradeStatus - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.upgradeStatus = 0; - - /** - * InstanceUpgradeDetails instanceType. - * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.instanceType = 0; - - /** - * Creates a new InstanceUpgradeDetails instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails instance - */ - InstanceUpgradeDetails.create = function create(properties) { - return new InstanceUpgradeDetails(properties); - }; - - /** - * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceUpgradeDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.instanceType); - return writer; - }; - - /** - * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceUpgradeDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.upgradeStatus = reader.int32(); - break; - } - case 3: { - message.instanceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceUpgradeDetails message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceUpgradeDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - switch (message.upgradeStatus) { - default: - return "upgradeStatus: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - */ - InstanceUpgradeDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails(); - if (object.name != null) - message.name = String(object.name); - switch (object.upgradeStatus) { - default: - if (typeof object.upgradeStatus === "number") { - message.upgradeStatus = object.upgradeStatus; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.upgradeStatus = 0; - break; - case "NOT_STARTED": - case 4: - message.upgradeStatus = 4; - break; - case "IN_PROGRESS": - case 5: - message.upgradeStatus = 5; - break; - case "SUCCESS": - case 1: - message.upgradeStatus = 1; - break; - case "FAILED": - case 2: - message.upgradeStatus = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.upgradeStatus = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.upgradeStatus = 6; - break; - case "CANCELLED": - case 7: - message.upgradeStatus = 7; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails} message InstanceUpgradeDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceUpgradeDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.instanceType] : message.instanceType; - return object; - }; - - /** - * Converts this InstanceUpgradeDetails to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - * @returns {Object.} JSON object - */ - InstanceUpgradeDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceUpgradeDetails - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails"; - }; - - return InstanceUpgradeDetails; - })(); - - UpgradeClusterResponse.ClusterUpgradeDetails = (function() { - - /** - * Properties of a ClusterUpgradeDetails. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @interface IClusterUpgradeDetails - * @property {string|null} [name] ClusterUpgradeDetails name - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [upgradeStatus] ClusterUpgradeDetails upgradeStatus - * @property {google.cloud.alloydb.v1alpha.Cluster.ClusterType|null} [clusterType] ClusterUpgradeDetails clusterType - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] ClusterUpgradeDetails databaseVersion - * @property {Array.|null} [stageInfo] ClusterUpgradeDetails stageInfo - * @property {Array.|null} [instanceUpgradeDetails] ClusterUpgradeDetails instanceUpgradeDetails - */ - - /** - * Constructs a new ClusterUpgradeDetails. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse - * @classdesc Represents a ClusterUpgradeDetails. - * @implements IClusterUpgradeDetails - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set - */ - function ClusterUpgradeDetails(properties) { - this.stageInfo = []; - this.instanceUpgradeDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterUpgradeDetails name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.name = ""; - - /** - * ClusterUpgradeDetails upgradeStatus. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} upgradeStatus - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.upgradeStatus = 0; - - /** - * ClusterUpgradeDetails clusterType. - * @member {google.cloud.alloydb.v1alpha.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.clusterType = 0; - - /** - * ClusterUpgradeDetails databaseVersion. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.databaseVersion = 0; - - /** - * ClusterUpgradeDetails stageInfo. - * @member {Array.} stageInfo - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.stageInfo = $util.emptyArray; - - /** - * ClusterUpgradeDetails instanceUpgradeDetails. - * @member {Array.} instanceUpgradeDetails - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.instanceUpgradeDetails = $util.emptyArray; - - /** - * Creates a new ClusterUpgradeDetails instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails instance - */ - ClusterUpgradeDetails.create = function create(properties) { - return new ClusterUpgradeDetails(properties); - }; - - /** - * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterUpgradeDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.clusterType); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.databaseVersion); - if (message.stageInfo != null && message.stageInfo.length) - for (var i = 0; i < message.stageInfo.length; ++i) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.encode(message.stageInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.instanceUpgradeDetails != null && message.instanceUpgradeDetails.length) - for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.encode(message.instanceUpgradeDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterUpgradeDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.upgradeStatus = reader.int32(); - break; - } - case 3: { - message.clusterType = reader.int32(); - break; - } - case 4: { - message.databaseVersion = reader.int32(); - break; - } - case 5: { - if (!(message.stageInfo && message.stageInfo.length)) - message.stageInfo = []; - message.stageInfo.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.instanceUpgradeDetails && message.instanceUpgradeDetails.length)) - message.instanceUpgradeDetails = []; - message.instanceUpgradeDetails.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterUpgradeDetails message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterUpgradeDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - switch (message.upgradeStatus) { - default: - return "upgradeStatus: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stageInfo != null && message.hasOwnProperty("stageInfo")) { - if (!Array.isArray(message.stageInfo)) - return "stageInfo: array expected"; - for (var i = 0; i < message.stageInfo.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.verify(message.stageInfo[i]); - if (error) - return "stageInfo." + error; - } - } - if (message.instanceUpgradeDetails != null && message.hasOwnProperty("instanceUpgradeDetails")) { - if (!Array.isArray(message.instanceUpgradeDetails)) - return "instanceUpgradeDetails: array expected"; - for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.verify(message.instanceUpgradeDetails[i]); - if (error) - return "instanceUpgradeDetails." + error; - } - } - return null; - }; - - /** - * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - */ - ClusterUpgradeDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails(); - if (object.name != null) - message.name = String(object.name); - switch (object.upgradeStatus) { - default: - if (typeof object.upgradeStatus === "number") { - message.upgradeStatus = object.upgradeStatus; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.upgradeStatus = 0; - break; - case "NOT_STARTED": - case 4: - message.upgradeStatus = 4; - break; - case "IN_PROGRESS": - case 5: - message.upgradeStatus = 5; - break; - case "SUCCESS": - case 1: - message.upgradeStatus = 1; - break; - case "FAILED": - case 2: - message.upgradeStatus = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.upgradeStatus = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.upgradeStatus = 6; - break; - case "CANCELLED": - case 7: - message.upgradeStatus = 7; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.databaseVersion = 6; - break; - } - if (object.stageInfo) { - if (!Array.isArray(object.stageInfo)) - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: array expected"); - message.stageInfo = []; - for (var i = 0; i < object.stageInfo.length; ++i) { - if (typeof object.stageInfo[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: object expected"); - message.stageInfo[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.fromObject(object.stageInfo[i]); - } - } - if (object.instanceUpgradeDetails) { - if (!Array.isArray(object.instanceUpgradeDetails)) - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: array expected"); - message.instanceUpgradeDetails = []; - for (var i = 0; i < object.instanceUpgradeDetails.length; ++i) { - if (typeof object.instanceUpgradeDetails[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: object expected"); - message.instanceUpgradeDetails[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.fromObject(object.instanceUpgradeDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails} message ClusterUpgradeDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterUpgradeDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.stageInfo = []; - object.instanceUpgradeDetails = []; - } - if (options.defaults) { - object.name = ""; - object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1alpha.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.stageInfo && message.stageInfo.length) { - object.stageInfo = []; - for (var j = 0; j < message.stageInfo.length; ++j) - object.stageInfo[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.StageInfo.toObject(message.stageInfo[j], options); - } - if (message.instanceUpgradeDetails && message.instanceUpgradeDetails.length) { - object.instanceUpgradeDetails = []; - for (var j = 0; j < message.instanceUpgradeDetails.length; ++j) - object.instanceUpgradeDetails[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.InstanceUpgradeDetails.toObject(message.instanceUpgradeDetails[j], options); - } - return object; - }; - - /** - * Converts this ClusterUpgradeDetails to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - * @returns {Object.} JSON object - */ - ClusterUpgradeDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterUpgradeDetails - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterResponse.ClusterUpgradeDetails"; - }; - - return ClusterUpgradeDetails; - })(); - - /** - * Status enum. - * @name google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} NOT_STARTED=4 NOT_STARTED value - * @property {number} IN_PROGRESS=5 IN_PROGRESS value - * @property {number} SUCCESS=1 SUCCESS value - * @property {number} FAILED=2 FAILED value - * @property {number} PARTIAL_SUCCESS=3 PARTIAL_SUCCESS value - * @property {number} CANCEL_IN_PROGRESS=6 CANCEL_IN_PROGRESS value - * @property {number} CANCELLED=7 CANCELLED value - */ - UpgradeClusterResponse.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[4] = "NOT_STARTED"] = 4; - values[valuesById[5] = "IN_PROGRESS"] = 5; - values[valuesById[1] = "SUCCESS"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "PARTIAL_SUCCESS"] = 3; - values[valuesById[6] = "CANCEL_IN_PROGRESS"] = 6; - values[valuesById[7] = "CANCELLED"] = 7; - return values; - })(); - - /** - * Stage enum. - * @name google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage - * @enum {number} - * @property {number} STAGE_UNSPECIFIED=0 STAGE_UNSPECIFIED value - * @property {number} ALLOYDB_PRECHECK=1 ALLOYDB_PRECHECK value - * @property {number} PG_UPGRADE_CHECK=2 PG_UPGRADE_CHECK value - * @property {number} PREPARE_FOR_UPGRADE=5 PREPARE_FOR_UPGRADE value - * @property {number} PRIMARY_INSTANCE_UPGRADE=3 PRIMARY_INSTANCE_UPGRADE value - * @property {number} READ_POOL_INSTANCES_UPGRADE=4 READ_POOL_INSTANCES_UPGRADE value - * @property {number} ROLLBACK=6 ROLLBACK value - * @property {number} CLEANUP=7 CLEANUP value - */ - UpgradeClusterResponse.Stage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STAGE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOYDB_PRECHECK"] = 1; - values[valuesById[2] = "PG_UPGRADE_CHECK"] = 2; - values[valuesById[5] = "PREPARE_FOR_UPGRADE"] = 5; - values[valuesById[3] = "PRIMARY_INSTANCE_UPGRADE"] = 3; - values[valuesById[4] = "READ_POOL_INSTANCES_UPGRADE"] = 4; - values[valuesById[6] = "ROLLBACK"] = 6; - values[valuesById[7] = "CLEANUP"] = 7; - return values; - })(); - - return UpgradeClusterResponse; - })(); - - v1alpha.DeleteClusterRequest = (function() { - - /** - * Properties of a DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name - * @property {string|null} [requestId] DeleteClusterRequest requestId - * @property {string|null} [etag] DeleteClusterRequest etag - * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly - * @property {boolean|null} [force] DeleteClusterRequest force - */ - - /** - * Constructs a new DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set - */ - function DeleteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.name = ""; - - /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.requestId = ""; - - /** - * DeleteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.etag = ""; - - /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.validateOnly = false; - - /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.force = false; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest instance - */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); - }; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); - return writer; - }; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteClusterRequest} DeleteClusterRequest - */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.DeleteClusterRequest} message DeleteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteClusterRequest"; - }; - - return DeleteClusterRequest; - })(); - - v1alpha.SwitchoverClusterRequest = (function() { - - /** - * Properties of a SwitchoverClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISwitchoverClusterRequest - * @property {string|null} [name] SwitchoverClusterRequest name - * @property {string|null} [requestId] SwitchoverClusterRequest requestId - * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly - */ - - /** - * Constructs a new SwitchoverClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SwitchoverClusterRequest. - * @implements ISwitchoverClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest=} [properties] Properties to set - */ - function SwitchoverClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SwitchoverClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.name = ""; - - /** - * SwitchoverClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.requestId = ""; - - /** - * SwitchoverClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new SwitchoverClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest instance - */ - SwitchoverClusterRequest.create = function create(properties) { - return new SwitchoverClusterRequest(properties); - }; - - /** - * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwitchoverClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SwitchoverClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwitchoverClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SwitchoverClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SwitchoverClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} SwitchoverClusterRequest - */ - SwitchoverClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.SwitchoverClusterRequest} message SwitchoverClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SwitchoverClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this SwitchoverClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @instance - * @returns {Object.} JSON object - */ - SwitchoverClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SwitchoverClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SwitchoverClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SwitchoverClusterRequest"; - }; - - return SwitchoverClusterRequest; - })(); - - v1alpha.PromoteClusterRequest = (function() { - - /** - * Properties of a PromoteClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IPromoteClusterRequest - * @property {string|null} [name] PromoteClusterRequest name - * @property {string|null} [requestId] PromoteClusterRequest requestId - * @property {string|null} [etag] PromoteClusterRequest etag - * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly - */ - - /** - * Constructs a new PromoteClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a PromoteClusterRequest. - * @implements IPromoteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set - */ - function PromoteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromoteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.name = ""; - - /** - * PromoteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.requestId = ""; - - /** - * PromoteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.etag = ""; - - /** - * PromoteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new PromoteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest instance - */ - PromoteClusterRequest.create = function create(properties) { - return new PromoteClusterRequest(properties); - }; - - /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromoteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromoteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterRequest} PromoteClusterRequest - */ - PromoteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.PromoteClusterRequest} message PromoteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromoteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this PromoteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - PromoteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromoteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.PromoteClusterRequest"; - }; - - return PromoteClusterRequest; - })(); - - v1alpha.RestoreClusterRequest = (function() { - - /** - * Properties of a RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IRestoreClusterRequest - * @property {google.cloud.alloydb.v1alpha.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource - * @property {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource - * @property {string|null} [parent] RestoreClusterRequest parent - * @property {string|null} [clusterId] RestoreClusterRequest clusterId - * @property {google.cloud.alloydb.v1alpha.ICluster|null} [cluster] RestoreClusterRequest cluster - * @property {string|null} [requestId] RestoreClusterRequest requestId - * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly - */ - - /** - * Constructs a new RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set - */ - function RestoreClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreClusterRequest backupSource. - * @member {google.cloud.alloydb.v1alpha.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.backupSource = null; - - /** - * RestoreClusterRequest continuousBackupSource. - * @member {google.cloud.alloydb.v1alpha.IContinuousBackupSource|null|undefined} continuousBackupSource - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.continuousBackupSource = null; - - /** - * RestoreClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.parent = ""; - - /** - * RestoreClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.clusterId = ""; - - /** - * RestoreClusterRequest cluster. - * @member {google.cloud.alloydb.v1alpha.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.cluster = null; - - /** - * RestoreClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.requestId = ""; - - /** - * RestoreClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreClusterRequest source. - * @member {"backupSource"|"continuousBackupSource"|undefined} source - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest instance - */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); - }; - - /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1alpha.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1alpha.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) - $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestoreClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.decode(reader, reader.uint32()); - break; - } - case 8: { - message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.verify(message.continuousBackupSource); - if (error) - return "continuousBackupSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1alpha.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.RestoreClusterRequest} RestoreClusterRequest - */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.RestoreClusterRequest(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.fromObject(object.backupSource); - } - if (object.continuousBackupSource != null) { - if (typeof object.continuousBackupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.continuousBackupSource: object expected"); - message.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.fromObject(object.continuousBackupSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.RestoreClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1alpha.RestoreClusterRequest} message RestoreClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1alpha.Cluster.toObject(message.cluster, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1alpha.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - object.continuousBackupSource = $root.google.cloud.alloydb.v1alpha.ContinuousBackupSource.toObject(message.continuousBackupSource, options); - if (options.oneofs) - object.source = "continuousBackupSource"; - } - return object; - }; - - /** - * Converts this RestoreClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.RestoreClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestoreClusterRequest"; - }; - - return RestoreClusterRequest; - })(); - - v1alpha.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set - */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.filter = ""; - - /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v1alpha.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListInstancesResponse} message ListInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v1alpha.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1alpha.InstanceView|null} [view] GetInstanceRequest view - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * GetInstanceRequest view. - * @member {google.cloud.alloydb.v1alpha.InstanceView} view - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.view = 0; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "INSTANCE_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "INSTANCE_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "INSTANCE_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetInstanceRequest} message GetInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1alpha.InstanceView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v1alpha.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [requestId] CreateInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * CreateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.requestId = ""; - - /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v1alpha.CreateSecondaryInstanceRequest = (function() { - - /** - * Properties of a CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateSecondaryInstanceRequest - * @property {string|null} [parent] CreateSecondaryInstanceRequest parent - * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId - * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] CreateSecondaryInstanceRequest instance - * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateSecondaryInstanceRequest. - * @implements ICreateSecondaryInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set - */ - function CreateSecondaryInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecondaryInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.parent = ""; - - /** - * CreateSecondaryInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.instanceId = ""; - - /** - * CreateSecondaryInstanceRequest instance. - * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.instance = null; - - /** - * CreateSecondaryInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.requestId = ""; - - /** - * CreateSecondaryInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance - */ - CreateSecondaryInstanceRequest.create = function create(properties) { - return new CreateSecondaryInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecondaryInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - */ - CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateSecondaryInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecondaryInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest"; - }; - - return CreateSecondaryInstanceRequest; - })(); - - v1alpha.CreateInstanceRequests = (function() { - - /** - * Properties of a CreateInstanceRequests. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests - */ - - /** - * Constructs a new CreateInstanceRequests. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set - */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @instance - */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; - - /** - * Creates a new CreateInstanceRequests instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests instance - */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); - }; - - /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequests.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createInstanceRequests != null && message.createInstanceRequests.length) - for (var i = 0; i < message.createInstanceRequests.length; ++i) - $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequests.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.createInstanceRequests && message.createInstanceRequests.length)) - message.createInstanceRequests = []; - message.createInstanceRequests.push($root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequests message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequests.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { - if (!Array.isArray(message.createInstanceRequests)) - return "createInstanceRequests: array expected"; - for (var i = 0; i < message.createInstanceRequests.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.verify(message.createInstanceRequests[i]); - if (error) - return "createInstanceRequests." + error; - } - } - return null; - }; - - /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateInstanceRequests} CreateInstanceRequests - */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests(); - if (object.createInstanceRequests) { - if (!Array.isArray(object.createInstanceRequests)) - throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: array expected"); - message.createInstanceRequests = []; - for (var i = 0; i < object.createInstanceRequests.length; ++i) { - if (typeof object.createInstanceRequests[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateInstanceRequests.createInstanceRequests: object expected"); - message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequests} message CreateInstanceRequests - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequests.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.createInstanceRequests = []; - if (message.createInstanceRequests && message.createInstanceRequests.length) { - object.createInstanceRequests = []; - for (var j = 0; j < message.createInstanceRequests.length; ++j) - object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); - } - return object; - }; - - /** - * Converts this CreateInstanceRequests to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequests - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateInstanceRequests - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateInstanceRequests"; - }; - - return CreateInstanceRequests; - })(); - - v1alpha.BatchCreateInstancesRequest = (function() { - - /** - * Properties of a BatchCreateInstancesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstancesRequest - * @property {string|null} [parent] BatchCreateInstancesRequest parent - * @property {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests - * @property {string|null} [requestId] BatchCreateInstancesRequest requestId - */ - - /** - * Constructs a new BatchCreateInstancesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set - */ - function BatchCreateInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.parent = ""; - - /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1alpha.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.requests = null; - - /** - * BatchCreateInstancesRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.requestId = ""; - - /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance - */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.verify(message.requests); - if (error) - return "requests." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} BatchCreateInstancesRequest - */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest.requests: object expected"); - message.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.fromObject(object.requests); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest} message BatchCreateInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requests = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.alloydb.v1alpha.CreateInstanceRequests.toObject(message.requests, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this BatchCreateInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest"; - }; - - return BatchCreateInstancesRequest; - })(); - - v1alpha.BatchCreateInstancesResponse = (function() { - - /** - * Properties of a BatchCreateInstancesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances - */ - - /** - * Constructs a new BatchCreateInstancesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set - */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @instance - */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance - */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} BatchCreateInstancesResponse - */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse} message BatchCreateInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse"; - }; - - return BatchCreateInstancesResponse; - })(); - - v1alpha.BatchCreateInstancesMetadata = (function() { - - /** - * Properties of a BatchCreateInstancesMetadata. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses - */ - - /** - * Constructs a new BatchCreateInstancesMetadata. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set - */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @instance - */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; - - /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @instance - */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; - - /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance - */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceTargets != null && message.instanceTargets.length) - for (var i = 0; i < message.instanceTargets.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); - if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) - for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); - break; - } - case 2: { - if (message.instanceStatuses === $util.emptyObject) - message.instanceStatuses = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.instanceStatuses[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { - if (!Array.isArray(message.instanceTargets)) - return "instanceTargets: array expected"; - for (var i = 0; i < message.instanceTargets.length; ++i) - if (!$util.isString(message.instanceTargets[i])) - return "instanceTargets: string[] expected"; - } - if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { - if (!$util.isObject(message.instanceStatuses)) - return "instanceStatuses: object expected"; - var key = Object.keys(message.instanceStatuses); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); - if (error) - return "instanceStatuses." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata(); - if (object.instanceTargets) { - if (!Array.isArray(object.instanceTargets)) - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceTargets: array expected"); - message.instanceTargets = []; - for (var i = 0; i < object.instanceTargets.length; ++i) - message.instanceTargets[i] = String(object.instanceTargets[i]); - } - if (object.instanceStatuses) { - if (typeof object.instanceStatuses !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses = {}; - for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { - if (typeof object.instanceStatuses[keys[i]] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instanceTargets = []; - if (options.objects || options.defaults) - object.instanceStatuses = {}; - if (message.instanceTargets && message.instanceTargets.length) { - object.instanceTargets = []; - for (var j = 0; j < message.instanceTargets.length; ++j) - object.instanceTargets[j] = message.instanceTargets[j]; - } - var keys2; - if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { - object.instanceStatuses = {}; - for (var j = 0; j < keys2.length; ++j) - object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); - } - return object; - }; - - /** - * Converts this BatchCreateInstancesMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata"; - }; - - return BatchCreateInstancesMetadata; - })(); - - v1alpha.BatchCreateInstanceStatus = (function() { - - /** - * Properties of a BatchCreateInstanceStatus. - * @memberof google.cloud.alloydb.v1alpha - * @interface IBatchCreateInstanceStatus - * @property {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state - * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg - * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error - * @property {google.cloud.alloydb.v1alpha.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type - */ - - /** - * Constructs a new BatchCreateInstanceStatus. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus - * @constructor - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set - */ - function BatchCreateInstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstanceStatus state. - * @member {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State} state - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.state = 0; - - /** - * BatchCreateInstanceStatus errorMsg. - * @member {string} errorMsg - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; - - /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.error = null; - - /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1alpha.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.type = 0; - - /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance - */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); - }; - - /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstanceStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.errorMsg = reader.string(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstanceStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - if (!$util.isString(message.errorMsg)) - return "errorMsg: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} BatchCreateInstanceStatus - */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING_CREATE": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "ROLLED_BACK": - case 6: - message.state = 6; - break; - } - if (object.errorMsg != null) - message.errorMsg = String(object.errorMsg); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "READ_POOL": - case 2: - message.type = 2; - break; - case "SECONDARY": - case 3: - message.type = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus} message BatchCreateInstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.errorMsg = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.error = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State[message.state] : message.state; - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - object.errorMsg = message.errorMsg; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1alpha.Instance.InstanceType[message.type] : message.type; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - return object; - }; - - /** - * Converts this BatchCreateInstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstanceStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus"; - }; - - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.BatchCreateInstanceStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING_CREATE=1 PENDING_CREATE value - * @property {number} READY=2 READY value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} FAILED=5 FAILED value - * @property {number} ROLLED_BACK=6 ROLLED_BACK value - */ - BatchCreateInstanceStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_CREATE"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "ROLLED_BACK"] = 6; - return values; - })(); - - return BatchCreateInstanceStatus; - })(); - - v1alpha.UpdateInstanceRequest = (function() { - - /** - * Properties of an UpdateInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.alloydb.v1alpha.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {string|null} [requestId] UpdateInstanceRequest requestId - * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing - */ - - /** - * Constructs a new UpdateInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set - */ - function UpdateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.updateMask = null; - - /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1alpha.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.instance = null; - - /** - * UpdateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.requestId = ""; - - /** - * UpdateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.validateOnly = false; - - /** - * UpdateInstanceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest instance - */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1alpha.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1alpha.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} UpdateInstanceRequest - */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1alpha.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.UpdateInstanceRequest} message UpdateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1alpha.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateInstanceRequest"; - }; - - return UpdateInstanceRequest; - })(); - - v1alpha.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {string|null} [requestId] DeleteInstanceRequest requestId - * @property {string|null} [etag] DeleteInstanceRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * DeleteInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.requestId = ""; - - /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.etag = ""; - - /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v1alpha.FailoverInstanceRequest = (function() { - - /** - * Properties of a FailoverInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IFailoverInstanceRequest - * @property {string|null} [name] FailoverInstanceRequest name - * @property {string|null} [requestId] FailoverInstanceRequest requestId - * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly - */ - - /** - * Constructs a new FailoverInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set - */ - function FailoverInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FailoverInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.name = ""; - - /** - * FailoverInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.requestId = ""; - - /** - * FailoverInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest instance - */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); - }; - - /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FailoverInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.FailoverInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FailoverInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FailoverInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FailoverInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} FailoverInstanceRequest - */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.FailoverInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.FailoverInstanceRequest} message FailoverInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FailoverInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this FailoverInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FailoverInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.FailoverInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.FailoverInstanceRequest"; - }; - - return FailoverInstanceRequest; - })(); - - v1alpha.InjectFaultRequest = (function() { - - /** - * Properties of an InjectFaultRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IInjectFaultRequest - * @property {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType - * @property {string|null} [name] InjectFaultRequest name - * @property {string|null} [requestId] InjectFaultRequest requestId - * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly - */ - - /** - * Constructs a new InjectFaultRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an InjectFaultRequest. - * @implements IInjectFaultRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest=} [properties] Properties to set - */ - function InjectFaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InjectFaultRequest faultType. - * @member {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} faultType - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.faultType = 0; - - /** - * InjectFaultRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.name = ""; - - /** - * InjectFaultRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.requestId = ""; - - /** - * InjectFaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.validateOnly = false; - - /** - * Creates a new InjectFaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest instance - */ - InjectFaultRequest.create = function create(properties) { - return new InjectFaultRequest(properties); - }; - - /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InjectFaultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.InjectFaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InjectFaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.InjectFaultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.faultType = reader.int32(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InjectFaultRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InjectFaultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.faultType != null && message.hasOwnProperty("faultType")) - switch (message.faultType) { - default: - return "faultType: enum value expected"; - case 0: - case 1: - break; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.InjectFaultRequest} InjectFaultRequest - */ - InjectFaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.InjectFaultRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.InjectFaultRequest(); - switch (object.faultType) { - default: - if (typeof object.faultType === "number") { - message.faultType = object.faultType; - break; - } - break; - case "FAULT_TYPE_UNSPECIFIED": - case 0: - message.faultType = 0; - break; - case "STOP_VM": - case 1: - message.faultType = 1; - break; - } - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1alpha.InjectFaultRequest} message InjectFaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InjectFaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.faultType != null && message.hasOwnProperty("faultType")) - object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType[message.faultType] : message.faultType; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this InjectFaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @instance - * @returns {Object.} JSON object - */ - InjectFaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InjectFaultRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.InjectFaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.InjectFaultRequest"; - }; - - /** - * FaultType enum. - * @name google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType - * @enum {number} - * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value - * @property {number} STOP_VM=1 STOP_VM value - */ - InjectFaultRequest.FaultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STOP_VM"] = 1; - return values; - })(); - - return InjectFaultRequest; - })(); - - v1alpha.RestartInstanceRequest = (function() { - - /** - * Properties of a RestartInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IRestartInstanceRequest - * @property {string|null} [name] RestartInstanceRequest name - * @property {string|null} [requestId] RestartInstanceRequest requestId - * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly - * @property {Array.|null} [nodeIds] RestartInstanceRequest nodeIds - */ - - /** - * Constructs a new RestartInstanceRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set - */ - function RestartInstanceRequest(properties) { - this.nodeIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.name = ""; - - /** - * RestartInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.requestId = ""; - - /** - * RestartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.validateOnly = false; - - /** - * RestartInstanceRequest nodeIds. - * @member {Array.} nodeIds - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest instance - */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); - }; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.nodeIds != null && message.nodeIds.length) - for (var i = 0; i < message.nodeIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeIds[i]); - return writer; - }; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.RestartInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestartInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestartInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { - if (!Array.isArray(message.nodeIds)) - return "nodeIds: array expected"; - for (var i = 0; i < message.nodeIds.length; ++i) - if (!$util.isString(message.nodeIds[i])) - return "nodeIds: string[] expected"; - } - return null; - }; - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.RestartInstanceRequest} RestartInstanceRequest - */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.RestartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.nodeIds) { - if (!Array.isArray(object.nodeIds)) - throw TypeError(".google.cloud.alloydb.v1alpha.RestartInstanceRequest.nodeIds: array expected"); - message.nodeIds = []; - for (var i = 0; i < object.nodeIds.length; ++i) - message.nodeIds[i] = String(object.nodeIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1alpha.RestartInstanceRequest} message RestartInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestartInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodeIds = []; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.nodeIds && message.nodeIds.length) { - object.nodeIds = []; - for (var j = 0; j < message.nodeIds.length; ++j) - object.nodeIds[j] = message.nodeIds[j]; - } - return object; - }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestartInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.RestartInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.RestartInstanceRequest"; - }; - - return RestartInstanceRequest; - })(); - - v1alpha.ExecuteSqlRequest = (function() { - - /** - * Properties of an ExecuteSqlRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IExecuteSqlRequest - * @property {string|null} [password] ExecuteSqlRequest password - * @property {string|null} [instance] ExecuteSqlRequest instance - * @property {string|null} [database] ExecuteSqlRequest database - * @property {string|null} [user] ExecuteSqlRequest user - * @property {string|null} [sqlStatement] ExecuteSqlRequest sqlStatement - * @property {boolean|null} [validateOnly] ExecuteSqlRequest validateOnly - */ - - /** - * Constructs a new ExecuteSqlRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ExecuteSqlRequest. - * @implements IExecuteSqlRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest=} [properties] Properties to set - */ - function ExecuteSqlRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlRequest password. - * @member {string|null|undefined} password - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.password = null; - - /** - * ExecuteSqlRequest instance. - * @member {string} instance - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.instance = ""; - - /** - * ExecuteSqlRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.database = ""; - - /** - * ExecuteSqlRequest user. - * @member {string} user - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.user = ""; - - /** - * ExecuteSqlRequest sqlStatement. - * @member {string} sqlStatement - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.sqlStatement = ""; - - /** - * ExecuteSqlRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteSqlRequest userCredential. - * @member {"password"|undefined} userCredential - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - */ - Object.defineProperty(ExecuteSqlRequest.prototype, "userCredential", { - get: $util.oneOfGetter($oneOfFields = ["password"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest instance - */ - ExecuteSqlRequest.create = function create(properties) { - return new ExecuteSqlRequest(properties); - }; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); - if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlStatement); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.password); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.password = reader.string(); - break; - } - case 1: { - message.instance = reader.string(); - break; - } - case 2: { - message.database = reader.string(); - break; - } - case 3: { - message.user = reader.string(); - break; - } - case 4: { - message.sqlStatement = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.password != null && message.hasOwnProperty("password")) { - properties.userCredential = 1; - if (!$util.isString(message.password)) - return "password: string expected"; - } - if (message.instance != null && message.hasOwnProperty("instance")) - if (!$util.isString(message.instance)) - return "instance: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) - if (!$util.isString(message.sqlStatement)) - return "sqlStatement: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} ExecuteSqlRequest - */ - ExecuteSqlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlRequest(); - if (object.password != null) - message.password = String(object.password); - if (object.instance != null) - message.instance = String(object.instance); - if (object.database != null) - message.database = String(object.database); - if (object.user != null) - message.user = String(object.user); - if (object.sqlStatement != null) - message.sqlStatement = String(object.sqlStatement); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ExecuteSqlRequest} message ExecuteSqlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = ""; - object.database = ""; - object.user = ""; - object.sqlStatement = ""; - object.validateOnly = false; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = message.instance; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) - object.sqlStatement = message.sqlStatement; - if (message.password != null && message.hasOwnProperty("password")) { - object.password = message.password; - if (options.oneofs) - object.userCredential = "password"; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExecuteSqlRequest"; - }; - - return ExecuteSqlRequest; - })(); - - v1alpha.ExecuteSqlResponse = (function() { - - /** - * Properties of an ExecuteSqlResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IExecuteSqlResponse - * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults - * @property {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata - */ - - /** - * Constructs a new ExecuteSqlResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ExecuteSqlResponse. - * @implements IExecuteSqlResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse=} [properties] Properties to set - */ - function ExecuteSqlResponse(properties) { - this.sqlResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlResponse sqlResults. - * @member {Array.} sqlResults - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @instance - */ - ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; - - /** - * ExecuteSqlResponse metadata. - * @member {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata|null|undefined} metadata - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @instance - */ - ExecuteSqlResponse.prototype.metadata = null; - - /** - * Creates a new ExecuteSqlResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse instance - */ - ExecuteSqlResponse.create = function create(properties) { - return new ExecuteSqlResponse(properties); - }; - - /** - * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sqlResults != null && message.sqlResults.length) - for (var i = 0; i < message.sqlResults.length; ++i) - $root.google.cloud.alloydb.v1alpha.SqlResult.encode(message.sqlResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sqlResults && message.sqlResults.length)) - message.sqlResults = []; - message.sqlResults.push($root.google.cloud.alloydb.v1alpha.SqlResult.decode(reader, reader.uint32())); - break; - } - case 3: { - message.metadata = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sqlResults != null && message.hasOwnProperty("sqlResults")) { - if (!Array.isArray(message.sqlResults)) - return "sqlResults: array expected"; - for (var i = 0; i < message.sqlResults.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.SqlResult.verify(message.sqlResults[i]); - if (error) - return "sqlResults." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} ExecuteSqlResponse - */ - ExecuteSqlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlResponse(); - if (object.sqlResults) { - if (!Array.isArray(object.sqlResults)) - throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlResponse.sqlResults: array expected"); - message.sqlResults = []; - for (var i = 0; i < object.sqlResults.length; ++i) { - if (typeof object.sqlResults[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlResponse.sqlResults: object expected"); - message.sqlResults[i] = $root.google.cloud.alloydb.v1alpha.SqlResult.fromObject(object.sqlResults[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlResponse.metadata: object expected"); - message.metadata = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ExecuteSqlResponse} message ExecuteSqlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sqlResults = []; - if (options.defaults) - object.metadata = null; - if (message.sqlResults && message.sqlResults.length) { - object.sqlResults = []; - for (var j = 0; j < message.sqlResults.length; ++j) - object.sqlResults[j] = $root.google.cloud.alloydb.v1alpha.SqlResult.toObject(message.sqlResults[j], options); - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this ExecuteSqlResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExecuteSqlResponse"; - }; - - return ExecuteSqlResponse; - })(); - - v1alpha.ExecuteSqlMetadata = (function() { - - /** - * Properties of an ExecuteSqlMetadata. - * @memberof google.cloud.alloydb.v1alpha - * @interface IExecuteSqlMetadata - * @property {string|null} [message] ExecuteSqlMetadata message - * @property {boolean|null} [partialResult] ExecuteSqlMetadata partialResult - * @property {google.protobuf.IDuration|null} [sqlStatementExecutionDuration] ExecuteSqlMetadata sqlStatementExecutionDuration - * @property {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status|null} [status] ExecuteSqlMetadata status - */ - - /** - * Constructs a new ExecuteSqlMetadata. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an ExecuteSqlMetadata. - * @implements IExecuteSqlMetadata - * @constructor - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata=} [properties] Properties to set - */ - function ExecuteSqlMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlMetadata message. - * @member {string} message - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.message = ""; - - /** - * ExecuteSqlMetadata partialResult. - * @member {boolean} partialResult - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.partialResult = false; - - /** - * ExecuteSqlMetadata sqlStatementExecutionDuration. - * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; - - /** - * ExecuteSqlMetadata status. - * @member {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status} status - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.status = 0; - - /** - * Creates a new ExecuteSqlMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata instance - */ - ExecuteSqlMetadata.create = function create(properties) { - return new ExecuteSqlMetadata(properties); - }; - - /** - * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialResult); - if (message.sqlStatementExecutionDuration != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionDuration")) - $root.google.protobuf.Duration.encode(message.sqlStatementExecutionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.message = reader.string(); - break; - } - case 2: { - message.partialResult = reader.bool(); - break; - } - case 3: { - message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.status = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) - if (typeof message.partialResult !== "boolean") - return "partialResult: boolean expected"; - if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionDuration); - if (error) - return "sqlStatementExecutionDuration." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} ExecuteSqlMetadata - */ - ExecuteSqlMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata(); - if (object.message != null) - message.message = String(object.message); - if (object.partialResult != null) - message.partialResult = Boolean(object.partialResult); - if (object.sqlStatementExecutionDuration != null) { - if (typeof object.sqlStatementExecutionDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.sqlStatementExecutionDuration: object expected"); - message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionDuration); - } - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "OK": - case 1: - message.status = 1; - break; - case "PARTIAL": - case 2: - message.status = 2; - break; - case "ERROR": - case 3: - message.status = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.ExecuteSqlMetadata} message ExecuteSqlMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.message = ""; - object.partialResult = false; - object.sqlStatementExecutionDuration = null; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - } - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) - object.partialResult = message.partialResult; - if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) - object.sqlStatementExecutionDuration = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionDuration, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status[message.status] : message.status; - return object; - }; - - /** - * Converts this ExecuteSqlMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ExecuteSqlMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ExecuteSqlMetadata"; - }; - - /** - * Status enum. - * @name google.cloud.alloydb.v1alpha.ExecuteSqlMetadata.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} OK=1 OK value - * @property {number} PARTIAL=2 PARTIAL value - * @property {number} ERROR=3 ERROR value - */ - ExecuteSqlMetadata.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "OK"] = 1; - values[valuesById[2] = "PARTIAL"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return ExecuteSqlMetadata; - })(); - - v1alpha.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest instance - */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); - }; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListBackupsRequest} ListBackupsRequest - */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListBackupsRequest} message ListBackupsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListBackupsRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListBackupsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsRequest"; - }; - - return ListBackupsRequest; - })(); - - v1alpha.ListBackupsResponse = (function() { - - /** - * Properties of a ListBackupsResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable - */ - - /** - * Constructs a new ListBackupsResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set - */ - function ListBackupsResponse(properties) { - this.backups = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse instance - */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); - }; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListBackupsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListBackupsResponse} ListBackupsResponse - */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListBackupsResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListBackupsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListBackupsResponse} message ListBackupsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListBackupsResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListBackupsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListBackupsResponse"; - }; - - return ListBackupsResponse; - })(); - - v1alpha.GetBackupRequest = (function() { - - /** - * Properties of a GetBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name - */ - - /** - * Constructs a new GetBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set - */ - function GetBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.name = ""; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest instance - */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); - }; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetBackupRequest} GetBackupRequest - */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetBackupRequest} message GetBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetBackupRequest"; - }; - - return GetBackupRequest; - })(); - - v1alpha.CreateBackupRequest = (function() { - - /** - * Properties of a CreateBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [requestId] CreateBackupRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly - */ - - /** - * Constructs a new CreateBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set - */ - function CreateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backup = null; - - /** - * CreateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.requestId = ""; - - /** - * CreateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest instance - */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); - }; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateBackupRequest} CreateBackupRequest - */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateBackupRequest} message CreateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateBackupRequest"; - }; - - return CreateBackupRequest; - })(); - - v1alpha.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.alloydb.v1alpha.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing - */ - - /** - * Constructs a new UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * UpdateBackupRequest backup. - * @member {google.cloud.alloydb.v1alpha.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.requestId = ""; - - /** - * UpdateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.validateOnly = false; - - /** - * UpdateBackupRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest instance - */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1alpha.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1alpha.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateBackupRequest} UpdateBackupRequest - */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1alpha.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.UpdateBackupRequest} message UpdateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1alpha.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateBackupRequest"; - }; - - return UpdateBackupRequest; - })(); - - v1alpha.DeleteBackupRequest = (function() { - - /** - * Properties of a DeleteBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly - * @property {string|null} [etag] DeleteBackupRequest etag - */ - - /** - * Constructs a new DeleteBackupRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set - */ - function DeleteBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.requestId = ""; - - /** - * DeleteBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.validateOnly = false; - - /** - * DeleteBackupRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.etag = ""; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest instance - */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteBackupRequest} DeleteBackupRequest - */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1alpha.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteBackupRequest"; - }; - - return DeleteBackupRequest; - })(); - - v1alpha.ListSupportedDatabaseFlagsRequest = (function() { - - /** - * Properties of a ListSupportedDatabaseFlagsRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListSupportedDatabaseFlagsRequest - * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent - * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize - * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken - * @property {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope|null} [scope] ListSupportedDatabaseFlagsRequest scope - */ - - /** - * Constructs a new ListSupportedDatabaseFlagsRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListSupportedDatabaseFlagsRequest. - * @implements IListSupportedDatabaseFlagsRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - */ - function ListSupportedDatabaseFlagsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSupportedDatabaseFlagsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.parent = ""; - - /** - * ListSupportedDatabaseFlagsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; - - /** - * ListSupportedDatabaseFlagsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; - - /** - * ListSupportedDatabaseFlagsRequest scope. - * @member {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} scope - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.scope = 0; - - /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance - */ - ListSupportedDatabaseFlagsRequest.create = function create(properties) { - return new ListSupportedDatabaseFlagsRequest(properties); - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); - return writer; - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 6: { - message.scope = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSupportedDatabaseFlagsRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSupportedDatabaseFlagsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - */ - ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "DATABASE": - case 1: - message.scope = 1; - break; - case "CONNECTION_POOL": - case 2: - message.scope = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope[message.scope] : message.scope; - return object; - }; - - /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest"; - }; - - return ListSupportedDatabaseFlagsRequest; - })(); - - v1alpha.ListSupportedDatabaseFlagsResponse = (function() { - - /** - * Properties of a ListSupportedDatabaseFlagsResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListSupportedDatabaseFlagsResponse - * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags - * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken - */ - - /** - * Constructs a new ListSupportedDatabaseFlagsResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListSupportedDatabaseFlagsResponse. - * @implements IListSupportedDatabaseFlagsResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - */ - function ListSupportedDatabaseFlagsResponse(properties) { - this.supportedDatabaseFlags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. - * @member {Array.} supportedDatabaseFlags - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; - - /** - * ListSupportedDatabaseFlagsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance - */ - ListSupportedDatabaseFlagsResponse.create = function create(properties) { - return new ListSupportedDatabaseFlagsResponse(properties); - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) - $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) - message.supportedDatabaseFlags = []; - message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSupportedDatabaseFlagsResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSupportedDatabaseFlagsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { - if (!Array.isArray(message.supportedDatabaseFlags)) - return "supportedDatabaseFlags: array expected"; - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); - if (error) - return "supportedDatabaseFlags." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - */ - ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse(); - if (object.supportedDatabaseFlags) { - if (!Array.isArray(object.supportedDatabaseFlags)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); - message.supportedDatabaseFlags = []; - for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { - if (typeof object.supportedDatabaseFlags[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); - message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDatabaseFlags = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { - object.supportedDatabaseFlags = []; - for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) - object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse"; - }; - - return ListSupportedDatabaseFlagsResponse; - })(); - - v1alpha.GenerateClientCertificateRequest = (function() { - - /** - * Properties of a GenerateClientCertificateRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGenerateClientCertificateRequest - * @property {string|null} [parent] GenerateClientCertificateRequest parent - * @property {string|null} [requestId] GenerateClientCertificateRequest requestId - * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr - * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration - * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey - * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange - */ - - /** - * Constructs a new GenerateClientCertificateRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GenerateClientCertificateRequest. - * @implements IGenerateClientCertificateRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set - */ - function GenerateClientCertificateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateClientCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.parent = ""; - - /** - * GenerateClientCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.requestId = ""; - - /** - * GenerateClientCertificateRequest pemCsr. - * @member {string} pemCsr - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.pemCsr = ""; - - /** - * GenerateClientCertificateRequest certDuration. - * @member {google.protobuf.IDuration|null|undefined} certDuration - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.certDuration = null; - - /** - * GenerateClientCertificateRequest publicKey. - * @member {string} publicKey - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.publicKey = ""; - - /** - * GenerateClientCertificateRequest useMetadataExchange. - * @member {boolean} useMetadataExchange - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.useMetadataExchange = false; - - /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance - */ - GenerateClientCertificateRequest.create = function create(properties) { - return new GenerateClientCertificateRequest(properties); - }; - - /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); - if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) - $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); - if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); - return writer; - }; - - /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.pemCsr = reader.string(); - break; - } - case 4: { - message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.publicKey = reader.string(); - break; - } - case 6: { - message.useMetadataExchange = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateClientCertificateRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateClientCertificateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) { - var error = $root.google.protobuf.Duration.verify(message.certDuration); - if (error) - return "certDuration." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!$util.isString(message.publicKey)) - return "publicKey: string expected"; - if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) - if (typeof message.useMetadataExchange !== "boolean") - return "useMetadataExchange: boolean expected"; - return null; - }; - - /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} GenerateClientCertificateRequest - */ - GenerateClientCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - if (object.certDuration != null) { - if (typeof object.certDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest.certDuration: object expected"); - message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); - } - if (object.publicKey != null) - message.publicKey = String(object.publicKey); - if (object.useMetadataExchange != null) - message.useMetadataExchange = Boolean(object.useMetadataExchange); - return message; - }; - - /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest} message GenerateClientCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateClientCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - object.pemCsr = ""; - object.certDuration = null; - object.publicKey = ""; - object.useMetadataExchange = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - object.pemCsr = message.pemCsr; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) - object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = message.publicKey; - if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) - object.useMetadataExchange = message.useMetadataExchange; - return object; - }; - - /** - * Converts this GenerateClientCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateClientCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest"; - }; - - return GenerateClientCertificateRequest; - })(); - - v1alpha.GenerateClientCertificateResponse = (function() { - - /** - * Properties of a GenerateClientCertificateResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGenerateClientCertificateResponse - * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate - * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain - * @property {string|null} [caCert] GenerateClientCertificateResponse caCert - */ - - /** - * Constructs a new GenerateClientCertificateResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GenerateClientCertificateResponse. - * @implements IGenerateClientCertificateResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set - */ - function GenerateClientCertificateResponse(properties) { - this.pemCertificateChain = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateClientCertificateResponse pemCertificate. - * @member {string} pemCertificate - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.pemCertificate = ""; - - /** - * GenerateClientCertificateResponse pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; - - /** - * GenerateClientCertificateResponse caCert. - * @member {string} caCert - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.caCert = ""; - - /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance - */ - GenerateClientCertificateResponse.create = function create(properties) { - return new GenerateClientCertificateResponse(properties); - }; - - /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); - if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); - return writer; - }; - - /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pemCertificate = reader.string(); - break; - } - case 2: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 3: { - message.caCert = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateClientCertificateResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateClientCertificateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - if (!$util.isString(message.pemCertificate)) - return "pemCertificate: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.caCert != null && message.hasOwnProperty("caCert")) - if (!$util.isString(message.caCert)) - return "caCert: string expected"; - return null; - }; - - /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} GenerateClientCertificateResponse - */ - GenerateClientCertificateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse(); - if (object.pemCertificate != null) - message.pemCertificate = String(object.pemCertificate); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.caCert != null) - message.caCert = String(object.caCert); - return message; - }; - - /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse} message GenerateClientCertificateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateClientCertificateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) { - object.pemCertificate = ""; - object.caCert = ""; - } - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - object.pemCertificate = message.pemCertificate; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.caCert != null && message.hasOwnProperty("caCert")) - object.caCert = message.caCert; - return object; - }; - - /** - * Converts this GenerateClientCertificateResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @instance - * @returns {Object.} JSON object - */ - GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateClientCertificateResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse"; - }; - - return GenerateClientCertificateResponse; - })(); - - v1alpha.GetConnectionInfoRequest = (function() { - - /** - * Properties of a GetConnectionInfoRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetConnectionInfoRequest - * @property {string|null} [parent] GetConnectionInfoRequest parent - * @property {string|null} [requestId] GetConnectionInfoRequest requestId - */ - - /** - * Constructs a new GetConnectionInfoRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetConnectionInfoRequest. - * @implements IGetConnectionInfoRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set - */ - function GetConnectionInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConnectionInfoRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @instance - */ - GetConnectionInfoRequest.prototype.parent = ""; - - /** - * GetConnectionInfoRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @instance - */ - GetConnectionInfoRequest.prototype.requestId = ""; - - /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest instance - */ - GetConnectionInfoRequest.create = function create(properties) { - return new GetConnectionInfoRequest(properties); - }; - - /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConnectionInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetConnectionInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConnectionInfoRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConnectionInfoRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConnectionInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} GetConnectionInfoRequest - */ - GetConnectionInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetConnectionInfoRequest} message GetConnectionInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConnectionInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this GetConnectionInfoRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetConnectionInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetConnectionInfoRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetConnectionInfoRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetConnectionInfoRequest"; - }; - - return GetConnectionInfoRequest; - })(); - - v1alpha.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.alloydb.v1alpha - * @interface IOperationMetadata - * @property {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata - * @property {google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null} [promoteClusterStatus] OperationMetadata promoteClusterStatus - * @property {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null} [upgradeClusterStatus] OperationMetadata upgradeClusterStatus - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata batchCreateInstancesMetadata. - * @member {google.cloud.alloydb.v1alpha.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.batchCreateInstancesMetadata = null; - - /** - * OperationMetadata promoteClusterStatus. - * @member {google.cloud.alloydb.v1alpha.IPromoteClusterStatus|null|undefined} promoteClusterStatus - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.promoteClusterStatus = null; - - /** - * OperationMetadata upgradeClusterStatus. - * @member {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus|null|undefined} upgradeClusterStatus - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.upgradeClusterStatus = null; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OperationMetadata requestSpecific. - * @member {"batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata", "promoteClusterStatus", "upgradeClusterStatus"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) - $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.promoteClusterStatus != null && Object.hasOwnProperty.call(message, "promoteClusterStatus")) - $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.encode(message.promoteClusterStatus, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.upgradeClusterStatus != null && Object.hasOwnProperty.call(message, "upgradeClusterStatus")) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.encode(message.upgradeClusterStatus, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); - break; - } - case 9: { - message.promoteClusterStatus = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.decode(reader, reader.uint32()); - break; - } - case 10: { - message.upgradeClusterStatus = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.decode(reader, reader.uint32()); - break; - } - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); - if (error) - return "batchCreateInstancesMetadata." + error; - } - } - if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { - if (properties.requestSpecific === 1) - return "requestSpecific: multiple values"; - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify(message.promoteClusterStatus); - if (error) - return "promoteClusterStatus." + error; - } - } - if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { - if (properties.requestSpecific === 1) - return "requestSpecific: multiple values"; - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify(message.upgradeClusterStatus); - if (error) - return "upgradeClusterStatus." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.OperationMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.OperationMetadata(); - if (object.batchCreateInstancesMetadata != null) { - if (typeof object.batchCreateInstancesMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.batchCreateInstancesMetadata: object expected"); - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); - } - if (object.promoteClusterStatus != null) { - if (typeof object.promoteClusterStatus !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.promoteClusterStatus: object expected"); - message.promoteClusterStatus = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.fromObject(object.promoteClusterStatus); - } - if (object.upgradeClusterStatus != null) { - if (typeof object.upgradeClusterStatus !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.upgradeClusterStatus: object expected"); - message.upgradeClusterStatus = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.fromObject(object.upgradeClusterStatus); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1alpha.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); - if (options.oneofs) - object.requestSpecific = "batchCreateInstancesMetadata"; - } - if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { - object.promoteClusterStatus = $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.toObject(message.promoteClusterStatus, options); - if (options.oneofs) - object.requestSpecific = "promoteClusterStatus"; - } - if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { - object.upgradeClusterStatus = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.toObject(message.upgradeClusterStatus, options); - if (options.oneofs) - object.requestSpecific = "upgradeClusterStatus"; - } - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1alpha.PromoteClusterStatus = (function() { - - /** - * Properties of a PromoteClusterStatus. - * @memberof google.cloud.alloydb.v1alpha - * @interface IPromoteClusterStatus - * @property {google.cloud.alloydb.v1alpha.PromoteClusterStatus.State|null} [state] PromoteClusterStatus state - */ - - /** - * Constructs a new PromoteClusterStatus. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a PromoteClusterStatus. - * @implements IPromoteClusterStatus - * @constructor - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus=} [properties] Properties to set - */ - function PromoteClusterStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromoteClusterStatus state. - * @member {google.cloud.alloydb.v1alpha.PromoteClusterStatus.State} state - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @instance - */ - PromoteClusterStatus.prototype.state = 0; - - /** - * Creates a new PromoteClusterStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus instance - */ - PromoteClusterStatus.create = function create(properties) { - return new PromoteClusterStatus(properties); - }; - - /** - * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - return writer; - }; - - /** - * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.PromoteClusterStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromoteClusterStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromoteClusterStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.PromoteClusterStatus} PromoteClusterStatus - */ - PromoteClusterStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": - case 1: - message.state = 1; - break; - case "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": - case 2: - message.state = 2; - break; - case "PROMOTE_CLUSTER_COMPLETED": - case 3: - message.state = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.PromoteClusterStatus} message PromoteClusterStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromoteClusterStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.PromoteClusterStatus.State[message.state] : message.state; - return object; - }; - - /** - * Converts this PromoteClusterStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @instance - * @returns {Object.} JSON object - */ - PromoteClusterStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromoteClusterStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.PromoteClusterStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromoteClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.PromoteClusterStatus"; - }; - - /** - * State enum. - * @name google.cloud.alloydb.v1alpha.PromoteClusterStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_READ=1 PROMOTE_CLUSTER_AVAILABLE_FOR_READ value - * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE=2 PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE value - * @property {number} PROMOTE_CLUSTER_COMPLETED=3 PROMOTE_CLUSTER_COMPLETED value - */ - PromoteClusterStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROMOTE_CLUSTER_AVAILABLE_FOR_READ"] = 1; - values[valuesById[2] = "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE"] = 2; - values[valuesById[3] = "PROMOTE_CLUSTER_COMPLETED"] = 3; - return values; - })(); - - return PromoteClusterStatus; - })(); - - v1alpha.UpgradeClusterStatus = (function() { - - /** - * Properties of an UpgradeClusterStatus. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpgradeClusterStatus - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [state] UpgradeClusterStatus state - * @property {boolean|null} [cancellable] UpgradeClusterStatus cancellable - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [sourceVersion] UpgradeClusterStatus sourceVersion - * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [targetVersion] UpgradeClusterStatus targetVersion - * @property {Array.|null} [stages] UpgradeClusterStatus stages - */ - - /** - * Constructs a new UpgradeClusterStatus. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpgradeClusterStatus. - * @implements IUpgradeClusterStatus - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus=} [properties] Properties to set - */ - function UpgradeClusterStatus(properties) { - this.stages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterStatus state. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} state - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.state = 0; - - /** - * UpgradeClusterStatus cancellable. - * @member {boolean} cancellable - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.cancellable = false; - - /** - * UpgradeClusterStatus sourceVersion. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} sourceVersion - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.sourceVersion = 0; - - /** - * UpgradeClusterStatus targetVersion. - * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} targetVersion - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.targetVersion = 0; - - /** - * UpgradeClusterStatus stages. - * @member {Array.} stages - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.stages = $util.emptyArray; - - /** - * Creates a new UpgradeClusterStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus instance - */ - UpgradeClusterStatus.create = function create(properties) { - return new UpgradeClusterStatus(properties); - }; - - /** - * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.cancellable != null && Object.hasOwnProperty.call(message, "cancellable")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cancellable); - if (message.sourceVersion != null && Object.hasOwnProperty.call(message, "sourceVersion")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceVersion); - if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.targetVersion); - if (message.stages != null && message.stages.length) - for (var i = 0; i < message.stages.length; ++i) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.cancellable = reader.bool(); - break; - } - case 3: { - message.sourceVersion = reader.int32(); - break; - } - case 4: { - message.targetVersion = reader.int32(); - break; - } - case 5: { - if (!(message.stages && message.stages.length)) - message.stages = []; - message.stages.push($root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.cancellable != null && message.hasOwnProperty("cancellable")) - if (typeof message.cancellable !== "boolean") - return "cancellable: boolean expected"; - if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) - switch (message.sourceVersion) { - default: - return "sourceVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) - switch (message.targetVersion) { - default: - return "targetVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stages != null && message.hasOwnProperty("stages")) { - if (!Array.isArray(message.stages)) - return "stages: array expected"; - for (var i = 0; i < message.stages.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify(message.stages[i]); - if (error) - return "stages." + error; - } - } - return null; - }; - - /** - * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} UpgradeClusterStatus - */ - UpgradeClusterStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "IN_PROGRESS": - case 5: - message.state = 5; - break; - case "SUCCESS": - case 1: - message.state = 1; - break; - case "FAILED": - case 2: - message.state = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.state = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.cancellable != null) - message.cancellable = Boolean(object.cancellable); - switch (object.sourceVersion) { - default: - if (typeof object.sourceVersion === "number") { - message.sourceVersion = object.sourceVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.sourceVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.sourceVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.sourceVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.sourceVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.sourceVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.sourceVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.sourceVersion = 6; - break; - } - switch (object.targetVersion) { - default: - if (typeof object.targetVersion === "number") { - message.targetVersion = object.targetVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.targetVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.targetVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.targetVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.targetVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.targetVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.targetVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.targetVersion = 6; - break; - } - if (object.stages) { - if (!Array.isArray(object.stages)) - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.stages: array expected"); - message.stages = []; - for (var i = 0; i < object.stages.length; ++i) { - if (typeof object.stages[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.stages: object expected"); - message.stages[i] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.fromObject(object.stages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus} message UpgradeClusterStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.stages = []; - if (options.defaults) { - object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.cancellable = false; - object.sourceVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.targetVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] : message.state; - if (message.cancellable != null && message.hasOwnProperty("cancellable")) - object.cancellable = message.cancellable; - if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) - object.sourceVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.sourceVersion] === undefined ? message.sourceVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.sourceVersion] : message.sourceVersion; - if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) - object.targetVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.targetVersion] === undefined ? message.targetVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.targetVersion] : message.targetVersion; - if (message.stages && message.stages.length) { - object.stages = []; - for (var j = 0; j < message.stages.length; ++j) - object.stages[j] = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.toObject(message.stages[j], options); - } - return object; - }; - - /** - * Converts this UpgradeClusterStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus"; - }; - - UpgradeClusterStatus.StageStatus = (function() { - - /** - * Properties of a StageStatus. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @interface IStageStatus - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null} [readPoolInstancesUpgrade] StageStatus readPoolInstancesUpgrade - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage|null} [stage] StageStatus stage - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status|null} [state] StageStatus state - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null} [schedule] StageStatus schedule - */ - - /** - * Constructs a new StageStatus. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @classdesc Represents a StageStatus. - * @implements IStageStatus - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set - */ - function StageStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageStatus readPoolInstancesUpgrade. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null|undefined} readPoolInstancesUpgrade - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.readPoolInstancesUpgrade = null; - - /** - * StageStatus stage. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage} stage - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.stage = 0; - - /** - * StageStatus state. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status} state - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.state = 0; - - /** - * StageStatus schedule. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule|null|undefined} schedule - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.schedule = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * StageStatus stageSpecificStatus. - * @member {"readPoolInstancesUpgrade"|undefined} stageSpecificStatus - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @instance - */ - Object.defineProperty(StageStatus.prototype, "stageSpecificStatus", { - get: $util.oneOfGetter($oneOfFields = ["readPoolInstancesUpgrade"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StageStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus instance - */ - StageStatus.create = function create(properties) { - return new StageStatus(properties); - }; - - /** - * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.encode(message.schedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readPoolInstancesUpgrade != null && Object.hasOwnProperty.call(message, "readPoolInstancesUpgrade")) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.encode(message.readPoolInstancesUpgrade, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 11: { - message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.decode(reader, reader.uint32()); - break; - } - case 1: { - message.stage = reader.int32(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.schedule = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { - properties.stageSpecificStatus = 1; - { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify(message.readPoolInstancesUpgrade); - if (error) - return "readPoolInstancesUpgrade." + error; - } - } - if (message.stage != null && message.hasOwnProperty("stage")) - switch (message.stage) { - default: - return "stage: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify(message.schedule); - if (error) - return "schedule." + error; - } - return null; - }; - - /** - * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} StageStatus - */ - StageStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus(); - if (object.readPoolInstancesUpgrade != null) { - if (typeof object.readPoolInstancesUpgrade !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.readPoolInstancesUpgrade: object expected"); - message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.fromObject(object.readPoolInstancesUpgrade); - } - switch (object.stage) { - default: - if (typeof object.stage === "number") { - message.stage = object.stage; - break; - } - break; - case "STAGE_UNSPECIFIED": - case 0: - message.stage = 0; - break; - case "ALLOYDB_PRECHECK": - case 1: - message.stage = 1; - break; - case "PG_UPGRADE_CHECK": - case 2: - message.stage = 2; - break; - case "PREPARE_FOR_UPGRADE": - case 5: - message.stage = 5; - break; - case "PRIMARY_INSTANCE_UPGRADE": - case 3: - message.stage = 3; - break; - case "READ_POOL_INSTANCES_UPGRADE": - case 4: - message.stage = 4; - break; - case "ROLLBACK": - case 6: - message.stage = 6; - break; - case "CLEANUP": - case 7: - message.stage = 7; - break; - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "IN_PROGRESS": - case 5: - message.state = 5; - break; - case "SUCCESS": - case 1: - message.state = 1; - break; - case "FAILED": - case 2: - message.state = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.state = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.schedule: object expected"); - message.schedule = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.fromObject(object.schedule); - } - return message; - }; - - /** - * Creates a plain object from a StageStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus} message StageStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.schedule = null; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Stage[message.stage] : message.stage; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1alpha.UpgradeClusterResponse.Status[message.state] : message.state; - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.toObject(message.schedule, options); - if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { - object.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.toObject(message.readPoolInstancesUpgrade, options); - if (options.oneofs) - object.stageSpecificStatus = "readPoolInstancesUpgrade"; - } - return object; - }; - - /** - * Converts this StageStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @instance - * @returns {Object.} JSON object - */ - StageStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus"; - }; - - StageStatus.StageSchedule = (function() { - - /** - * Properties of a StageSchedule. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @interface IStageSchedule - * @property {google.protobuf.ITimestamp|null} [estimatedStartTime] StageSchedule estimatedStartTime - * @property {google.protobuf.ITimestamp|null} [actualStartTime] StageSchedule actualStartTime - * @property {google.protobuf.ITimestamp|null} [estimatedEndTime] StageSchedule estimatedEndTime - * @property {google.protobuf.ITimestamp|null} [actualEndTime] StageSchedule actualEndTime - */ - - /** - * Constructs a new StageSchedule. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus - * @classdesc Represents a StageSchedule. - * @implements IStageSchedule - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set - */ - function StageSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageSchedule estimatedStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} estimatedStartTime - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.estimatedStartTime = null; - - /** - * StageSchedule actualStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} actualStartTime - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.actualStartTime = null; - - /** - * StageSchedule estimatedEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} estimatedEndTime - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.estimatedEndTime = null; - - /** - * StageSchedule actualEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} actualEndTime - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.actualEndTime = null; - - /** - * Creates a new StageSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule instance - */ - StageSchedule.create = function create(properties) { - return new StageSchedule(properties); - }; - - /** - * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.estimatedStartTime != null && Object.hasOwnProperty.call(message, "estimatedStartTime")) - $root.google.protobuf.Timestamp.encode(message.estimatedStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.actualStartTime != null && Object.hasOwnProperty.call(message, "actualStartTime")) - $root.google.protobuf.Timestamp.encode(message.actualStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.estimatedEndTime != null && Object.hasOwnProperty.call(message, "estimatedEndTime")) - $root.google.protobuf.Timestamp.encode(message.estimatedEndTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.actualEndTime != null && Object.hasOwnProperty.call(message, "actualEndTime")) - $root.google.protobuf.Timestamp.encode(message.actualEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.estimatedStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.actualStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.estimatedEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.actualEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageSchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.estimatedStartTime); - if (error) - return "estimatedStartTime." + error; - } - if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.actualStartTime); - if (error) - return "actualStartTime." + error; - } - if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.estimatedEndTime); - if (error) - return "estimatedEndTime." + error; - } - if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.actualEndTime); - if (error) - return "actualEndTime." + error; - } - return null; - }; - - /** - * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - */ - StageSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule(); - if (object.estimatedStartTime != null) { - if (typeof object.estimatedStartTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedStartTime: object expected"); - message.estimatedStartTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedStartTime); - } - if (object.actualStartTime != null) { - if (typeof object.actualStartTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.actualStartTime: object expected"); - message.actualStartTime = $root.google.protobuf.Timestamp.fromObject(object.actualStartTime); - } - if (object.estimatedEndTime != null) { - if (typeof object.estimatedEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedEndTime: object expected"); - message.estimatedEndTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedEndTime); - } - if (object.actualEndTime != null) { - if (typeof object.actualEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule.actualEndTime: object expected"); - message.actualEndTime = $root.google.protobuf.Timestamp.fromObject(object.actualEndTime); - } - return message; - }; - - /** - * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule} message StageSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.estimatedStartTime = null; - object.actualStartTime = null; - object.estimatedEndTime = null; - object.actualEndTime = null; - } - if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) - object.estimatedStartTime = $root.google.protobuf.Timestamp.toObject(message.estimatedStartTime, options); - if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) - object.actualStartTime = $root.google.protobuf.Timestamp.toObject(message.actualStartTime, options); - if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) - object.estimatedEndTime = $root.google.protobuf.Timestamp.toObject(message.estimatedEndTime, options); - if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) - object.actualEndTime = $root.google.protobuf.Timestamp.toObject(message.actualEndTime, options); - return object; - }; - - /** - * Converts this StageSchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - * @returns {Object.} JSON object - */ - StageSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageSchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.StageStatus.StageSchedule"; - }; - - return StageSchedule; - })(); - - return StageStatus; - })(); - - UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus = (function() { - - /** - * Properties of a ReadPoolInstancesUpgradeStageStatus. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @interface IReadPoolInstancesUpgradeStageStatus - * @property {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null} [upgradeStats] ReadPoolInstancesUpgradeStageStatus upgradeStats - */ - - /** - * Constructs a new ReadPoolInstancesUpgradeStageStatus. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus - * @classdesc Represents a ReadPoolInstancesUpgradeStageStatus. - * @implements IReadPoolInstancesUpgradeStageStatus - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set - */ - function ReadPoolInstancesUpgradeStageStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadPoolInstancesUpgradeStageStatus upgradeStats. - * @member {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null|undefined} upgradeStats - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @instance - */ - ReadPoolInstancesUpgradeStageStatus.prototype.upgradeStats = null; - - /** - * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus instance - */ - ReadPoolInstancesUpgradeStageStatus.create = function create(properties) { - return new ReadPoolInstancesUpgradeStageStatus(properties); - }; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolInstancesUpgradeStageStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgradeStats != null && Object.hasOwnProperty.call(message, "upgradeStats")) - $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.encode(message.upgradeStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolInstancesUpgradeStageStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolInstancesUpgradeStageStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.upgradeStats = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolInstancesUpgradeStageStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolInstancesUpgradeStageStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolInstancesUpgradeStageStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) { - var error = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify(message.upgradeStats); - if (error) - return "upgradeStats." + error; - } - return null; - }; - - /** - * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - */ - ReadPoolInstancesUpgradeStageStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); - if (object.upgradeStats != null) { - if (typeof object.upgradeStats !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.upgradeStats: object expected"); - message.upgradeStats = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.fromObject(object.upgradeStats); - } - return message; - }; - - /** - * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolInstancesUpgradeStageStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.upgradeStats = null; - if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) - object.upgradeStats = $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.toObject(message.upgradeStats, options); - return object; - }; - - /** - * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @instance - * @returns {Object.} JSON object - */ - ReadPoolInstancesUpgradeStageStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolInstancesUpgradeStageStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolInstancesUpgradeStageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus"; - }; - - ReadPoolInstancesUpgradeStageStatus.Stats = (function() { - - /** - * Properties of a Stats. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @interface IStats - * @property {number|null} [notStarted] Stats notStarted - * @property {number|null} [ongoing] Stats ongoing - * @property {number|null} [success] Stats success - * @property {number|null} [failed] Stats failed - */ - - /** - * Constructs a new Stats. - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @classdesc Represents a Stats. - * @implements IStats - * @constructor - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set - */ - function Stats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Stats notStarted. - * @member {number} notStarted - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.notStarted = 0; - - /** - * Stats ongoing. - * @member {number} ongoing - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.ongoing = 0; - - /** - * Stats success. - * @member {number} success - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.success = 0; - - /** - * Stats failed. - * @member {number} failed - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.failed = 0; - - /** - * Creates a new Stats instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats instance - */ - Stats.create = function create(properties) { - return new Stats(properties); - }; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.notStarted != null && Object.hasOwnProperty.call(message, "notStarted")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.notStarted); - if (message.ongoing != null && Object.hasOwnProperty.call(message, "ongoing")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ongoing); - if (message.success != null && Object.hasOwnProperty.call(message, "success")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.success); - if (message.failed != null && Object.hasOwnProperty.call(message, "failed")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failed); - return writer; - }; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.notStarted = reader.int32(); - break; - } - case 2: { - message.ongoing = reader.int32(); - break; - } - case 3: { - message.success = reader.int32(); - break; - } - case 4: { - message.failed = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Stats message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Stats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.notStarted != null && message.hasOwnProperty("notStarted")) - if (!$util.isInteger(message.notStarted)) - return "notStarted: integer expected"; - if (message.ongoing != null && message.hasOwnProperty("ongoing")) - if (!$util.isInteger(message.ongoing)) - return "ongoing: integer expected"; - if (message.success != null && message.hasOwnProperty("success")) - if (!$util.isInteger(message.success)) - return "success: integer expected"; - if (message.failed != null && message.hasOwnProperty("failed")) - if (!$util.isInteger(message.failed)) - return "failed: integer expected"; - return null; - }; - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - */ - Stats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); - if (object.notStarted != null) - message.notStarted = object.notStarted | 0; - if (object.ongoing != null) - message.ongoing = object.ongoing | 0; - if (object.success != null) - message.success = object.success | 0; - if (object.failed != null) - message.failed = object.failed | 0; - return message; - }; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} message Stats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Stats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.notStarted = 0; - object.ongoing = 0; - object.success = 0; - object.failed = 0; - } - if (message.notStarted != null && message.hasOwnProperty("notStarted")) - object.notStarted = message.notStarted; - if (message.ongoing != null && message.hasOwnProperty("ongoing")) - object.ongoing = message.ongoing; - if (message.success != null && message.hasOwnProperty("success")) - object.success = message.success; - if (message.failed != null && message.hasOwnProperty("failed")) - object.failed = message.failed; - return object; - }; - - /** - * Converts this Stats to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - * @returns {Object.} JSON object - */ - Stats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Stats - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats"; - }; - - return Stats; - })(); - - return ReadPoolInstancesUpgradeStageStatus; - })(); - - return UpgradeClusterStatus; - })(); - - v1alpha.ListUsersRequest = (function() { - - /** - * Properties of a ListUsersRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListUsersRequest - * @property {string|null} [parent] ListUsersRequest parent - * @property {number|null} [pageSize] ListUsersRequest pageSize - * @property {string|null} [pageToken] ListUsersRequest pageToken - * @property {string|null} [filter] ListUsersRequest filter - * @property {string|null} [orderBy] ListUsersRequest orderBy - */ - - /** - * Constructs a new ListUsersRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListUsersRequest. - * @implements IListUsersRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListUsersRequest=} [properties] Properties to set - */ - function ListUsersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUsersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.parent = ""; - - /** - * ListUsersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageSize = 0; - - /** - * ListUsersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageToken = ""; - - /** - * ListUsersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.filter = ""; - - /** - * ListUsersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListUsersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest instance - */ - ListUsersRequest.create = function create(properties) { - return new ListUsersRequest(properties); - }; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListUsersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListUsersRequest} ListUsersRequest - */ - ListUsersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListUsersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListUsersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListUsersRequest} message ListUsersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListUsersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @instance - * @returns {Object.} JSON object - */ - ListUsersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListUsersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListUsersRequest"; - }; - - return ListUsersRequest; - })(); - - v1alpha.ListUsersResponse = (function() { - - /** - * Properties of a ListUsersResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListUsersResponse - * @property {Array.|null} [users] ListUsersResponse users - * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken - * @property {Array.|null} [unreachable] ListUsersResponse unreachable - */ - - /** - * Constructs a new ListUsersResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListUsersResponse. - * @implements IListUsersResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListUsersResponse=} [properties] Properties to set - */ - function ListUsersResponse(properties) { - this.users = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUsersResponse users. - * @member {Array.} users - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.users = $util.emptyArray; - - /** - * ListUsersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.nextPageToken = ""; - - /** - * ListUsersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListUsersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse instance - */ - ListUsersResponse.create = function create(properties) { - return new ListUsersResponse(properties); - }; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.users != null && message.users.length) - for (var i = 0; i < message.users.length; ++i) - $root.google.cloud.alloydb.v1alpha.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListUsersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListUsersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.users && message.users.length)) - message.users = []; - message.users.push($root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.users != null && message.hasOwnProperty("users")) { - if (!Array.isArray(message.users)) - return "users: array expected"; - for (var i = 0; i < message.users.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.users[i]); - if (error) - return "users." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListUsersResponse} ListUsersResponse - */ - ListUsersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListUsersResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListUsersResponse(); - if (object.users) { - if (!Array.isArray(object.users)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.users: array expected"); - message.users = []; - for (var i = 0; i < object.users.length; ++i) { - if (typeof object.users[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.users: object expected"); - message.users[i] = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.users[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListUsersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListUsersResponse} message ListUsersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.users = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.users && message.users.length) { - object.users = []; - for (var j = 0; j < message.users.length; ++j) - object.users[j] = $root.google.cloud.alloydb.v1alpha.User.toObject(message.users[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListUsersResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @instance - * @returns {Object.} JSON object - */ - ListUsersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListUsersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListUsersResponse"; - }; - - return ListUsersResponse; - })(); - - v1alpha.GetUserRequest = (function() { - - /** - * Properties of a GetUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IGetUserRequest - * @property {string|null} [name] GetUserRequest name - */ - - /** - * Constructs a new GetUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a GetUserRequest. - * @implements IGetUserRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IGetUserRequest=} [properties] Properties to set - */ - function GetUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetUserRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @instance - */ - GetUserRequest.prototype.name = ""; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest instance - */ - GetUserRequest.create = function create(properties) { - return new GetUserRequest(properties); - }; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.GetUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.GetUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.GetUserRequest} GetUserRequest - */ - GetUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.GetUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.GetUserRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.GetUserRequest} message GetUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @instance - * @returns {Object.} JSON object - */ - GetUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.GetUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.GetUserRequest"; - }; - - return GetUserRequest; - })(); - - v1alpha.CreateUserRequest = (function() { - - /** - * Properties of a CreateUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateUserRequest - * @property {string|null} [parent] CreateUserRequest parent - * @property {string|null} [userId] CreateUserRequest userId - * @property {google.cloud.alloydb.v1alpha.IUser|null} [user] CreateUserRequest user - * @property {string|null} [requestId] CreateUserRequest requestId - * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly - */ - - /** - * Constructs a new CreateUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateUserRequest. - * @implements ICreateUserRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest=} [properties] Properties to set - */ - function CreateUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateUserRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.parent = ""; - - /** - * CreateUserRequest userId. - * @member {string} userId - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.userId = ""; - - /** - * CreateUserRequest user. - * @member {google.cloud.alloydb.v1alpha.IUser|null|undefined} user - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.user = null; - - /** - * CreateUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.requestId = ""; - - /** - * CreateUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest instance - */ - CreateUserRequest.create = function create(properties) { - return new CreateUserRequest(properties); - }; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.cloud.alloydb.v1alpha.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.userId = reader.string(); - break; - } - case 3: { - message.user = $root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateUserRequest} CreateUserRequest - */ - CreateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateUserRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userId != null) - message.userId = String(object.userId); - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateUserRequest.user: object expected"); - message.user = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.user); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateUserRequest} message CreateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userId = ""; - object.user = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.cloud.alloydb.v1alpha.User.toObject(message.user, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @instance - * @returns {Object.} JSON object - */ - CreateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateUserRequest"; - }; - - return CreateUserRequest; - })(); - - v1alpha.UpdateUserRequest = (function() { - - /** - * Properties of an UpdateUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IUpdateUserRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask - * @property {google.cloud.alloydb.v1alpha.IUser|null} [user] UpdateUserRequest user - * @property {string|null} [requestId] UpdateUserRequest requestId - * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing - */ - - /** - * Constructs a new UpdateUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents an UpdateUserRequest. - * @implements IUpdateUserRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest=} [properties] Properties to set - */ - function UpdateUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateUserRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.updateMask = null; - - /** - * UpdateUserRequest user. - * @member {google.cloud.alloydb.v1alpha.IUser|null|undefined} user - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.user = null; - - /** - * UpdateUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.requestId = ""; - - /** - * UpdateUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.validateOnly = false; - - /** - * UpdateUserRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest instance - */ - UpdateUserRequest.create = function create(properties) { - return new UpdateUserRequest(properties); - }; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.cloud.alloydb.v1alpha.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.UpdateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.UpdateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.user = $root.google.cloud.alloydb.v1alpha.User.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.cloud.alloydb.v1alpha.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.UpdateUserRequest} UpdateUserRequest - */ - UpdateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.UpdateUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.UpdateUserRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateUserRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.UpdateUserRequest.user: object expected"); - message.user = $root.google.cloud.alloydb.v1alpha.User.fromObject(object.user); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.UpdateUserRequest} message UpdateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.user = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.cloud.alloydb.v1alpha.User.toObject(message.user, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.UpdateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.UpdateUserRequest"; - }; - - return UpdateUserRequest; - })(); - - v1alpha.DeleteUserRequest = (function() { - - /** - * Properties of a DeleteUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IDeleteUserRequest - * @property {string|null} [name] DeleteUserRequest name - * @property {string|null} [requestId] DeleteUserRequest requestId - * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly - */ - - /** - * Constructs a new DeleteUserRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a DeleteUserRequest. - * @implements IDeleteUserRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest=} [properties] Properties to set - */ - function DeleteUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteUserRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.name = ""; - - /** - * DeleteUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.requestId = ""; - - /** - * DeleteUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest instance - */ - DeleteUserRequest.create = function create(properties) { - return new DeleteUserRequest(properties); - }; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.DeleteUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.DeleteUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.DeleteUserRequest} DeleteUserRequest - */ - DeleteUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.DeleteUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.DeleteUserRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1alpha.DeleteUserRequest} message DeleteUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.DeleteUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.DeleteUserRequest"; - }; - - return DeleteUserRequest; - })(); - - v1alpha.ListDatabasesRequest = (function() { - - /** - * Properties of a ListDatabasesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListDatabasesRequest - * @property {string|null} [parent] ListDatabasesRequest parent - * @property {number|null} [pageSize] ListDatabasesRequest pageSize - * @property {string|null} [pageToken] ListDatabasesRequest pageToken - * @property {string|null} [filter] ListDatabasesRequest filter - */ - - /** - * Constructs a new ListDatabasesRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListDatabasesRequest. - * @implements IListDatabasesRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest=} [properties] Properties to set - */ - function ListDatabasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.parent = ""; - - /** - * ListDatabasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageSize = 0; - - /** - * ListDatabasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageToken = ""; - - /** - * ListDatabasesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.filter = ""; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest instance - */ - ListDatabasesRequest.create = function create(properties) { - return new ListDatabasesRequest(properties); - }; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesRequest} ListDatabasesRequest - */ - ListDatabasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ListDatabasesRequest} message ListDatabasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListDatabasesRequest"; - }; - - return ListDatabasesRequest; - })(); - - v1alpha.ListDatabasesResponse = (function() { - - /** - * Properties of a ListDatabasesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @interface IListDatabasesResponse - * @property {Array.|null} [databases] ListDatabasesResponse databases - * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabasesResponse. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a ListDatabasesResponse. - * @implements IListDatabasesResponse - * @constructor - * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse=} [properties] Properties to set - */ - function ListDatabasesResponse(properties) { - this.databases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesResponse databases. - * @member {Array.} databases - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.databases = $util.emptyArray; - - /** - * ListDatabasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse instance - */ - ListDatabasesResponse.create = function create(properties) { - return new ListDatabasesResponse(properties); - }; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databases != null && message.databases.length) - for (var i = 0; i < message.databases.length; ++i) - $root.google.cloud.alloydb.v1alpha.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.ListDatabasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databases && message.databases.length)) - message.databases = []; - message.databases.push($root.google.cloud.alloydb.v1alpha.Database.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databases != null && message.hasOwnProperty("databases")) { - if (!Array.isArray(message.databases)) - return "databases: array expected"; - for (var i = 0; i < message.databases.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.Database.verify(message.databases[i]); - if (error) - return "databases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.ListDatabasesResponse} ListDatabasesResponse - */ - ListDatabasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.ListDatabasesResponse(); - if (object.databases) { - if (!Array.isArray(object.databases)) - throw TypeError(".google.cloud.alloydb.v1alpha.ListDatabasesResponse.databases: array expected"); - message.databases = []; - for (var i = 0; i < object.databases.length; ++i) { - if (typeof object.databases[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.ListDatabasesResponse.databases: object expected"); - message.databases[i] = $root.google.cloud.alloydb.v1alpha.Database.fromObject(object.databases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1alpha.ListDatabasesResponse} message ListDatabasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databases && message.databases.length) { - object.databases = []; - for (var j = 0; j < message.databases.length; ++j) - object.databases[j] = $root.google.cloud.alloydb.v1alpha.Database.toObject(message.databases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.ListDatabasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.ListDatabasesResponse"; - }; - - return ListDatabasesResponse; - })(); - - v1alpha.CreateDatabaseRequest = (function() { - - /** - * Properties of a CreateDatabaseRequest. - * @memberof google.cloud.alloydb.v1alpha - * @interface ICreateDatabaseRequest - * @property {string|null} [parent] CreateDatabaseRequest parent - * @property {string|null} [databaseId] CreateDatabaseRequest databaseId - * @property {google.cloud.alloydb.v1alpha.IDatabase|null} [database] CreateDatabaseRequest database - */ - - /** - * Constructs a new CreateDatabaseRequest. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a CreateDatabaseRequest. - * @implements ICreateDatabaseRequest - * @constructor - * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest=} [properties] Properties to set - */ - function CreateDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDatabaseRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.parent = ""; - - /** - * CreateDatabaseRequest databaseId. - * @member {string} databaseId - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.databaseId = ""; - - /** - * CreateDatabaseRequest database. - * @member {google.cloud.alloydb.v1alpha.IDatabase|null|undefined} database - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.database = null; - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest instance - */ - CreateDatabaseRequest.create = function create(properties) { - return new CreateDatabaseRequest(properties); - }; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.cloud.alloydb.v1alpha.Database.encode(message.database, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.CreateDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1alpha.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.databaseId = reader.string(); - break; - } - case 3: { - message.database = $root.google.cloud.alloydb.v1alpha.Database.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDatabaseRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.cloud.alloydb.v1alpha.Database.verify(message.database); - if (error) - return "database." + error; - } - return null; - }; - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} CreateDatabaseRequest - */ - CreateDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.CreateDatabaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.database != null) { - if (typeof object.database !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.CreateDatabaseRequest.database: object expected"); - message.database = $root.google.cloud.alloydb.v1alpha.Database.fromObject(object.database); - } - return message; - }; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1alpha.CreateDatabaseRequest} message CreateDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.databaseId = ""; - object.database = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.cloud.alloydb.v1alpha.Database.toObject(message.database, options); - return object; - }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.CreateDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.CreateDatabaseRequest"; - }; - - return CreateDatabaseRequest; - })(); - - v1alpha.SqlResult = (function() { - - /** - * Properties of a SqlResult. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISqlResult - * @property {Array.|null} [columns] SqlResult columns - * @property {Array.|null} [rows] SqlResult rows - */ - - /** - * Constructs a new SqlResult. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SqlResult. - * @implements ISqlResult - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISqlResult=} [properties] Properties to set - */ - function SqlResult(properties) { - this.columns = []; - this.rows = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResult columns. - * @member {Array.} columns - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @instance - */ - SqlResult.prototype.columns = $util.emptyArray; - - /** - * SqlResult rows. - * @member {Array.} rows - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @instance - */ - SqlResult.prototype.rows = $util.emptyArray; - - /** - * Creates a new SqlResult instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResult=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult instance - */ - SqlResult.create = function create(properties) { - return new SqlResult(properties); - }; - - /** - * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResult} message SqlResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - $root.google.cloud.alloydb.v1alpha.SqlResultColumn.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.cloud.alloydb.v1alpha.SqlResultRow.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResult} message SqlResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push($root.google.cloud.alloydb.v1alpha.SqlResultColumn.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.cloud.alloydb.v1alpha.SqlResultRow.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResult message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.SqlResultColumn.verify(message.columns[i]); - if (error) - return "columns." + error; - } - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.SqlResultRow.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - return null; - }; - - /** - * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SqlResult} SqlResult - */ - SqlResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResult) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SqlResult(); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) { - if (typeof object.columns[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.columns: object expected"); - message.columns[i] = $root.google.cloud.alloydb.v1alpha.SqlResultColumn.fromObject(object.columns[i]); - } - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SqlResult.rows: object expected"); - message.rows[i] = $root.google.cloud.alloydb.v1alpha.SqlResultRow.fromObject(object.rows[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SqlResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {google.cloud.alloydb.v1alpha.SqlResult} message SqlResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columns = []; - object.rows = []; - } - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = $root.google.cloud.alloydb.v1alpha.SqlResultColumn.toObject(message.columns[j], options); - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.cloud.alloydb.v1alpha.SqlResultRow.toObject(message.rows[j], options); - } - return object; - }; - - /** - * Converts this SqlResult to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @instance - * @returns {Object.} JSON object - */ - SqlResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResult - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SqlResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResult"; - }; - - return SqlResult; - })(); - - v1alpha.SqlResultColumn = (function() { - - /** - * Properties of a SqlResultColumn. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISqlResultColumn - * @property {string|null} [name] SqlResultColumn name - * @property {string|null} [type] SqlResultColumn type - */ - - /** - * Constructs a new SqlResultColumn. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SqlResultColumn. - * @implements ISqlResultColumn - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn=} [properties] Properties to set - */ - function SqlResultColumn(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultColumn name. - * @member {string} name - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @instance - */ - SqlResultColumn.prototype.name = ""; - - /** - * SqlResultColumn type. - * @member {string} type - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @instance - */ - SqlResultColumn.prototype.type = ""; - - /** - * Creates a new SqlResultColumn instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn instance - */ - SqlResultColumn.create = function create(properties) { - return new SqlResultColumn(properties); - }; - - /** - * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn} message SqlResultColumn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultColumn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - return writer; - }; - - /** - * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultColumn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultColumn} message SqlResultColumn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultColumn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResultColumn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultColumn message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultColumn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SqlResultColumn} SqlResultColumn - */ - SqlResultColumn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResultColumn) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SqlResultColumn(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1alpha.SqlResultColumn} message SqlResultColumn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultColumn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this SqlResultColumn to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @instance - * @returns {Object.} JSON object - */ - SqlResultColumn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultColumn - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SqlResultColumn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResultColumn"; - }; - - return SqlResultColumn; - })(); - - v1alpha.SqlResultRow = (function() { - - /** - * Properties of a SqlResultRow. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISqlResultRow - * @property {Array.|null} [values] SqlResultRow values - */ - - /** - * Constructs a new SqlResultRow. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SqlResultRow. - * @implements ISqlResultRow - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISqlResultRow=} [properties] Properties to set - */ - function SqlResultRow(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultRow values. - * @member {Array.} values - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @instance - */ - SqlResultRow.prototype.values = $util.emptyArray; - - /** - * Creates a new SqlResultRow instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultRow=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow instance - */ - SqlResultRow.create = function create(properties) { - return new SqlResultRow(properties); - }; - - /** - * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultRow} message SqlResultRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.alloydb.v1alpha.SqlResultValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultRow} message SqlResultRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultRow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResultRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.alloydb.v1alpha.SqlResultValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultRow message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.alloydb.v1alpha.SqlResultValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SqlResultRow} SqlResultRow - */ - SqlResultRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResultRow) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SqlResultRow(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.alloydb.v1alpha.SqlResultRow.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1alpha.SqlResultRow.values: object expected"); - message.values[i] = $root.google.cloud.alloydb.v1alpha.SqlResultValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1alpha.SqlResultRow} message SqlResultRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.alloydb.v1alpha.SqlResultValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this SqlResultRow to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @instance - * @returns {Object.} JSON object - */ - SqlResultRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultRow - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SqlResultRow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResultRow"; - }; - - return SqlResultRow; - })(); - - v1alpha.SqlResultValue = (function() { - - /** - * Properties of a SqlResultValue. - * @memberof google.cloud.alloydb.v1alpha - * @interface ISqlResultValue - * @property {string|null} [value] SqlResultValue value - * @property {boolean|null} [nullValue] SqlResultValue nullValue - */ - - /** - * Constructs a new SqlResultValue. - * @memberof google.cloud.alloydb.v1alpha - * @classdesc Represents a SqlResultValue. - * @implements ISqlResultValue - * @constructor - * @param {google.cloud.alloydb.v1alpha.ISqlResultValue=} [properties] Properties to set - */ - function SqlResultValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @instance - */ - SqlResultValue.prototype.value = null; - - /** - * SqlResultValue nullValue. - * @member {boolean|null|undefined} nullValue - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @instance - */ - SqlResultValue.prototype.nullValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlResultValue.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlResultValue.prototype, "_nullValue", { - get: $util.oneOfGetter($oneOfFields = ["nullValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SqlResultValue instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultValue=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue instance - */ - SqlResultValue.create = function create(properties) { - return new SqlResultValue(properties); - }; - - /** - * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultValue} message SqlResultValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.nullValue); - return writer; - }; - - /** - * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.SqlResultValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1alpha.ISqlResultValue} message SqlResultValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.SqlResultValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - case 2: { - message.nullValue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultValue message. - * @function verify - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties._nullValue = 1; - if (typeof message.nullValue !== "boolean") - return "nullValue: boolean expected"; - } - return null; - }; - - /** - * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1alpha.SqlResultValue} SqlResultValue - */ - SqlResultValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1alpha.SqlResultValue) - return object; - var message = new $root.google.cloud.alloydb.v1alpha.SqlResultValue(); - if (object.value != null) - message.value = String(object.value); - if (object.nullValue != null) - message.nullValue = Boolean(object.nullValue); - return message; - }; - - /** - * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1alpha.SqlResultValue} message SqlResultValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object._value = "value"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = message.nullValue; - if (options.oneofs) - object._nullValue = "nullValue"; - } - return object; - }; - - /** - * Converts this SqlResultValue to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @instance - * @returns {Object.} JSON object - */ - SqlResultValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultValue - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1alpha.SqlResultValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.SqlResultValue"; - }; - - return SqlResultValue; - })(); - - return v1alpha; - })(); - - alloydb.v1beta = (function() { - - /** - * Namespace v1beta. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1beta = {}; - - v1beta.CloudSQLBackupRunSource = (function() { - - /** - * Properties of a CloudSQLBackupRunSource. - * @memberof google.cloud.alloydb.v1beta - * @interface ICloudSQLBackupRunSource - * @property {string|null} [project] CloudSQLBackupRunSource project - * @property {string|null} [instanceId] CloudSQLBackupRunSource instanceId - * @property {number|Long|null} [backupRunId] CloudSQLBackupRunSource backupRunId - */ - - /** - * Constructs a new CloudSQLBackupRunSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CloudSQLBackupRunSource. - * @implements ICloudSQLBackupRunSource - * @constructor - * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource=} [properties] Properties to set - */ - function CloudSQLBackupRunSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSQLBackupRunSource project. - * @member {string} project - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.project = ""; - - /** - * CloudSQLBackupRunSource instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.instanceId = ""; - - /** - * CloudSQLBackupRunSource backupRunId. - * @member {number|Long} backupRunId - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @instance - */ - CloudSQLBackupRunSource.prototype.backupRunId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CloudSQLBackupRunSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource instance - */ - CloudSQLBackupRunSource.create = function create(properties) { - return new CloudSQLBackupRunSource(properties); - }; - - /** - * Encodes the specified CloudSQLBackupRunSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSQLBackupRunSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.backupRunId); - return writer; - }; - - /** - * Encodes the specified CloudSQLBackupRunSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource} message CloudSQLBackupRunSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSQLBackupRunSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSQLBackupRunSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.backupRunId = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSQLBackupRunSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSQLBackupRunSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSQLBackupRunSource message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSQLBackupRunSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) - return "backupRunId: integer|Long expected"; - return null; - }; - - /** - * Creates a CloudSQLBackupRunSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} CloudSQLBackupRunSource - */ - CloudSQLBackupRunSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource(); - if (object.project != null) - message.project = String(object.project); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.backupRunId != null) - if ($util.Long) - (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; - else if (typeof object.backupRunId === "string") - message.backupRunId = parseInt(object.backupRunId, 10); - else if (typeof object.backupRunId === "number") - message.backupRunId = object.backupRunId; - else if (typeof object.backupRunId === "object") - message.backupRunId = new $util.LongBits(object.backupRunId.low >>> 0, object.backupRunId.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CloudSQLBackupRunSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} message CloudSQLBackupRunSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSQLBackupRunSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.instanceId = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backupRunId = options.longs === String ? "0" : 0; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (typeof message.backupRunId === "number") - object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; - else - object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; - return object; - }; - - /** - * Converts this CloudSQLBackupRunSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @instance - * @returns {Object.} JSON object - */ - CloudSQLBackupRunSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSQLBackupRunSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CloudSQLBackupRunSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSQLBackupRunSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CloudSQLBackupRunSource"; - }; - - return CloudSQLBackupRunSource; - })(); - - v1beta.AlloyDBCSQLAdmin = (function() { - - /** - * Constructs a new AlloyDBCSQLAdmin service. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an AlloyDBCSQLAdmin - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AlloyDBCSQLAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBCSQLAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBCSQLAdmin; - - /** - * Creates new AlloyDBCSQLAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AlloyDBCSQLAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBCSQLAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin|restoreFromCloudSQL}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin - * @typedef RestoreFromCloudSQLCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreFromCloudSQL. - * @function restoreFromCloudSQL - * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQLCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBCSQLAdmin.prototype.restoreFromCloudSQL = function restoreFromCloudSQL(request, callback) { - return this.rpcCall(restoreFromCloudSQL, $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreFromCloudSQL" }); - - /** - * Calls RestoreFromCloudSQL. - * @function restoreFromCloudSQL - * @memberof google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} request RestoreFromCloudSQLRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBCSQLAdmin; - })(); - - v1beta.RestoreFromCloudSQLRequest = (function() { - - /** - * Properties of a RestoreFromCloudSQLRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IRestoreFromCloudSQLRequest - * @property {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] RestoreFromCloudSQLRequest cloudsqlBackupRunSource - * @property {string|null} [parent] RestoreFromCloudSQLRequest parent - * @property {string|null} [clusterId] RestoreFromCloudSQLRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] RestoreFromCloudSQLRequest cluster - */ - - /** - * Constructs a new RestoreFromCloudSQLRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a RestoreFromCloudSQLRequest. - * @implements IRestoreFromCloudSQLRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest=} [properties] Properties to set - */ - function RestoreFromCloudSQLRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreFromCloudSQLRequest cloudsqlBackupRunSource. - * @member {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.cloudsqlBackupRunSource = null; - - /** - * RestoreFromCloudSQLRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.parent = ""; - - /** - * RestoreFromCloudSQLRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.clusterId = ""; - - /** - * RestoreFromCloudSQLRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @instance - */ - RestoreFromCloudSQLRequest.prototype.cluster = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreFromCloudSQLRequest source. - * @member {"cloudsqlBackupRunSource"|undefined} source - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @instance - */ - Object.defineProperty(RestoreFromCloudSQLRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["cloudsqlBackupRunSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreFromCloudSQLRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest instance - */ - RestoreFromCloudSQLRequest.create = function create(properties) { - return new RestoreFromCloudSQLRequest(properties); - }; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreFromCloudSQLRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) - $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreFromCloudSQLRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreFromCloudSQLRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreFromCloudSQLRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 101: { - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreFromCloudSQLRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreFromCloudSQLRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreFromCloudSQLRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreFromCloudSQLRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); - if (error) - return "cloudsqlBackupRunSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - return null; - }; - - /** - * Creates a RestoreFromCloudSQLRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} RestoreFromCloudSQLRequest - */ - RestoreFromCloudSQLRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest(); - if (object.cloudsqlBackupRunSource != null) { - if (typeof object.cloudsqlBackupRunSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.cloudsqlBackupRunSource: object expected"); - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); - } - return message; - }; - - /** - * Creates a plain object from a RestoreFromCloudSQLRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest} message RestoreFromCloudSQLRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreFromCloudSQLRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); - if (options.oneofs) - object.source = "cloudsqlBackupRunSource"; - } - return object; - }; - - /** - * Converts this RestoreFromCloudSQLRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreFromCloudSQLRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreFromCloudSQLRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreFromCloudSQLRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest"; - }; - - return RestoreFromCloudSQLRequest; - })(); - - /** - * InstanceView enum. - * @name google.cloud.alloydb.v1beta.InstanceView - * @enum {number} - * @property {number} INSTANCE_VIEW_UNSPECIFIED=0 INSTANCE_VIEW_UNSPECIFIED value - * @property {number} INSTANCE_VIEW_BASIC=1 INSTANCE_VIEW_BASIC value - * @property {number} INSTANCE_VIEW_FULL=2 INSTANCE_VIEW_FULL value - */ - v1beta.InstanceView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_VIEW_BASIC"] = 1; - values[valuesById[2] = "INSTANCE_VIEW_FULL"] = 2; - return values; - })(); - - /** - * ClusterView enum. - * @name google.cloud.alloydb.v1beta.ClusterView - * @enum {number} - * @property {number} CLUSTER_VIEW_UNSPECIFIED=0 CLUSTER_VIEW_UNSPECIFIED value - * @property {number} CLUSTER_VIEW_BASIC=1 CLUSTER_VIEW_BASIC value - * @property {number} CLUSTER_VIEW_CONTINUOUS_BACKUP=2 CLUSTER_VIEW_CONTINUOUS_BACKUP value - */ - v1beta.ClusterView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLUSTER_VIEW_BASIC"] = 1; - values[valuesById[2] = "CLUSTER_VIEW_CONTINUOUS_BACKUP"] = 2; - return values; - })(); - - /** - * DatabaseVersion enum. - * @name google.cloud.alloydb.v1beta.DatabaseVersion - * @enum {number} - * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value - * @property {number} POSTGRES_13=1 POSTGRES_13 value - * @property {number} POSTGRES_14=2 POSTGRES_14 value - * @property {number} POSTGRES_15=3 POSTGRES_15 value - * @property {number} POSTGRES_16=4 POSTGRES_16 value - * @property {number} POSTGRES_17=5 POSTGRES_17 value - * @property {number} POSTGRES_18=6 POSTGRES_18 value - */ - v1beta.DatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "POSTGRES_13"] = 1; - values[valuesById[2] = "POSTGRES_14"] = 2; - values[valuesById[3] = "POSTGRES_15"] = 3; - values[valuesById[4] = "POSTGRES_16"] = 4; - values[valuesById[5] = "POSTGRES_17"] = 5; - values[valuesById[6] = "POSTGRES_18"] = 6; - return values; - })(); - - /** - * SubscriptionType enum. - * @name google.cloud.alloydb.v1beta.SubscriptionType - * @enum {number} - * @property {number} SUBSCRIPTION_TYPE_UNSPECIFIED=0 SUBSCRIPTION_TYPE_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} TRIAL=2 TRIAL value - */ - v1beta.SubscriptionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SUBSCRIPTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "TRIAL"] = 2; - return values; - })(); - - v1beta.UserPassword = (function() { - - /** - * Properties of a UserPassword. - * @memberof google.cloud.alloydb.v1beta - * @interface IUserPassword - * @property {string|null} [user] UserPassword user - * @property {string|null} [password] UserPassword password - */ - - /** - * Constructs a new UserPassword. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a UserPassword. - * @implements IUserPassword - * @constructor - * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set - */ - function UserPassword(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UserPassword user. - * @member {string} user - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @instance - */ - UserPassword.prototype.user = ""; - - /** - * UserPassword password. - * @member {string} password - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @instance - */ - UserPassword.prototype.password = ""; - - /** - * Creates a new UserPassword instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {google.cloud.alloydb.v1beta.IUserPassword=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword instance - */ - UserPassword.create = function create(properties) { - return new UserPassword(properties); - }; - - /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserPassword.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); - return writer; - }; - - /** - * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UserPassword.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {google.cloud.alloydb.v1beta.IUserPassword} message UserPassword message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UserPassword.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UserPassword message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserPassword.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UserPassword(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.user = reader.string(); - break; - } - case 2: { - message.password = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UserPassword.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UserPassword message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UserPassword.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - return null; - }; - - /** - * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UserPassword} UserPassword - */ - UserPassword.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UserPassword) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UserPassword(); - if (object.user != null) - message.user = String(object.user); - if (object.password != null) - message.password = String(object.password); - return message; - }; - - /** - * Creates a plain object from a UserPassword message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {google.cloud.alloydb.v1beta.UserPassword} message UserPassword - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UserPassword.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.user = ""; - object.password = ""; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - return object; - }; - - /** - * Converts this UserPassword to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @instance - * @returns {Object.} JSON object - */ - UserPassword.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UserPassword - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UserPassword - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UserPassword"; - }; - - return UserPassword; - })(); - - v1beta.MigrationSource = (function() { - - /** - * Properties of a MigrationSource. - * @memberof google.cloud.alloydb.v1beta - * @interface IMigrationSource - * @property {string|null} [hostPort] MigrationSource hostPort - * @property {string|null} [referenceId] MigrationSource referenceId - * @property {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType|null} [sourceType] MigrationSource sourceType - */ - - /** - * Constructs a new MigrationSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a MigrationSource. - * @implements IMigrationSource - * @constructor - * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set - */ - function MigrationSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MigrationSource hostPort. - * @member {string} hostPort - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @instance - */ - MigrationSource.prototype.hostPort = ""; - - /** - * MigrationSource referenceId. - * @member {string} referenceId - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @instance - */ - MigrationSource.prototype.referenceId = ""; - - /** - * MigrationSource sourceType. - * @member {google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType} sourceType - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @instance - */ - MigrationSource.prototype.sourceType = 0; - - /** - * Creates a new MigrationSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {google.cloud.alloydb.v1beta.IMigrationSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource instance - */ - MigrationSource.create = function create(properties) { - return new MigrationSource(properties); - }; - - /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); - if (message.referenceId != null && Object.hasOwnProperty.call(message, "referenceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceId); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceType); - return writer; - }; - - /** - * Encodes the specified MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MigrationSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {google.cloud.alloydb.v1beta.IMigrationSource} message MigrationSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MigrationSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.hostPort = reader.string(); - break; - } - case 2: { - message.referenceId = reader.string(); - break; - } - case 3: { - message.sourceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MigrationSource message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - if (!$util.isString(message.hostPort)) - return "hostPort: string expected"; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - if (!$util.isString(message.referenceId)) - return "referenceId: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - switch (message.sourceType) { - default: - return "sourceType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.MigrationSource} MigrationSource - */ - MigrationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.MigrationSource) - return object; - var message = new $root.google.cloud.alloydb.v1beta.MigrationSource(); - if (object.hostPort != null) - message.hostPort = String(object.hostPort); - if (object.referenceId != null) - message.referenceId = String(object.referenceId); - switch (object.sourceType) { - default: - if (typeof object.sourceType === "number") { - message.sourceType = object.sourceType; - break; - } - break; - case "MIGRATION_SOURCE_TYPE_UNSPECIFIED": - case 0: - message.sourceType = 0; - break; - case "DMS": - case 1: - message.sourceType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {google.cloud.alloydb.v1beta.MigrationSource} message MigrationSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.hostPort = ""; - object.referenceId = ""; - object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; - } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) - object.hostPort = message.hostPort; - if (message.referenceId != null && message.hasOwnProperty("referenceId")) - object.referenceId = message.referenceId; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType[message.sourceType] : message.sourceType; - return object; - }; - - /** - * Converts this MigrationSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @instance - * @returns {Object.} JSON object - */ - MigrationSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MigrationSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.MigrationSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MigrationSource"; - }; - - /** - * MigrationSourceType enum. - * @name google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType - * @enum {number} - * @property {number} MIGRATION_SOURCE_TYPE_UNSPECIFIED=0 MIGRATION_SOURCE_TYPE_UNSPECIFIED value - * @property {number} DMS=1 DMS value - */ - MigrationSource.MigrationSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_SOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DMS"] = 1; - return values; - })(); - - return MigrationSource; - })(); - - v1beta.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyName = ""; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kmsKeyName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {google.cloud.alloydb.v1beta.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1beta.EncryptionInfo = (function() { - - /** - * Properties of an EncryptionInfo. - * @memberof google.cloud.alloydb.v1beta - * @interface IEncryptionInfo - * @property {google.cloud.alloydb.v1beta.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions - */ - - /** - * Constructs a new EncryptionInfo. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo - * @constructor - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set - */ - function EncryptionInfo(properties) { - this.kmsKeyVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionInfo encryptionType. - * @member {google.cloud.alloydb.v1beta.EncryptionInfo.Type} encryptionType - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.encryptionType = 0; - - /** - * EncryptionInfo kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @instance - */ - EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; - - /** - * Creates a new EncryptionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo instance - */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); - }; - - /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); - if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersions[i]); - return writer; - }; - - /** - * Encodes the specified EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.EncryptionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IEncryptionInfo} message EncryptionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionType = reader.int32(); - break; - } - case 2: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - switch (message.encryptionType) { - default: - return "encryptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { - if (!Array.isArray(message.kmsKeyVersions)) - return "kmsKeyVersions: array expected"; - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - if (!$util.isString(message.kmsKeyVersions[i])) - return "kmsKeyVersions: string[] expected"; - } - return null; - }; - - /** - * Creates an EncryptionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.EncryptionInfo} EncryptionInfo - */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.EncryptionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1beta.EncryptionInfo(); - switch (object.encryptionType) { - default: - if (typeof object.encryptionType === "number") { - message.encryptionType = object.encryptionType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.encryptionType = 0; - break; - case "GOOGLE_DEFAULT_ENCRYPTION": - case 1: - message.encryptionType = 1; - break; - case "CUSTOMER_MANAGED_ENCRYPTION": - case 2: - message.encryptionType = 2; - break; - } - if (object.kmsKeyVersions) { - if (!Array.isArray(object.kmsKeyVersions)) - throw TypeError(".google.cloud.alloydb.v1beta.EncryptionInfo.kmsKeyVersions: array expected"); - message.kmsKeyVersions = []; - for (var i = 0; i < object.kmsKeyVersions.length; ++i) - message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); - } - return message; - }; - - /** - * Creates a plain object from an EncryptionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {google.cloud.alloydb.v1beta.EncryptionInfo} message EncryptionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kmsKeyVersions = []; - if (options.defaults) - object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) - object.encryptionType = options.enums === String ? $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.cloud.alloydb.v1beta.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.kmsKeyVersions && message.kmsKeyVersions.length) { - object.kmsKeyVersions = []; - for (var j = 0; j < message.kmsKeyVersions.length; ++j) - object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; - } - return object; - }; - - /** - * Converts this EncryptionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @instance - * @returns {Object.} JSON object - */ - EncryptionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.EncryptionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.EncryptionInfo"; - }; - - /** - * Type enum. - * @name google.cloud.alloydb.v1beta.EncryptionInfo.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} GOOGLE_DEFAULT_ENCRYPTION=1 GOOGLE_DEFAULT_ENCRYPTION value - * @property {number} CUSTOMER_MANAGED_ENCRYPTION=2 CUSTOMER_MANAGED_ENCRYPTION value - */ - EncryptionInfo.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_DEFAULT_ENCRYPTION"] = 1; - values[valuesById[2] = "CUSTOMER_MANAGED_ENCRYPTION"] = 2; - return values; - })(); - - return EncryptionInfo; - })(); - - v1beta.SslConfig = (function() { - - /** - * Properties of a SslConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface ISslConfig - * @property {google.cloud.alloydb.v1beta.SslConfig.SslMode|null} [sslMode] SslConfig sslMode - * @property {google.cloud.alloydb.v1beta.SslConfig.CaSource|null} [caSource] SslConfig caSource - */ - - /** - * Constructs a new SslConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SslConfig. - * @implements ISslConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set - */ - function SslConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SslConfig sslMode. - * @member {google.cloud.alloydb.v1beta.SslConfig.SslMode} sslMode - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @instance - */ - SslConfig.prototype.sslMode = 0; - - /** - * SslConfig caSource. - * @member {google.cloud.alloydb.v1beta.SslConfig.CaSource} caSource - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @instance - */ - SslConfig.prototype.caSource = 0; - - /** - * Creates a new SslConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {google.cloud.alloydb.v1beta.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig instance - */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); - }; - - /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SslConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslMode); - if (message.caSource != null && Object.hasOwnProperty.call(message, "caSource")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.caSource); - return writer; - }; - - /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SslConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {google.cloud.alloydb.v1beta.ISslConfig} message SslConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SslConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SslConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SslConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sslMode = reader.int32(); - break; - } - case 2: { - message.caSource = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SslConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SslConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - switch (message.sslMode) { - default: - return "sslMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.caSource != null && message.hasOwnProperty("caSource")) - switch (message.caSource) { - default: - return "caSource: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SslConfig} SslConfig - */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SslConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SslConfig(); - switch (object.sslMode) { - default: - if (typeof object.sslMode === "number") { - message.sslMode = object.sslMode; - break; - } - break; - case "SSL_MODE_UNSPECIFIED": - case 0: - message.sslMode = 0; - break; - case "SSL_MODE_ALLOW": - case 1: - message.sslMode = 1; - break; - case "SSL_MODE_REQUIRE": - case 2: - message.sslMode = 2; - break; - case "SSL_MODE_VERIFY_CA": - case 3: - message.sslMode = 3; - break; - case "ALLOW_UNENCRYPTED_AND_ENCRYPTED": - case 4: - message.sslMode = 4; - break; - case "ENCRYPTED_ONLY": - case 5: - message.sslMode = 5; - break; - } - switch (object.caSource) { - default: - if (typeof object.caSource === "number") { - message.caSource = object.caSource; - break; - } - break; - case "CA_SOURCE_UNSPECIFIED": - case 0: - message.caSource = 0; - break; - case "CA_SOURCE_MANAGED": - case 1: - message.caSource = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {google.cloud.alloydb.v1beta.SslConfig} message SslConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SslConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; - object.caSource = options.enums === String ? "CA_SOURCE_UNSPECIFIED" : 0; - } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) - object.sslMode = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.alloydb.v1beta.SslConfig.SslMode[message.sslMode] : message.sslMode; - if (message.caSource != null && message.hasOwnProperty("caSource")) - object.caSource = options.enums === String ? $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] === undefined ? message.caSource : $root.google.cloud.alloydb.v1beta.SslConfig.CaSource[message.caSource] : message.caSource; - return object; - }; - - /** - * Converts this SslConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @instance - * @returns {Object.} JSON object - */ - SslConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SslConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SslConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SslConfig"; - }; - - /** - * SslMode enum. - * @name google.cloud.alloydb.v1beta.SslConfig.SslMode - * @enum {number} - * @property {number} SSL_MODE_UNSPECIFIED=0 SSL_MODE_UNSPECIFIED value - * @property {number} SSL_MODE_ALLOW=1 SSL_MODE_ALLOW value - * @property {number} SSL_MODE_REQUIRE=2 SSL_MODE_REQUIRE value - * @property {number} SSL_MODE_VERIFY_CA=3 SSL_MODE_VERIFY_CA value - * @property {number} ALLOW_UNENCRYPTED_AND_ENCRYPTED=4 ALLOW_UNENCRYPTED_AND_ENCRYPTED value - * @property {number} ENCRYPTED_ONLY=5 ENCRYPTED_ONLY value - */ - SslConfig.SslMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSL_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSL_MODE_ALLOW"] = 1; - values[valuesById[2] = "SSL_MODE_REQUIRE"] = 2; - values[valuesById[3] = "SSL_MODE_VERIFY_CA"] = 3; - values[valuesById[4] = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"] = 4; - values[valuesById[5] = "ENCRYPTED_ONLY"] = 5; - return values; - })(); - - /** - * CaSource enum. - * @name google.cloud.alloydb.v1beta.SslConfig.CaSource - * @enum {number} - * @property {number} CA_SOURCE_UNSPECIFIED=0 CA_SOURCE_UNSPECIFIED value - * @property {number} CA_SOURCE_MANAGED=1 CA_SOURCE_MANAGED value - */ - SslConfig.CaSource = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CA_SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CA_SOURCE_MANAGED"] = 1; - return values; - })(); - - return SslConfig; - })(); - - v1beta.AutomatedBackupPolicy = (function() { - - /** - * Properties of an AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1beta - * @interface IAutomatedBackupPolicy - * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null} [weeklySchedule] AutomatedBackupPolicy weeklySchedule - * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null} [timeBasedRetention] AutomatedBackupPolicy timeBasedRetention - * @property {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null} [quantityBasedRetention] AutomatedBackupPolicy quantityBasedRetention - * @property {boolean|null} [enabled] AutomatedBackupPolicy enabled - * @property {google.protobuf.IDuration|null} [backupWindow] AutomatedBackupPolicy backupWindow - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] AutomatedBackupPolicy encryptionConfig - * @property {string|null} [location] AutomatedBackupPolicy location - * @property {Object.|null} [labels] AutomatedBackupPolicy labels - */ - - /** - * Constructs a new AutomatedBackupPolicy. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an AutomatedBackupPolicy. - * @implements IAutomatedBackupPolicy - * @constructor - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set - */ - function AutomatedBackupPolicy(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutomatedBackupPolicy weeklySchedule. - * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule|null|undefined} weeklySchedule - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.weeklySchedule = null; - - /** - * AutomatedBackupPolicy timeBasedRetention. - * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention|null|undefined} timeBasedRetention - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.timeBasedRetention = null; - - /** - * AutomatedBackupPolicy quantityBasedRetention. - * @member {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention|null|undefined} quantityBasedRetention - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.quantityBasedRetention = null; - - /** - * AutomatedBackupPolicy enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.enabled = null; - - /** - * AutomatedBackupPolicy backupWindow. - * @member {google.protobuf.IDuration|null|undefined} backupWindow - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.backupWindow = null; - - /** - * AutomatedBackupPolicy encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.encryptionConfig = null; - - /** - * AutomatedBackupPolicy location. - * @member {string} location - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.location = ""; - - /** - * AutomatedBackupPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - AutomatedBackupPolicy.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutomatedBackupPolicy schedule. - * @member {"weeklySchedule"|undefined} schedule - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { - get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AutomatedBackupPolicy retention. - * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { - get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy instance - */ - AutomatedBackupPolicy.create = function create(properties) { - return new AutomatedBackupPolicy(properties); - }; - - /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutomatedBackupPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.encode(message.weeklySchedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) - $root.google.protobuf.Duration.encode(message.backupWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timeBasedRetention != null && Object.hasOwnProperty.call(message, "timeBasedRetention")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.encode(message.timeBasedRetention, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.quantityBasedRetention != null && Object.hasOwnProperty.call(message, "quantityBasedRetention")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.encode(message.quantityBasedRetention, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutomatedBackupPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.decode(reader, reader.uint32()); - break; - } - case 4: { - message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.decode(reader, reader.uint32()); - break; - } - case 5: { - message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.decode(reader, reader.uint32()); - break; - } - case 1: { - message.enabled = reader.bool(); - break; - } - case 3: { - message.backupWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 8: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.location = reader.string(); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutomatedBackupPolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutomatedBackupPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - properties.schedule = 1; - { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify(message.weeklySchedule); - if (error) - return "weeklySchedule." + error; - } - } - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify(message.timeBasedRetention); - if (error) - return "timeBasedRetention." + error; - } - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - if (properties.retention === 1) - return "retention: multiple values"; - properties.retention = 1; - { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify(message.quantityBasedRetention); - if (error) - return "quantityBasedRetention." + error; - } - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { - var error = $root.google.protobuf.Duration.verify(message.backupWindow); - if (error) - return "backupWindow." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an AutomatedBackupPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} AutomatedBackupPolicy - */ - AutomatedBackupPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy(); - if (object.weeklySchedule != null) { - if (typeof object.weeklySchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.weeklySchedule: object expected"); - message.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.fromObject(object.weeklySchedule); - } - if (object.timeBasedRetention != null) { - if (typeof object.timeBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.timeBasedRetention: object expected"); - message.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.fromObject(object.timeBasedRetention); - } - if (object.quantityBasedRetention != null) { - if (typeof object.quantityBasedRetention !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.quantityBasedRetention: object expected"); - message.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.fromObject(object.quantityBasedRetention); - } - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.backupWindow != null) { - if (typeof object.backupWindow !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.backupWindow: object expected"); - message.backupWindow = $root.google.protobuf.Duration.fromObject(object.backupWindow); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.location != null) - message.location = String(object.location); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an AutomatedBackupPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy} message AutomatedBackupPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutomatedBackupPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.backupWindow = null; - object.location = ""; - object.encryptionConfig = null; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { - object.weeklySchedule = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.toObject(message.weeklySchedule, options); - if (options.oneofs) - object.schedule = "weeklySchedule"; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) - object.backupWindow = $root.google.protobuf.Duration.toObject(message.backupWindow, options); - if (message.timeBasedRetention != null && message.hasOwnProperty("timeBasedRetention")) { - object.timeBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.toObject(message.timeBasedRetention, options); - if (options.oneofs) - object.retention = "timeBasedRetention"; - } - if (message.quantityBasedRetention != null && message.hasOwnProperty("quantityBasedRetention")) { - object.quantityBasedRetention = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.toObject(message.quantityBasedRetention, options); - if (options.oneofs) - object.retention = "quantityBasedRetention"; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this AutomatedBackupPolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - * @returns {Object.} JSON object - */ - AutomatedBackupPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutomatedBackupPolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy"; - }; - - AutomatedBackupPolicy.WeeklySchedule = (function() { - - /** - * Properties of a WeeklySchedule. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @interface IWeeklySchedule - * @property {Array.|null} [startTimes] WeeklySchedule startTimes - * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek - */ - - /** - * Constructs a new WeeklySchedule. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @classdesc Represents a WeeklySchedule. - * @implements IWeeklySchedule - * @constructor - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - */ - function WeeklySchedule(properties) { - this.startTimes = []; - this.daysOfWeek = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeeklySchedule startTimes. - * @member {Array.} startTimes - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.startTimes = $util.emptyArray; - - /** - * WeeklySchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; - - /** - * Creates a new WeeklySchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule instance - */ - WeeklySchedule.create = function create(properties) { - return new WeeklySchedule(properties); - }; - - /** - * Encodes the specified WeeklySchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTimes != null && message.startTimes.length) - for (var i = 0; i < message.startTimes.length; ++i) - $root.google.type.TimeOfDay.encode(message.startTimes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified WeeklySchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IWeeklySchedule} message WeeklySchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeeklySchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.startTimes && message.startTimes.length)) - message.startTimes = []; - message.startTimes.push($root.google.type.TimeOfDay.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.daysOfWeek && message.daysOfWeek.length)) - message.daysOfWeek = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfWeek.push(reader.int32()); - } else - message.daysOfWeek.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeeklySchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeeklySchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeeklySchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeeklySchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTimes != null && message.hasOwnProperty("startTimes")) { - if (!Array.isArray(message.startTimes)) - return "startTimes: array expected"; - for (var i = 0; i < message.startTimes.length; ++i) { - var error = $root.google.type.TimeOfDay.verify(message.startTimes[i]); - if (error) - return "startTimes." + error; - } - } - if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { - if (!Array.isArray(message.daysOfWeek)) - return "daysOfWeek: array expected"; - for (var i = 0; i < message.daysOfWeek.length; ++i) - switch (message.daysOfWeek[i]) { - default: - return "daysOfWeek: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; - - /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule - */ - WeeklySchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule(); - if (object.startTimes) { - if (!Array.isArray(object.startTimes)) - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: array expected"); - message.startTimes = []; - for (var i = 0; i < object.startTimes.length; ++i) { - if (typeof object.startTimes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.startTimes: object expected"); - message.startTimes[i] = $root.google.type.TimeOfDay.fromObject(object.startTimes[i]); - } - } - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - switch (object.daysOfWeek[i]) { - default: - if (typeof object.daysOfWeek[i] === "number") { - message.daysOfWeek[i] = object.daysOfWeek[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.daysOfWeek[i] = 0; - break; - case "MONDAY": - case 1: - message.daysOfWeek[i] = 1; - break; - case "TUESDAY": - case 2: - message.daysOfWeek[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.daysOfWeek[i] = 3; - break; - case "THURSDAY": - case 4: - message.daysOfWeek[i] = 4; - break; - case "FRIDAY": - case 5: - message.daysOfWeek[i] = 5; - break; - case "SATURDAY": - case 6: - message.daysOfWeek[i] = 6; - break; - case "SUNDAY": - case 7: - message.daysOfWeek[i] = 7; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a WeeklySchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeeklySchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.startTimes = []; - object.daysOfWeek = []; - } - if (message.startTimes && message.startTimes.length) { - object.startTimes = []; - for (var j = 0; j < message.startTimes.length; ++j) - object.startTimes[j] = $root.google.type.TimeOfDay.toObject(message.startTimes[j], options); - } - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; - } - return object; - }; - - /** - * Converts this WeeklySchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @instance - * @returns {Object.} JSON object - */ - WeeklySchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WeeklySchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule"; - }; - - return WeeklySchedule; - })(); - - AutomatedBackupPolicy.TimeBasedRetention = (function() { - - /** - * Properties of a TimeBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @interface ITimeBasedRetention - * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod - */ - - /** - * Constructs a new TimeBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @classdesc Represents a TimeBasedRetention. - * @implements ITimeBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - */ - function TimeBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimeBasedRetention retentionPeriod. - * @member {google.protobuf.IDuration|null|undefined} retentionPeriod - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @instance - */ - TimeBasedRetention.prototype.retentionPeriod = null; - - /** - * Creates a new TimeBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention instance - */ - TimeBasedRetention.create = function create(properties) { - return new TimeBasedRetention(properties); - }; - - /** - * Encodes the specified TimeBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionPeriod != null && Object.hasOwnProperty.call(message, "retentionPeriod")) - $root.google.protobuf.Duration.encode(message.retentionPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TimeBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.ITimeBasedRetention} message TimeBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.retentionPeriod); - if (error) - return "retentionPeriod." + error; - } - return null; - }; - - /** - * Creates a TimeBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} TimeBasedRetention - */ - TimeBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention(); - if (object.retentionPeriod != null) { - if (typeof object.retentionPeriod !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention.retentionPeriod: object expected"); - message.retentionPeriod = $root.google.protobuf.Duration.fromObject(object.retentionPeriod); - } - return message; - }; - - /** - * Creates a plain object from a TimeBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention} message TimeBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.retentionPeriod = null; - if (message.retentionPeriod != null && message.hasOwnProperty("retentionPeriod")) - object.retentionPeriod = $root.google.protobuf.Duration.toObject(message.retentionPeriod, options); - return object; - }; - - /** - * Converts this TimeBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @instance - * @returns {Object.} JSON object - */ - TimeBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention"; - }; - - return TimeBasedRetention; - })(); - - AutomatedBackupPolicy.QuantityBasedRetention = (function() { - - /** - * Properties of a QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @interface IQuantityBasedRetention - * @property {number|null} [count] QuantityBasedRetention count - */ - - /** - * Constructs a new QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @classdesc Represents a QuantityBasedRetention. - * @implements IQuantityBasedRetention - * @constructor - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - */ - function QuantityBasedRetention(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedRetention count. - * @member {number} count - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - */ - QuantityBasedRetention.prototype.count = 0; - - /** - * Creates a new QuantityBasedRetention instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention instance - */ - QuantityBasedRetention.create = function create(properties) { - return new QuantityBasedRetention(properties); - }; - - /** - * Encodes the specified QuantityBasedRetention message. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - return writer; - }; - - /** - * Encodes the specified QuantityBasedRetention message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.IQuantityBasedRetention} message QuantityBasedRetention message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedRetention.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedRetention message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedRetention.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedRetention message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedRetention.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedRetention message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention - */ - QuantityBasedRetention.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention) - return object; - var message = new $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention(); - if (object.count != null) - message.count = object.count | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedRetention.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this QuantityBasedRetention to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedRetention.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedRetention - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention"; - }; - - return QuantityBasedRetention; - })(); - - return AutomatedBackupPolicy; - })(); - - v1beta.ContinuousBackupConfig = (function() { - - /** - * Properties of a ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IContinuousBackupConfig - * @property {boolean|null} [enabled] ContinuousBackupConfig enabled - * @property {number|null} [recoveryWindowDays] ContinuousBackupConfig recoveryWindowDays - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] ContinuousBackupConfig encryptionConfig - */ - - /** - * Constructs a new ContinuousBackupConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ContinuousBackupConfig. - * @implements IContinuousBackupConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set - */ - function ContinuousBackupConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.enabled = null; - - /** - * ContinuousBackupConfig recoveryWindowDays. - * @member {number} recoveryWindowDays - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.recoveryWindowDays = 0; - - /** - * ContinuousBackupConfig encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @instance - */ - ContinuousBackupConfig.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ContinuousBackupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig instance - */ - ContinuousBackupConfig.create = function create(properties) { - return new ContinuousBackupConfig(properties); - }; - - /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.recoveryWindowDays != null && Object.hasOwnProperty.call(message, "recoveryWindowDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recoveryWindowDays); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 4: { - message.recoveryWindowDays = reader.int32(); - break; - } - case 3: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - if (!$util.isInteger(message.recoveryWindowDays)) - return "recoveryWindowDays: integer expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupConfig} ContinuousBackupConfig - */ - ContinuousBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.recoveryWindowDays != null) - message.recoveryWindowDays = object.recoveryWindowDays | 0; - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {google.cloud.alloydb.v1beta.ContinuousBackupConfig} message ContinuousBackupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.encryptionConfig = null; - object.recoveryWindowDays = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.recoveryWindowDays != null && message.hasOwnProperty("recoveryWindowDays")) - object.recoveryWindowDays = message.recoveryWindowDays; - return object; - }; - - /** - * Converts this ContinuousBackupConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupConfig"; - }; - - return ContinuousBackupConfig; - })(); - - v1beta.ContinuousBackupInfo = (function() { - - /** - * Properties of a ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1beta - * @interface IContinuousBackupInfo - * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] ContinuousBackupInfo encryptionInfo - * @property {google.protobuf.ITimestamp|null} [enabledTime] ContinuousBackupInfo enabledTime - * @property {Array.|null} [schedule] ContinuousBackupInfo schedule - * @property {google.protobuf.ITimestamp|null} [earliestRestorableTime] ContinuousBackupInfo earliestRestorableTime - */ - - /** - * Constructs a new ContinuousBackupInfo. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ContinuousBackupInfo. - * @implements IContinuousBackupInfo - * @constructor - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set - */ - function ContinuousBackupInfo(properties) { - this.schedule = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupInfo encryptionInfo. - * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.encryptionInfo = null; - - /** - * ContinuousBackupInfo enabledTime. - * @member {google.protobuf.ITimestamp|null|undefined} enabledTime - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.enabledTime = null; - - /** - * ContinuousBackupInfo schedule. - * @member {Array.} schedule - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.schedule = $util.emptyArray; - - /** - * ContinuousBackupInfo earliestRestorableTime. - * @member {google.protobuf.ITimestamp|null|undefined} earliestRestorableTime - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @instance - */ - ContinuousBackupInfo.prototype.earliestRestorableTime = null; - - /** - * Creates a new ContinuousBackupInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo instance - */ - ContinuousBackupInfo.create = function create(properties) { - return new ContinuousBackupInfo(properties); - }; - - /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enabledTime != null && Object.hasOwnProperty.call(message, "enabledTime")) - $root.google.protobuf.Timestamp.encode(message.enabledTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.schedule != null && message.schedule.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.schedule.length; ++i) - writer.int32(message.schedule[i]); - writer.ldelim(); - } - if (message.earliestRestorableTime != null && Object.hasOwnProperty.call(message, "earliestRestorableTime")) - $root.google.protobuf.Timestamp.encode(message.earliestRestorableTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 2: { - message.enabledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.schedule && message.schedule.length)) - message.schedule = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.schedule.push(reader.int32()); - } else - message.schedule.push(reader.int32()); - break; - } - case 4: { - message.earliestRestorableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.enabledTime); - if (error) - return "enabledTime." + error; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - if (!Array.isArray(message.schedule)) - return "schedule: array expected"; - for (var i = 0; i < message.schedule.length; ++i) - switch (message.schedule[i]) { - default: - return "schedule: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.earliestRestorableTime); - if (error) - return "earliestRestorableTime." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupInfo} ContinuousBackupInfo - */ - ContinuousBackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo(); - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.enabledTime != null) { - if (typeof object.enabledTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.enabledTime: object expected"); - message.enabledTime = $root.google.protobuf.Timestamp.fromObject(object.enabledTime); - } - if (object.schedule) { - if (!Array.isArray(object.schedule)) - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.schedule: array expected"); - message.schedule = []; - for (var i = 0; i < object.schedule.length; ++i) - switch (object.schedule[i]) { - default: - if (typeof object.schedule[i] === "number") { - message.schedule[i] = object.schedule[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.schedule[i] = 0; - break; - case "MONDAY": - case 1: - message.schedule[i] = 1; - break; - case "TUESDAY": - case 2: - message.schedule[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.schedule[i] = 3; - break; - case "THURSDAY": - case 4: - message.schedule[i] = 4; - break; - case "FRIDAY": - case 5: - message.schedule[i] = 5; - break; - case "SATURDAY": - case 6: - message.schedule[i] = 6; - break; - case "SUNDAY": - case 7: - message.schedule[i] = 7; - break; - } - } - if (object.earliestRestorableTime != null) { - if (typeof object.earliestRestorableTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupInfo.earliestRestorableTime: object expected"); - message.earliestRestorableTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRestorableTime); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {google.cloud.alloydb.v1beta.ContinuousBackupInfo} message ContinuousBackupInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schedule = []; - if (options.defaults) { - object.encryptionInfo = null; - object.enabledTime = null; - object.earliestRestorableTime = null; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.enabledTime != null && message.hasOwnProperty("enabledTime")) - object.enabledTime = $root.google.protobuf.Timestamp.toObject(message.enabledTime, options); - if (message.schedule && message.schedule.length) { - object.schedule = []; - for (var j = 0; j < message.schedule.length; ++j) - object.schedule[j] = options.enums === String ? $root.google.type.DayOfWeek[message.schedule[j]] === undefined ? message.schedule[j] : $root.google.type.DayOfWeek[message.schedule[j]] : message.schedule[j]; - } - if (message.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) - object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); - return object; - }; - - /** - * Converts this ContinuousBackupInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupInfo"; - }; - - return ContinuousBackupInfo; - })(); - - v1beta.BackupSource = (function() { - - /** - * Properties of a BackupSource. - * @memberof google.cloud.alloydb.v1beta - * @interface IBackupSource - * @property {string|null} [backupUid] BackupSource backupUid - * @property {string|null} [backupName] BackupSource backupName - */ - - /** - * Constructs a new BackupSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BackupSource. - * @implements IBackupSource - * @constructor - * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set - */ - function BackupSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @instance - */ - BackupSource.prototype.backupUid = ""; - - /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @instance - */ - BackupSource.prototype.backupName = ""; - - /** - * Creates a new BackupSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {google.cloud.alloydb.v1beta.IBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource instance - */ - BackupSource.create = function create(properties) { - return new BackupSource(properties); - }; - - /** - * Encodes the specified BackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupName != null && Object.hasOwnProperty.call(message, "backupName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupName); - if (message.backupUid != null && Object.hasOwnProperty.call(message, "backupUid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupUid); - return writer; - }; - - /** - * Encodes the specified BackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BackupSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {google.cloud.alloydb.v1beta.IBackupSource} message BackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BackupSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.backupUid = reader.string(); - break; - } - case 1: { - message.backupName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupSource message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - if (!$util.isString(message.backupUid)) - return "backupUid: string expected"; - if (message.backupName != null && message.hasOwnProperty("backupName")) - if (!$util.isString(message.backupName)) - return "backupName: string expected"; - return null; - }; - - /** - * Creates a BackupSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BackupSource} BackupSource - */ - BackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BackupSource) - return object; - var message = new $root.google.cloud.alloydb.v1beta.BackupSource(); - if (object.backupUid != null) - message.backupUid = String(object.backupUid); - if (object.backupName != null) - message.backupName = String(object.backupName); - return message; - }; - - /** - * Creates a plain object from a BackupSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {google.cloud.alloydb.v1beta.BackupSource} message BackupSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupName = ""; - object.backupUid = ""; - } - if (message.backupName != null && message.hasOwnProperty("backupName")) - object.backupName = message.backupName; - if (message.backupUid != null && message.hasOwnProperty("backupUid")) - object.backupUid = message.backupUid; - return object; - }; - - /** - * Converts this BackupSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @instance - * @returns {Object.} JSON object - */ - BackupSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BackupSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BackupSource"; - }; - - return BackupSource; - })(); - - v1beta.ContinuousBackupSource = (function() { - - /** - * Properties of a ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1beta - * @interface IContinuousBackupSource - * @property {string|null} [cluster] ContinuousBackupSource cluster - * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime - */ - - /** - * Constructs a new ContinuousBackupSource. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ContinuousBackupSource. - * @implements IContinuousBackupSource - * @constructor - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set - */ - function ContinuousBackupSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContinuousBackupSource cluster. - * @member {string} cluster - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @instance - */ - ContinuousBackupSource.prototype.cluster = ""; - - /** - * ContinuousBackupSource pointInTime. - * @member {google.protobuf.ITimestamp|null|undefined} pointInTime - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @instance - */ - ContinuousBackupSource.prototype.pointInTime = null; - - /** - * Creates a new ContinuousBackupSource instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource instance - */ - ContinuousBackupSource.create = function create(properties) { - return new ContinuousBackupSource(properties); - }; - - /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); - if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ContinuousBackupSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1beta.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cluster = reader.string(); - break; - } - case 2: { - message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContinuousBackupSource message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContinuousBackupSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) - if (!$util.isString(message.cluster)) - return "cluster: string expected"; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.pointInTime); - if (error) - return "pointInTime." + error; - } - return null; - }; - - /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ContinuousBackupSource} ContinuousBackupSource - */ - ContinuousBackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ContinuousBackupSource) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ContinuousBackupSource(); - if (object.cluster != null) - message.cluster = String(object.cluster); - if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ContinuousBackupSource.pointInTime: object expected"); - message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime); - } - return message; - }; - - /** - * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {google.cloud.alloydb.v1beta.ContinuousBackupSource} message ContinuousBackupSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContinuousBackupSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cluster = ""; - object.pointInTime = null; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = message.cluster; - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - return object; - }; - - /** - * Converts this ContinuousBackupSource to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @instance - * @returns {Object.} JSON object - */ - ContinuousBackupSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContinuousBackupSource - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ContinuousBackupSource"; - }; - - return ContinuousBackupSource; - })(); - - v1beta.MaintenanceUpdatePolicy = (function() { - - /** - * Properties of a MaintenanceUpdatePolicy. - * @memberof google.cloud.alloydb.v1beta - * @interface IMaintenanceUpdatePolicy - * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows - * @property {Array.|null} [denyMaintenancePeriods] MaintenanceUpdatePolicy denyMaintenancePeriods - */ - - /** - * Constructs a new MaintenanceUpdatePolicy. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a MaintenanceUpdatePolicy. - * @implements IMaintenanceUpdatePolicy - * @constructor - * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy=} [properties] Properties to set - */ - function MaintenanceUpdatePolicy(properties) { - this.maintenanceWindows = []; - this.denyMaintenancePeriods = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceUpdatePolicy maintenanceWindows. - * @member {Array.} maintenanceWindows - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @instance - */ - MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; - - /** - * MaintenanceUpdatePolicy denyMaintenancePeriods. - * @member {Array.} denyMaintenancePeriods - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @instance - */ - MaintenanceUpdatePolicy.prototype.denyMaintenancePeriods = $util.emptyArray; - - /** - * Creates a new MaintenanceUpdatePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance - */ - MaintenanceUpdatePolicy.create = function create(properties) { - return new MaintenanceUpdatePolicy(properties); - }; - - /** - * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceUpdatePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maintenanceWindows != null && message.maintenanceWindows.length) - for (var i = 0; i < message.maintenanceWindows.length; ++i) - $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.encode(message.maintenanceWindows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) - for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) - $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy} message MaintenanceUpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceUpdatePolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.maintenanceWindows && message.maintenanceWindows.length)) - message.maintenanceWindows = []; - message.maintenanceWindows.push($root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.denyMaintenancePeriods && message.denyMaintenancePeriods.length)) - message.denyMaintenancePeriods = []; - message.denyMaintenancePeriods.push($root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceUpdatePolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceUpdatePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maintenanceWindows != null && message.hasOwnProperty("maintenanceWindows")) { - if (!Array.isArray(message.maintenanceWindows)) - return "maintenanceWindows: array expected"; - for (var i = 0; i < message.maintenanceWindows.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify(message.maintenanceWindows[i]); - if (error) - return "maintenanceWindows." + error; - } - } - if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { - if (!Array.isArray(message.denyMaintenancePeriods)) - return "denyMaintenancePeriods: array expected"; - for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify(message.denyMaintenancePeriods[i]); - if (error) - return "denyMaintenancePeriods." + error; - } - } - return null; - }; - - /** - * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy - */ - MaintenanceUpdatePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy) - return object; - var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy(); - if (object.maintenanceWindows) { - if (!Array.isArray(object.maintenanceWindows)) - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.maintenanceWindows: array expected"); - message.maintenanceWindows = []; - for (var i = 0; i < object.maintenanceWindows.length; ++i) { - if (typeof object.maintenanceWindows[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.maintenanceWindows: object expected"); - message.maintenanceWindows[i] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.fromObject(object.maintenanceWindows[i]); - } - } - if (object.denyMaintenancePeriods) { - if (!Array.isArray(object.denyMaintenancePeriods)) - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.denyMaintenancePeriods: array expected"); - message.denyMaintenancePeriods = []; - for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { - if (typeof object.denyMaintenancePeriods[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.denyMaintenancePeriods: object expected"); - message.denyMaintenancePeriods[i] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceUpdatePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.maintenanceWindows = []; - object.denyMaintenancePeriods = []; - } - if (message.maintenanceWindows && message.maintenanceWindows.length) { - object.maintenanceWindows = []; - for (var j = 0; j < message.maintenanceWindows.length; ++j) - object.maintenanceWindows[j] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.toObject(message.maintenanceWindows[j], options); - } - if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { - object.denyMaintenancePeriods = []; - for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) - object.denyMaintenancePeriods[j] = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); - } - return object; - }; - - /** - * Converts this MaintenanceUpdatePolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @instance - * @returns {Object.} JSON object - */ - MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceUpdatePolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy"; - }; - - MaintenanceUpdatePolicy.MaintenanceWindow = (function() { - - /** - * Properties of a MaintenanceWindow. - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @interface IMaintenanceWindow - * @property {google.type.DayOfWeek|null} [day] MaintenanceWindow day - * @property {google.type.ITimeOfDay|null} [startTime] MaintenanceWindow startTime - */ - - /** - * Constructs a new MaintenanceWindow. - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @classdesc Represents a MaintenanceWindow. - * @implements IMaintenanceWindow - * @constructor - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set - */ - function MaintenanceWindow(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceWindow day. - * @member {google.type.DayOfWeek} day - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.day = 0; - - /** - * MaintenanceWindow startTime. - * @member {google.type.ITimeOfDay|null|undefined} startTime - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.startTime = null; - - /** - * Creates a new MaintenanceWindow instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow instance - */ - MaintenanceWindow.create = function create(properties) { - return new MaintenanceWindow(properties); - }; - - /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceWindow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.day = reader.int32(); - break; - } - case 2: { - message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceWindow message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceWindow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.day != null && message.hasOwnProperty("day")) - switch (message.day) { - default: - return "day: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.type.TimeOfDay.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} MaintenanceWindow - */ - MaintenanceWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow) - return object; - var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow(); - switch (object.day) { - default: - if (typeof object.day === "number") { - message.day = object.day; - break; - } - break; - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.day = 0; - break; - case "MONDAY": - case 1: - message.day = 1; - break; - case "TUESDAY": - case 2: - message.day = 2; - break; - case "WEDNESDAY": - case 3: - message.day = 3; - break; - case "THURSDAY": - case 4: - message.day = 4; - break; - case "FRIDAY": - case 5: - message.day = 5; - break; - case "SATURDAY": - case 6: - message.day = 6; - break; - case "SUNDAY": - case 7: - message.day = 7; - break; - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow.startTime: object expected"); - message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow} message MaintenanceWindow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceWindow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; - object.startTime = null; - } - if (message.day != null && message.hasOwnProperty("day")) - object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this MaintenanceWindow to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @instance - * @returns {Object.} JSON object - */ - MaintenanceWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceWindow - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow"; - }; - - return MaintenanceWindow; - })(); - - MaintenanceUpdatePolicy.DenyMaintenancePeriod = (function() { - - /** - * Properties of a DenyMaintenancePeriod. - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @interface IDenyMaintenancePeriod - * @property {google.type.IDate|null} [startDate] DenyMaintenancePeriod startDate - * @property {google.type.IDate|null} [endDate] DenyMaintenancePeriod endDate - * @property {google.type.ITimeOfDay|null} [time] DenyMaintenancePeriod time - */ - - /** - * Constructs a new DenyMaintenancePeriod. - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy - * @classdesc Represents a DenyMaintenancePeriod. - * @implements IDenyMaintenancePeriod - * @constructor - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set - */ - function DenyMaintenancePeriod(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenyMaintenancePeriod startDate. - * @member {google.type.IDate|null|undefined} startDate - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.startDate = null; - - /** - * DenyMaintenancePeriod endDate. - * @member {google.type.IDate|null|undefined} endDate - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.endDate = null; - - /** - * DenyMaintenancePeriod time. - * @member {google.type.ITimeOfDay|null|undefined} time - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - */ - DenyMaintenancePeriod.prototype.time = null; - - /** - * Creates a new DenyMaintenancePeriod instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod instance - */ - DenyMaintenancePeriod.create = function create(properties) { - return new DenyMaintenancePeriod(properties); - }; - - /** - * Encodes the specified DenyMaintenancePeriod message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenyMaintenancePeriod.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) - $root.google.type.Date.encode(message.startDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) - $root.google.type.Date.encode(message.endDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.type.TimeOfDay.encode(message.time, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DenyMaintenancePeriod message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.IDenyMaintenancePeriod} message DenyMaintenancePeriod message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenyMaintenancePeriod.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 3: { - message.time = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenyMaintenancePeriod message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenyMaintenancePeriod.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenyMaintenancePeriod message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenyMaintenancePeriod.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startDate != null && message.hasOwnProperty("startDate")) { - var error = $root.google.type.Date.verify(message.startDate); - if (error) - return "startDate." + error; - } - if (message.endDate != null && message.hasOwnProperty("endDate")) { - var error = $root.google.type.Date.verify(message.endDate); - if (error) - return "endDate." + error; - } - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.type.TimeOfDay.verify(message.time); - if (error) - return "time." + error; - } - return null; - }; - - /** - * Creates a DenyMaintenancePeriod message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} DenyMaintenancePeriod - */ - DenyMaintenancePeriod.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod) - return object; - var message = new $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod(); - if (object.startDate != null) { - if (typeof object.startDate !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.startDate: object expected"); - message.startDate = $root.google.type.Date.fromObject(object.startDate); - } - if (object.endDate != null) { - if (typeof object.endDate !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.endDate: object expected"); - message.endDate = $root.google.type.Date.fromObject(object.endDate); - } - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod.time: object expected"); - message.time = $root.google.type.TimeOfDay.fromObject(object.time); - } - return message; - }; - - /** - * Creates a plain object from a DenyMaintenancePeriod message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod} message DenyMaintenancePeriod - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenyMaintenancePeriod.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startDate = null; - object.endDate = null; - object.time = null; - } - if (message.startDate != null && message.hasOwnProperty("startDate")) - object.startDate = $root.google.type.Date.toObject(message.startDate, options); - if (message.endDate != null && message.hasOwnProperty("endDate")) - object.endDate = $root.google.type.Date.toObject(message.endDate, options); - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.type.TimeOfDay.toObject(message.time, options); - return object; - }; - - /** - * Converts this DenyMaintenancePeriod to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @instance - * @returns {Object.} JSON object - */ - DenyMaintenancePeriod.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DenyMaintenancePeriod - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DenyMaintenancePeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod"; - }; - - return DenyMaintenancePeriod; - })(); - - return MaintenanceUpdatePolicy; - })(); - - v1beta.MaintenanceSchedule = (function() { - - /** - * Properties of a MaintenanceSchedule. - * @memberof google.cloud.alloydb.v1beta - * @interface IMaintenanceSchedule - * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime - */ - - /** - * Constructs a new MaintenanceSchedule. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a MaintenanceSchedule. - * @implements IMaintenanceSchedule - * @constructor - * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule=} [properties] Properties to set - */ - function MaintenanceSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MaintenanceSchedule startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @instance - */ - MaintenanceSchedule.prototype.startTime = null; - - /** - * Creates a new MaintenanceSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule instance - */ - MaintenanceSchedule.create = function create(properties) { - return new MaintenanceSchedule(properties); - }; - - /** - * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.MaintenanceSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1beta.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.MaintenanceSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MaintenanceSchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.MaintenanceSchedule} MaintenanceSchedule - */ - MaintenanceSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.MaintenanceSchedule) - return object; - var message = new $root.google.cloud.alloydb.v1beta.MaintenanceSchedule(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.MaintenanceSchedule.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {google.cloud.alloydb.v1beta.MaintenanceSchedule} message MaintenanceSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.startTime = null; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this MaintenanceSchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @instance - * @returns {Object.} JSON object - */ - MaintenanceSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MaintenanceSchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.MaintenanceSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.MaintenanceSchedule"; - }; - - return MaintenanceSchedule; - })(); - - v1beta.Cluster = (function() { - - /** - * Properties of a Cluster. - * @memberof google.cloud.alloydb.v1beta - * @interface ICluster - * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] Cluster backupSource - * @property {google.cloud.alloydb.v1beta.IMigrationSource|null} [migrationSource] Cluster migrationSource - * @property {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null} [cloudsqlBackupRunSource] Cluster cloudsqlBackupRunSource - * @property {string|null} [name] Cluster name - * @property {string|null} [displayName] Cluster displayName - * @property {string|null} [uid] Cluster uid - * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Cluster deleteTime - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.alloydb.v1beta.Cluster.State|null} [state] Cluster state - * @property {google.cloud.alloydb.v1beta.Cluster.ClusterType|null} [clusterType] Cluster clusterType - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion - * @property {google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig - * @property {string|null} [network] Cluster network - * @property {string|null} [etag] Cluster etag - * @property {Object.|null} [annotations] Cluster annotations - * @property {boolean|null} [reconciling] Cluster reconciling - * @property {google.cloud.alloydb.v1beta.IUserPassword|null} [initialUser] Cluster initialUser - * @property {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null} [automatedBackupPolicy] Cluster automatedBackupPolicy - * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] Cluster sslConfig - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig - * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Cluster encryptionInfo - * @property {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null} [continuousBackupConfig] Cluster continuousBackupConfig - * @property {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null} [continuousBackupInfo] Cluster continuousBackupInfo - * @property {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null} [secondaryConfig] Cluster secondaryConfig - * @property {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null} [primaryConfig] Cluster primaryConfig - * @property {boolean|null} [satisfiesPzs] Cluster satisfiesPzs - * @property {google.cloud.alloydb.v1beta.Cluster.IPscConfig|null} [pscConfig] Cluster pscConfig - * @property {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy - * @property {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule - * @property {google.cloud.alloydb.v1beta.IGeminiClusterConfig|null} [geminiConfig] Cluster geminiConfig - * @property {google.cloud.alloydb.v1beta.SubscriptionType|null} [subscriptionType] Cluster subscriptionType - * @property {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata - * @property {Object.|null} [tags] Cluster tags - * @property {string|null} [serviceAccountEmail] Cluster serviceAccountEmail - * @property {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig - */ - - /** - * Constructs a new Cluster. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a Cluster. - * @implements ICluster - * @constructor - * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set - */ - function Cluster(properties) { - this.labels = {}; - this.annotations = {}; - this.tags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Cluster backupSource. - * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.backupSource = null; - - /** - * Cluster migrationSource. - * @member {google.cloud.alloydb.v1beta.IMigrationSource|null|undefined} migrationSource - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.migrationSource = null; - - /** - * Cluster cloudsqlBackupRunSource. - * @member {google.cloud.alloydb.v1beta.ICloudSQLBackupRunSource|null|undefined} cloudsqlBackupRunSource - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.cloudsqlBackupRunSource = null; - - /** - * Cluster name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.name = ""; - - /** - * Cluster displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.displayName = ""; - - /** - * Cluster uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.uid = ""; - - /** - * Cluster createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.createTime = null; - - /** - * Cluster updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.updateTime = null; - - /** - * Cluster deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.deleteTime = null; - - /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.labels = $util.emptyObject; - - /** - * Cluster state. - * @member {google.cloud.alloydb.v1beta.Cluster.State} state - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.state = 0; - - /** - * Cluster clusterType. - * @member {google.cloud.alloydb.v1beta.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.clusterType = 0; - - /** - * Cluster databaseVersion. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.databaseVersion = 0; - - /** - * Cluster networkConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.INetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.networkConfig = null; - - /** - * Cluster network. - * @member {string} network - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.network = ""; - - /** - * Cluster etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.etag = ""; - - /** - * Cluster annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.annotations = $util.emptyObject; - - /** - * Cluster reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.reconciling = false; - - /** - * Cluster initialUser. - * @member {google.cloud.alloydb.v1beta.IUserPassword|null|undefined} initialUser - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.initialUser = null; - - /** - * Cluster automatedBackupPolicy. - * @member {google.cloud.alloydb.v1beta.IAutomatedBackupPolicy|null|undefined} automatedBackupPolicy - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.automatedBackupPolicy = null; - - /** - * Cluster sslConfig. - * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.sslConfig = null; - - /** - * Cluster encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.encryptionConfig = null; - - /** - * Cluster encryptionInfo. - * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.encryptionInfo = null; - - /** - * Cluster continuousBackupConfig. - * @member {google.cloud.alloydb.v1beta.IContinuousBackupConfig|null|undefined} continuousBackupConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.continuousBackupConfig = null; - - /** - * Cluster continuousBackupInfo. - * @member {google.cloud.alloydb.v1beta.IContinuousBackupInfo|null|undefined} continuousBackupInfo - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.continuousBackupInfo = null; - - /** - * Cluster secondaryConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig|null|undefined} secondaryConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.secondaryConfig = null; - - /** - * Cluster primaryConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig|null|undefined} primaryConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.primaryConfig = null; - - /** - * Cluster satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.satisfiesPzs = false; - - /** - * Cluster pscConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.IPscConfig|null|undefined} pscConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.pscConfig = null; - - /** - * Cluster maintenanceUpdatePolicy. - * @member {google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null|undefined} maintenanceUpdatePolicy - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.maintenanceUpdatePolicy = null; - - /** - * Cluster maintenanceSchedule. - * @member {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null|undefined} maintenanceSchedule - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.maintenanceSchedule = null; - - /** - * Cluster geminiConfig. - * @member {google.cloud.alloydb.v1beta.IGeminiClusterConfig|null|undefined} geminiConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.geminiConfig = null; - - /** - * Cluster subscriptionType. - * @member {google.cloud.alloydb.v1beta.SubscriptionType} subscriptionType - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.subscriptionType = 0; - - /** - * Cluster trialMetadata. - * @member {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null|undefined} trialMetadata - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.trialMetadata = null; - - /** - * Cluster tags. - * @member {Object.} tags - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.tags = $util.emptyObject; - - /** - * Cluster serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.serviceAccountEmail = ""; - - /** - * Cluster dataplexConfig. - * @member {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null|undefined} dataplexConfig - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Cluster.prototype.dataplexConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|"cloudsqlBackupRunSource"|undefined} source - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource", "cloudsqlBackupRunSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Cluster instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {google.cloud.alloydb.v1beta.ICluster=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster instance - */ - Cluster.create = function create(properties) { - return new Cluster(properties); - }; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.databaseVersion); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.reconciling); - if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) - $root.google.cloud.alloydb.v1beta.UserPassword.encode(message.initialUser, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.migrationSource != null && Object.hasOwnProperty.call(message, "migrationSource")) - $root.google.cloud.alloydb.v1beta.MigrationSource.encode(message.migrationSource, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.automatedBackupPolicy != null && Object.hasOwnProperty.call(message, "automatedBackupPolicy")) - $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.encode(message.automatedBackupPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.secondaryConfig != null && Object.hasOwnProperty.call(message, "secondaryConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.encode(message.secondaryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.primaryConfig != null && Object.hasOwnProperty.call(message, "primaryConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.encode(message.primaryConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.clusterType); - if (message.continuousBackupConfig != null && Object.hasOwnProperty.call(message, "continuousBackupConfig")) - $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) - $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzs); - if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.encode(message.pscConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.maintenanceUpdatePolicy != null && Object.hasOwnProperty.call(message, "maintenanceUpdatePolicy")) - $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.encode(message.maintenanceUpdatePolicy, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) - $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.encode(message.geminiConfig, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) - $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.subscriptionType != null && Object.hasOwnProperty.call(message, "subscriptionType")) - writer.uint32(/* id 38, wireType 0 =*/304).int32(message.subscriptionType); - if (message.trialMetadata != null && Object.hasOwnProperty.call(message, "trialMetadata")) - $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.encode(message.trialMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); - if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) - $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 46, wireType 2 =*/370).string(message.serviceAccountEmail); - if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) - $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {google.cloud.alloydb.v1beta.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 15: { - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); - break; - } - case 16: { - message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.decode(reader, reader.uint32()); - break; - } - case 42: { - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 24: { - message.clusterType = reader.int32(); - break; - } - case 9: { - message.databaseVersion = reader.int32(); - break; - } - case 29: { - message.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.network = reader.string(); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 12: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 13: { - message.reconciling = reader.bool(); - break; - } - case 14: { - message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.decode(reader, reader.uint32()); - break; - } - case 17: { - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.decode(reader, reader.uint32()); - break; - } - case 18: { - message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 27: { - message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.decode(reader, reader.uint32()); - break; - } - case 28: { - message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.decode(reader, reader.uint32()); - break; - } - case 22: { - message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.decode(reader, reader.uint32()); - break; - } - case 23: { - message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.decode(reader, reader.uint32()); - break; - } - case 30: { - message.satisfiesPzs = reader.bool(); - break; - } - case 31: { - message.pscConfig = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.decode(reader, reader.uint32()); - break; - } - case 32: { - message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.decode(reader, reader.uint32()); - break; - } - case 37: { - message.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.decode(reader, reader.uint32()); - break; - } - case 36: { - message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.decode(reader, reader.uint32()); - break; - } - case 38: { - message.subscriptionType = reader.int32(); - break; - } - case 39: { - message.trialMetadata = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.decode(reader, reader.uint32()); - break; - } - case 41: { - if (message.tags === $util.emptyObject) - message.tags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.tags[key] = value; - break; - } - case 46: { - message.serviceAccountEmail = reader.string(); - break; - } - case 47: { - message.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cluster message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cluster.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.MigrationSource.verify(message.migrationSource); - if (error) - return "migrationSource." + error; - } - } - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.verify(message.cloudsqlBackupRunSource); - if (error) - return "cloudsqlBackupRunSource." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) { - var error = $root.google.cloud.alloydb.v1beta.UserPassword.verify(message.initialUser); - if (error) - return "initialUser." + error; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) { - var error = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.verify(message.automatedBackupPolicy); - if (error) - return "automatedBackupPolicy." + error; - } - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) { - var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.verify(message.continuousBackupConfig); - if (error) - return "continuousBackupConfig." + error; - } - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) { - var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.verify(message.continuousBackupInfo); - if (error) - return "continuousBackupInfo." + error; - } - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify(message.secondaryConfig); - if (error) - return "secondaryConfig." + error; - } - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify(message.primaryConfig); - if (error) - return "primaryConfig." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.verify(message.pscConfig); - if (error) - return "pscConfig." + error; - } - if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) { - var error = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.verify(message.maintenanceUpdatePolicy); - if (error) - return "maintenanceUpdatePolicy." + error; - } - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { - var error = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.verify(message.maintenanceSchedule); - if (error) - return "maintenanceSchedule." + error; - } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { - var error = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.verify(message.geminiConfig); - if (error) - return "geminiConfig." + error; - } - if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) - switch (message.subscriptionType) { - default: - return "subscriptionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify(message.trialMetadata); - if (error) - return "trialMetadata." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!$util.isObject(message.tags)) - return "tags: object expected"; - var key = Object.keys(message.tags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.tags[key[i]])) - return "tags: string{k:string} expected"; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify(message.dataplexConfig); - if (error) - return "dataplexConfig." + error; - } - return null; - }; - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster} Cluster - */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); - } - if (object.migrationSource != null) { - if (typeof object.migrationSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.migrationSource: object expected"); - message.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.fromObject(object.migrationSource); - } - if (object.cloudsqlBackupRunSource != null) { - if (typeof object.cloudsqlBackupRunSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.cloudsqlBackupRunSource: object expected"); - message.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.fromObject(object.cloudsqlBackupRunSource); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "EMPTY": - case 3: - message.state = 3; - break; - case "CREATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 7: - message.state = 7; - break; - case "MAINTENANCE": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.databaseVersion = 6; - break; - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.fromObject(object.networkConfig); - } - if (object.network != null) - message.network = String(object.network); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.initialUser != null) { - if (typeof object.initialUser !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.initialUser: object expected"); - message.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.fromObject(object.initialUser); - } - if (object.automatedBackupPolicy != null) { - if (typeof object.automatedBackupPolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.automatedBackupPolicy: object expected"); - message.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.fromObject(object.automatedBackupPolicy); - } - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.continuousBackupConfig != null) { - if (typeof object.continuousBackupConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupConfig: object expected"); - message.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.fromObject(object.continuousBackupConfig); - } - if (object.continuousBackupInfo != null) { - if (typeof object.continuousBackupInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.continuousBackupInfo: object expected"); - message.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.fromObject(object.continuousBackupInfo); - } - if (object.secondaryConfig != null) { - if (typeof object.secondaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.secondaryConfig: object expected"); - message.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.fromObject(object.secondaryConfig); - } - if (object.primaryConfig != null) { - if (typeof object.primaryConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.primaryConfig: object expected"); - message.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.fromObject(object.primaryConfig); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.pscConfig != null) { - if (typeof object.pscConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.pscConfig: object expected"); - message.pscConfig = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.fromObject(object.pscConfig); - } - if (object.maintenanceUpdatePolicy != null) { - if (typeof object.maintenanceUpdatePolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.maintenanceUpdatePolicy: object expected"); - message.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.fromObject(object.maintenanceUpdatePolicy); - } - if (object.maintenanceSchedule != null) { - if (typeof object.maintenanceSchedule !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.maintenanceSchedule: object expected"); - message.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.fromObject(object.maintenanceSchedule); - } - if (object.geminiConfig != null) { - if (typeof object.geminiConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.geminiConfig: object expected"); - message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.fromObject(object.geminiConfig); - } - switch (object.subscriptionType) { - default: - if (typeof object.subscriptionType === "number") { - message.subscriptionType = object.subscriptionType; - break; - } - break; - case "SUBSCRIPTION_TYPE_UNSPECIFIED": - case 0: - message.subscriptionType = 0; - break; - case "STANDARD": - case 1: - message.subscriptionType = 1; - break; - case "TRIAL": - case 2: - message.subscriptionType = 2; - break; - } - if (object.trialMetadata != null) { - if (typeof object.trialMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.trialMetadata: object expected"); - message.trialMetadata = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.fromObject(object.trialMetadata); - } - if (object.tags) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.tags: object expected"); - message.tags = {}; - for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) - message.tags[keys[i]] = String(object.tags[keys[i]]); - } - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.dataplexConfig != null) { - if (typeof object.dataplexConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.dataplexConfig: object expected"); - message.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.fromObject(object.dataplexConfig); - } - return message; - }; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {google.cloud.alloydb.v1beta.Cluster} message Cluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cluster.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - object.tags = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.network = ""; - object.etag = ""; - object.reconciling = false; - object.initialUser = null; - object.automatedBackupPolicy = null; - object.sslConfig = null; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.secondaryConfig = null; - object.primaryConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.continuousBackupConfig = null; - object.continuousBackupInfo = null; - object.networkConfig = null; - object.satisfiesPzs = false; - object.pscConfig = null; - object.maintenanceUpdatePolicy = null; - object.geminiConfig = null; - object.maintenanceSchedule = null; - object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; - object.trialMetadata = null; - object.serviceAccountEmail = ""; - object.dataplexConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Cluster.State[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.initialUser != null && message.hasOwnProperty("initialUser")) - object.initialUser = $root.google.cloud.alloydb.v1beta.UserPassword.toObject(message.initialUser, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.migrationSource != null && message.hasOwnProperty("migrationSource")) { - object.migrationSource = $root.google.cloud.alloydb.v1beta.MigrationSource.toObject(message.migrationSource, options); - if (options.oneofs) - object.source = "migrationSource"; - } - if (message.automatedBackupPolicy != null && message.hasOwnProperty("automatedBackupPolicy")) - object.automatedBackupPolicy = $root.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.toObject(message.automatedBackupPolicy, options); - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.secondaryConfig != null && message.hasOwnProperty("secondaryConfig")) - object.secondaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.toObject(message.secondaryConfig, options); - if (message.primaryConfig != null && message.hasOwnProperty("primaryConfig")) - object.primaryConfig = $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.toObject(message.primaryConfig, options); - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.continuousBackupConfig != null && message.hasOwnProperty("continuousBackupConfig")) - object.continuousBackupConfig = $root.google.cloud.alloydb.v1beta.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); - if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) - object.continuousBackupInfo = $root.google.cloud.alloydb.v1beta.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig.toObject(message.networkConfig, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) - object.pscConfig = $root.google.cloud.alloydb.v1beta.Cluster.PscConfig.toObject(message.pscConfig, options); - if (message.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) - object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) - object.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiClusterConfig.toObject(message.geminiConfig, options); - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) - object.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); - if (message.subscriptionType != null && message.hasOwnProperty("subscriptionType")) - object.subscriptionType = options.enums === String ? $root.google.cloud.alloydb.v1beta.SubscriptionType[message.subscriptionType] === undefined ? message.subscriptionType : $root.google.cloud.alloydb.v1beta.SubscriptionType[message.subscriptionType] : message.subscriptionType; - if (message.trialMetadata != null && message.hasOwnProperty("trialMetadata")) - object.trialMetadata = $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata.toObject(message.trialMetadata, options); - if (message.tags && (keys2 = Object.keys(message.tags)).length) { - object.tags = {}; - for (var j = 0; j < keys2.length; ++j) - object.tags[keys2[j]] = message.tags[keys2[j]]; - } - if (message.cloudsqlBackupRunSource != null && message.hasOwnProperty("cloudsqlBackupRunSource")) { - object.cloudsqlBackupRunSource = $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.toObject(message.cloudsqlBackupRunSource, options); - if (options.oneofs) - object.source = "cloudsqlBackupRunSource"; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) - object.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); - return object; - }; - - /** - * Converts this Cluster to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - * @returns {Object.} JSON object - */ - Cluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cluster - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster"; - }; - - Cluster.NetworkConfig = (function() { - - /** - * Properties of a NetworkConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface INetworkConfig - * @property {string|null} [network] NetworkConfig network - * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange - */ - - /** - * Constructs a new NetworkConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a NetworkConfig. - * @implements INetworkConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig=} [properties] Properties to set - */ - function NetworkConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkConfig network. - * @member {string} network - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @instance - */ - NetworkConfig.prototype.network = ""; - - /** - * NetworkConfig allocatedIpRange. - * @member {string} allocatedIpRange - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @instance - */ - NetworkConfig.prototype.allocatedIpRange = ""; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig instance - */ - NetworkConfig.create = function create(properties) { - return new NetworkConfig(properties); - }; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); - return writer; - }; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.NetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.allocatedIpRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) - if (!$util.isString(message.allocatedIpRange)) - return "allocatedIpRange: string expected"; - return null; - }; - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} NetworkConfig - */ - NetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.NetworkConfig(); - if (object.network != null) - message.network = String(object.network); - if (object.allocatedIpRange != null) - message.allocatedIpRange = String(object.allocatedIpRange); - return message; - }; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.NetworkConfig} message NetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.allocatedIpRange = ""; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) - object.allocatedIpRange = message.allocatedIpRange; - return object; - }; - - /** - * Converts this NetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @instance - * @returns {Object.} JSON object - */ - NetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.NetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.NetworkConfig"; - }; - - return NetworkConfig; - })(); - - Cluster.SecondaryConfig = (function() { - - /** - * Properties of a SecondaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface ISecondaryConfig - * @property {string|null} [primaryClusterName] SecondaryConfig primaryClusterName - */ - - /** - * Constructs a new SecondaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a SecondaryConfig. - * @implements ISecondaryConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set - */ - function SecondaryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecondaryConfig primaryClusterName. - * @member {string} primaryClusterName - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @instance - */ - SecondaryConfig.prototype.primaryClusterName = ""; - - /** - * Creates a new SecondaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig instance - */ - SecondaryConfig.create = function create(properties) { - return new SecondaryConfig(properties); - }; - - /** - * Encodes the specified SecondaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryClusterName != null && Object.hasOwnProperty.call(message, "primaryClusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryClusterName); - return writer; - }; - - /** - * Encodes the specified SecondaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.SecondaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ISecondaryConfig} message SecondaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecondaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.primaryClusterName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecondaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecondaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecondaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecondaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - if (!$util.isString(message.primaryClusterName)) - return "primaryClusterName: string expected"; - return null; - }; - - /** - * Creates a SecondaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} SecondaryConfig - */ - SecondaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig(); - if (object.primaryClusterName != null) - message.primaryClusterName = String(object.primaryClusterName); - return message; - }; - - /** - * Creates a plain object from a SecondaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.SecondaryConfig} message SecondaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecondaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.primaryClusterName = ""; - if (message.primaryClusterName != null && message.hasOwnProperty("primaryClusterName")) - object.primaryClusterName = message.primaryClusterName; - return object; - }; - - /** - * Converts this SecondaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @instance - * @returns {Object.} JSON object - */ - SecondaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecondaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.SecondaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecondaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.SecondaryConfig"; - }; - - return SecondaryConfig; - })(); - - Cluster.PrimaryConfig = (function() { - - /** - * Properties of a PrimaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface IPrimaryConfig - * @property {Array.|null} [secondaryClusterNames] PrimaryConfig secondaryClusterNames - */ - - /** - * Constructs a new PrimaryConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a PrimaryConfig. - * @implements IPrimaryConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set - */ - function PrimaryConfig(properties) { - this.secondaryClusterNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PrimaryConfig secondaryClusterNames. - * @member {Array.} secondaryClusterNames - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @instance - */ - PrimaryConfig.prototype.secondaryClusterNames = $util.emptyArray; - - /** - * Creates a new PrimaryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig instance - */ - PrimaryConfig.create = function create(properties) { - return new PrimaryConfig(properties); - }; - - /** - * Encodes the specified PrimaryConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secondaryClusterNames != null && message.secondaryClusterNames.length) - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secondaryClusterNames[i]); - return writer; - }; - - /** - * Encodes the specified PrimaryConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPrimaryConfig} message PrimaryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrimaryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.secondaryClusterNames && message.secondaryClusterNames.length)) - message.secondaryClusterNames = []; - message.secondaryClusterNames.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PrimaryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrimaryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PrimaryConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrimaryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secondaryClusterNames != null && message.hasOwnProperty("secondaryClusterNames")) { - if (!Array.isArray(message.secondaryClusterNames)) - return "secondaryClusterNames: array expected"; - for (var i = 0; i < message.secondaryClusterNames.length; ++i) - if (!$util.isString(message.secondaryClusterNames[i])) - return "secondaryClusterNames: string[] expected"; - } - return null; - }; - - /** - * Creates a PrimaryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} PrimaryConfig - */ - PrimaryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.PrimaryConfig(); - if (object.secondaryClusterNames) { - if (!Array.isArray(object.secondaryClusterNames)) - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.PrimaryConfig.secondaryClusterNames: array expected"); - message.secondaryClusterNames = []; - for (var i = 0; i < object.secondaryClusterNames.length; ++i) - message.secondaryClusterNames[i] = String(object.secondaryClusterNames[i]); - } - return message; - }; - - /** - * Creates a plain object from a PrimaryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.PrimaryConfig} message PrimaryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrimaryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.secondaryClusterNames = []; - if (message.secondaryClusterNames && message.secondaryClusterNames.length) { - object.secondaryClusterNames = []; - for (var j = 0; j < message.secondaryClusterNames.length; ++j) - object.secondaryClusterNames[j] = message.secondaryClusterNames[j]; - } - return object; - }; - - /** - * Converts this PrimaryConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @instance - * @returns {Object.} JSON object - */ - PrimaryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PrimaryConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.PrimaryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrimaryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.PrimaryConfig"; - }; - - return PrimaryConfig; - })(); - - Cluster.PscConfig = (function() { - - /** - * Properties of a PscConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface IPscConfig - * @property {boolean|null} [pscEnabled] PscConfig pscEnabled - * @property {number|Long|null} [serviceOwnedProjectNumber] PscConfig serviceOwnedProjectNumber - */ - - /** - * Constructs a new PscConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a PscConfig. - * @implements IPscConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig=} [properties] Properties to set - */ - function PscConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscConfig pscEnabled. - * @member {boolean} pscEnabled - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @instance - */ - PscConfig.prototype.pscEnabled = false; - - /** - * PscConfig serviceOwnedProjectNumber. - * @member {number|Long} serviceOwnedProjectNumber - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @instance - */ - PscConfig.prototype.serviceOwnedProjectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PscConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig instance - */ - PscConfig.create = function create(properties) { - return new PscConfig(properties); - }; - - /** - * Encodes the specified PscConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig} message PscConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); - if (message.serviceOwnedProjectNumber != null && Object.hasOwnProperty.call(message, "serviceOwnedProjectNumber")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.serviceOwnedProjectNumber); - return writer; - }; - - /** - * Encodes the specified PscConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.PscConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IPscConfig} message PscConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.PscConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pscEnabled = reader.bool(); - break; - } - case 3: { - message.serviceOwnedProjectNumber = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - if (typeof message.pscEnabled !== "boolean") - return "pscEnabled: boolean expected"; - if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) - if (!$util.isInteger(message.serviceOwnedProjectNumber) && !(message.serviceOwnedProjectNumber && $util.isInteger(message.serviceOwnedProjectNumber.low) && $util.isInteger(message.serviceOwnedProjectNumber.high))) - return "serviceOwnedProjectNumber: integer|Long expected"; - return null; - }; - - /** - * Creates a PscConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.PscConfig} PscConfig - */ - PscConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.PscConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.PscConfig(); - if (object.pscEnabled != null) - message.pscEnabled = Boolean(object.pscEnabled); - if (object.serviceOwnedProjectNumber != null) - if ($util.Long) - (message.serviceOwnedProjectNumber = $util.Long.fromValue(object.serviceOwnedProjectNumber)).unsigned = false; - else if (typeof object.serviceOwnedProjectNumber === "string") - message.serviceOwnedProjectNumber = parseInt(object.serviceOwnedProjectNumber, 10); - else if (typeof object.serviceOwnedProjectNumber === "number") - message.serviceOwnedProjectNumber = object.serviceOwnedProjectNumber; - else if (typeof object.serviceOwnedProjectNumber === "object") - message.serviceOwnedProjectNumber = new $util.LongBits(object.serviceOwnedProjectNumber.low >>> 0, object.serviceOwnedProjectNumber.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PscConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.PscConfig} message PscConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pscEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.serviceOwnedProjectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.serviceOwnedProjectNumber = options.longs === String ? "0" : 0; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - if (message.serviceOwnedProjectNumber != null && message.hasOwnProperty("serviceOwnedProjectNumber")) - if (typeof message.serviceOwnedProjectNumber === "number") - object.serviceOwnedProjectNumber = options.longs === String ? String(message.serviceOwnedProjectNumber) : message.serviceOwnedProjectNumber; - else - object.serviceOwnedProjectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.serviceOwnedProjectNumber) : options.longs === Number ? new $util.LongBits(message.serviceOwnedProjectNumber.low >>> 0, message.serviceOwnedProjectNumber.high >>> 0).toNumber() : message.serviceOwnedProjectNumber; - return object; - }; - - /** - * Converts this PscConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @instance - * @returns {Object.} JSON object - */ - PscConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.PscConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.PscConfig"; - }; - - return PscConfig; - })(); - - Cluster.TrialMetadata = (function() { - - /** - * Properties of a TrialMetadata. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface ITrialMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] TrialMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TrialMetadata endTime - * @property {google.protobuf.ITimestamp|null} [upgradeTime] TrialMetadata upgradeTime - * @property {google.protobuf.ITimestamp|null} [graceEndTime] TrialMetadata graceEndTime - */ - - /** - * Constructs a new TrialMetadata. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a TrialMetadata. - * @implements ITrialMetadata - * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata=} [properties] Properties to set - */ - function TrialMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrialMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.startTime = null; - - /** - * TrialMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.endTime = null; - - /** - * TrialMetadata upgradeTime. - * @member {google.protobuf.ITimestamp|null|undefined} upgradeTime - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.upgradeTime = null; - - /** - * TrialMetadata graceEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} graceEndTime - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @instance - */ - TrialMetadata.prototype.graceEndTime = null; - - /** - * Creates a new TrialMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata instance - */ - TrialMetadata.create = function create(properties) { - return new TrialMetadata(properties); - }; - - /** - * Encodes the specified TrialMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrialMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) - $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.graceEndTime != null && Object.hasOwnProperty.call(message, "graceEndTime")) - $root.google.protobuf.Timestamp.encode(message.graceEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrialMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.TrialMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata} message TrialMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrialMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrialMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.upgradeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.graceEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrialMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrialMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrialMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrialMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime); - if (error) - return "upgradeTime." + error; - } - if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.graceEndTime); - if (error) - return "graceEndTime." + error; - } - return null; - }; - - /** - * Creates a TrialMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} TrialMetadata - */ - TrialMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.TrialMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.upgradeTime != null) { - if (typeof object.upgradeTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.upgradeTime: object expected"); - message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime); - } - if (object.graceEndTime != null) { - if (typeof object.graceEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Cluster.TrialMetadata.graceEndTime: object expected"); - message.graceEndTime = $root.google.protobuf.Timestamp.fromObject(object.graceEndTime); - } - return message; - }; - - /** - * Creates a plain object from a TrialMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.TrialMetadata} message TrialMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrialMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.upgradeTime = null; - object.graceEndTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) - object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); - if (message.graceEndTime != null && message.hasOwnProperty("graceEndTime")) - object.graceEndTime = $root.google.protobuf.Timestamp.toObject(message.graceEndTime, options); - return object; - }; - - /** - * Converts this TrialMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @instance - * @returns {Object.} JSON object - */ - TrialMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrialMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.TrialMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrialMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.TrialMetadata"; - }; - - return TrialMetadata; - })(); - - Cluster.DataplexConfig = (function() { - - /** - * Properties of a DataplexConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @interface IDataplexConfig - * @property {boolean|null} [enabled] DataplexConfig enabled - */ - - /** - * Constructs a new DataplexConfig. - * @memberof google.cloud.alloydb.v1beta.Cluster - * @classdesc Represents a DataplexConfig. - * @implements IDataplexConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig=} [properties] Properties to set - */ - function DataplexConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataplexConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @instance - */ - DataplexConfig.prototype.enabled = false; - - /** - * Creates a new DataplexConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig instance - */ - DataplexConfig.create = function create(properties) { - return new DataplexConfig(properties); - }; - - /** - * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataplexConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - return writer; - }; - - /** - * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataplexConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataplexConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataplexConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataplexConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - return null; - }; - - /** - * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig - */ - DataplexConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - return message; - }; - - /** - * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} message DataplexConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataplexConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enabled = false; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - return object; - }; - - /** - * Converts this DataplexConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @instance - * @returns {Object.} JSON object - */ - DataplexConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataplexConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.DataplexConfig"; - }; - - return DataplexConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1beta.Cluster.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} EMPTY=3 EMPTY value - * @property {number} CREATING=4 CREATING value - * @property {number} DELETING=5 DELETING value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=7 BOOTSTRAPPING value - * @property {number} MAINTENANCE=8 MAINTENANCE value - * @property {number} PROMOTING=9 PROMOTING value - */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "EMPTY"] = 3; - values[valuesById[4] = "CREATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "BOOTSTRAPPING"] = 7; - values[valuesById[8] = "MAINTENANCE"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * ClusterType enum. - * @name google.cloud.alloydb.v1beta.Cluster.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} SECONDARY=2 SECONDARY value - */ - Cluster.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "SECONDARY"] = 2; - return values; - })(); - - return Cluster; - })(); - - v1beta.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.cloud.alloydb.v1beta - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {string|null} [uid] Instance uid - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {Object.|null} [labels] Instance labels - * @property {google.cloud.alloydb.v1beta.Instance.State|null} [state] Instance state - * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [instanceType] Instance instanceType - * @property {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null} [machineConfig] Instance machineConfig - * @property {google.cloud.alloydb.v1beta.Instance.AvailabilityType|null} [availabilityType] Instance availabilityType - * @property {string|null} [gceZone] Instance gceZone - * @property {Object.|null} [databaseFlags] Instance databaseFlags - * @property {google.cloud.alloydb.v1beta.Instance.INode|null} [writableNode] Instance writableNode - * @property {Array.|null} [nodes] Instance nodes - * @property {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig - * @property {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null} [observabilityConfig] Instance observabilityConfig - * @property {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null} [readPoolConfig] Instance readPoolConfig - * @property {string|null} [ipAddress] Instance ipAddress - * @property {string|null} [publicIpAddress] Instance publicIpAddress - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - * @property {Object.|null} [annotations] Instance annotations - * @property {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy - * @property {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig - * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs - * @property {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null} [pscInstanceConfig] Instance pscInstanceConfig - * @property {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null} [networkConfig] Instance networkConfig - * @property {google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null} [geminiConfig] Instance geminiConfig - * @property {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses - * @property {google.cloud.alloydb.v1beta.Instance.ActivationPolicy|null} [activationPolicy] Instance activationPolicy - * @property {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null} [connectionPoolConfig] Instance connectionPoolConfig - * @property {google.cloud.alloydb.v1beta.IGCAInstanceConfig|null} [gcaConfig] Instance gcaConfig - */ - - /** - * Constructs a new Instance. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.labels = {}; - this.databaseFlags = {}; - this.nodes = []; - this.annotations = {}; - this.outboundPublicIpAddresses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Instance name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.displayName = ""; - - /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.uid = ""; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.deleteTime = null; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance state. - * @member {google.cloud.alloydb.v1beta.Instance.State} state - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance instanceType. - * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.instanceType = 0; - - /** - * Instance machineConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IMachineConfig|null|undefined} machineConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.machineConfig = null; - - /** - * Instance availabilityType. - * @member {google.cloud.alloydb.v1beta.Instance.AvailabilityType} availabilityType - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.availabilityType = 0; - - /** - * Instance gceZone. - * @member {string} gceZone - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.gceZone = ""; - - /** - * Instance databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.databaseFlags = $util.emptyObject; - - /** - * Instance writableNode. - * @member {google.cloud.alloydb.v1beta.Instance.INode|null|undefined} writableNode - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.writableNode = null; - - /** - * Instance nodes. - * @member {Array.} nodes - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.nodes = $util.emptyArray; - - /** - * Instance queryInsightsConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig|null|undefined} queryInsightsConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.queryInsightsConfig = null; - - /** - * Instance observabilityConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig|null|undefined} observabilityConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.observabilityConfig = null; - - /** - * Instance readPoolConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig|null|undefined} readPoolConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.readPoolConfig = null; - - /** - * Instance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.ipAddress = ""; - - /** - * Instance publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.publicIpAddress = ""; - - /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.reconciling = false; - - /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.etag = ""; - - /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.annotations = $util.emptyObject; - - /** - * Instance updatePolicy. - * @member {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null|undefined} updatePolicy - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.updatePolicy = null; - - /** - * Instance clientConnectionConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.clientConnectionConfig = null; - - /** - * Instance satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.satisfiesPzs = false; - - /** - * Instance pscInstanceConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig|null|undefined} pscInstanceConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.pscInstanceConfig = null; - - /** - * Instance networkConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig|null|undefined} networkConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.networkConfig = null; - - /** - * Instance geminiConfig. - * @member {google.cloud.alloydb.v1beta.IGeminiInstanceConfig|null|undefined} geminiConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.geminiConfig = null; - - /** - * Instance outboundPublicIpAddresses. - * @member {Array.} outboundPublicIpAddresses - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; - - /** - * Instance activationPolicy. - * @member {google.cloud.alloydb.v1beta.Instance.ActivationPolicy} activationPolicy - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.activationPolicy = 0; - - /** - * Instance connectionPoolConfig. - * @member {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig|null|undefined} connectionPoolConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.connectionPoolConfig = null; - - /** - * Instance gcaConfig. - * @member {google.cloud.alloydb.v1beta.IGCAInstanceConfig|null|undefined} gcaConfig - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.gcaConfig = null; - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {google.cloud.alloydb.v1beta.IInstance=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {google.cloud.alloydb.v1beta.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.instanceType); - if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) - $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.availabilityType); - if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.gceZone); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.readPoolConfig != null && Object.hasOwnProperty.call(message, "readPoolConfig")) - $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.encode(message.readPoolConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.ipAddress); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.writableNode != null && Object.hasOwnProperty.call(message, "writableNode")) - $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.writableNode, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) - $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) - $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) - $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); - if (message.observabilityConfig != null && Object.hasOwnProperty.call(message, "observabilityConfig")) - $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.encode(message.observabilityConfig, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.publicIpAddress); - if (message.pscInstanceConfig != null && Object.hasOwnProperty.call(message, "pscInstanceConfig")) - $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.encode(message.pscInstanceConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) - $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) - $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.outboundPublicIpAddresses != null && message.outboundPublicIpAddresses.length) - for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.outboundPublicIpAddresses[i]); - if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) - writer.uint32(/* id 35, wireType 0 =*/280).int32(message.activationPolicy); - if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) - $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.gcaConfig != null && Object.hasOwnProperty.call(message, "gcaConfig")) - $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.encode(message.gcaConfig, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {google.cloud.alloydb.v1beta.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - message.state = reader.int32(); - break; - } - case 9: { - message.instanceType = reader.int32(); - break; - } - case 10: { - message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.availabilityType = reader.int32(); - break; - } - case 12: { - message.gceZone = reader.string(); - break; - } - case 13: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.databaseFlags[key] = value; - break; - } - case 19: { - message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32()); - break; - } - case 20: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.alloydb.v1beta.Instance.Node.decode(reader, reader.uint32())); - break; - } - case 21: { - message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 26: { - message.observabilityConfig = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 14: { - message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.ipAddress = reader.string(); - break; - } - case 27: { - message.publicIpAddress = reader.string(); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { - message.etag = reader.string(); - break; - } - case 18: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 22: { - message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.decode(reader, reader.uint32()); - break; - } - case 23: { - message.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); - break; - } - case 24: { - message.satisfiesPzs = reader.bool(); - break; - } - case 28: { - message.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 29: { - message.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.decode(reader, reader.uint32()); - break; - } - case 33: { - message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 34: { - if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) - message.outboundPublicIpAddresses = []; - message.outboundPublicIpAddresses.push(reader.string()); - break; - } - case 35: { - message.activationPolicy = reader.int32(); - break; - } - case 37: { - message.connectionPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.decode(reader, reader.uint32()); - break; - } - case 38: { - message.gcaConfig = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 8: - case 9: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.verify(message.machineConfig); - if (error) - return "machineConfig." + error; - } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - switch (message.availabilityType) { - default: - return "availabilityType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - if (!$util.isString(message.gceZone)) - return "gceZone: string expected"; - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.writableNode); - if (error) - return "writableNode." + error; - } - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify(message.queryInsightsConfig); - if (error) - return "queryInsightsConfig." + error; - } - if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify(message.observabilityConfig); - if (error) - return "observabilityConfig." + error; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify(message.readPoolConfig); - if (error) - return "readPoolConfig." + error; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify(message.updatePolicy); - if (error) - return "updatePolicy." + error; - } - if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); - if (error) - return "clientConnectionConfig." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify(message.pscInstanceConfig); - if (error) - return "pscInstanceConfig." + error; - } - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify(message.networkConfig); - if (error) - return "networkConfig." + error; - } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { - var error = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify(message.geminiConfig); - if (error) - return "geminiConfig." + error; - } - if (message.outboundPublicIpAddresses != null && message.hasOwnProperty("outboundPublicIpAddresses")) { - if (!Array.isArray(message.outboundPublicIpAddresses)) - return "outboundPublicIpAddresses: array expected"; - for (var i = 0; i < message.outboundPublicIpAddresses.length; ++i) - if (!$util.isString(message.outboundPublicIpAddresses[i])) - return "outboundPublicIpAddresses: string[] expected"; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - switch (message.activationPolicy) { - default: - return "activationPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify(message.connectionPoolConfig); - if (error) - return "connectionPoolConfig." + error; - } - if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) { - var error = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.verify(message.gcaConfig); - if (error) - return "gcaConfig." + error; - } - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "STOPPED": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "MAINTENANCE": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "BOOTSTRAPPING": - case 8: - message.state = 8; - break; - case "PROMOTING": - case 9: - message.state = 9; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - if (object.machineConfig != null) { - if (typeof object.machineConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.machineConfig: object expected"); - message.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.fromObject(object.machineConfig); - } - switch (object.availabilityType) { - default: - if (typeof object.availabilityType === "number") { - message.availabilityType = object.availabilityType; - break; - } - break; - case "AVAILABILITY_TYPE_UNSPECIFIED": - case 0: - message.availabilityType = 0; - break; - case "ZONAL": - case 1: - message.availabilityType = 1; - break; - case "REGIONAL": - case 2: - message.availabilityType = 2; - break; - } - if (object.gceZone != null) - message.gceZone = String(object.gceZone); - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - if (object.writableNode != null) { - if (typeof object.writableNode !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.writableNode: object expected"); - message.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.writableNode); - } - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.nodes: object expected"); - message.nodes[i] = $root.google.cloud.alloydb.v1beta.Instance.Node.fromObject(object.nodes[i]); - } - } - if (object.queryInsightsConfig != null) { - if (typeof object.queryInsightsConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.queryInsightsConfig: object expected"); - message.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.fromObject(object.queryInsightsConfig); - } - if (object.observabilityConfig != null) { - if (typeof object.observabilityConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.observabilityConfig: object expected"); - message.observabilityConfig = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.fromObject(object.observabilityConfig); - } - if (object.readPoolConfig != null) { - if (typeof object.readPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.readPoolConfig: object expected"); - message.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.fromObject(object.readPoolConfig); - } - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.updatePolicy != null) { - if (typeof object.updatePolicy !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.updatePolicy: object expected"); - message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.fromObject(object.updatePolicy); - } - if (object.clientConnectionConfig != null) { - if (typeof object.clientConnectionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.clientConnectionConfig: object expected"); - message.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.pscInstanceConfig != null) { - if (typeof object.pscInstanceConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.pscInstanceConfig: object expected"); - message.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.fromObject(object.pscInstanceConfig); - } - if (object.networkConfig != null) { - if (typeof object.networkConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.networkConfig: object expected"); - message.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.fromObject(object.networkConfig); - } - if (object.geminiConfig != null) { - if (typeof object.geminiConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.geminiConfig: object expected"); - message.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.fromObject(object.geminiConfig); - } - if (object.outboundPublicIpAddresses) { - if (!Array.isArray(object.outboundPublicIpAddresses)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.outboundPublicIpAddresses: array expected"); - message.outboundPublicIpAddresses = []; - for (var i = 0; i < object.outboundPublicIpAddresses.length; ++i) - message.outboundPublicIpAddresses[i] = String(object.outboundPublicIpAddresses[i]); - } - switch (object.activationPolicy) { - default: - if (typeof object.activationPolicy === "number") { - message.activationPolicy = object.activationPolicy; - break; - } - break; - case "ACTIVATION_POLICY_UNSPECIFIED": - case 0: - message.activationPolicy = 0; - break; - case "ALWAYS": - case 1: - message.activationPolicy = 1; - break; - case "NEVER": - case 2: - message.activationPolicy = 2; - break; - } - if (object.connectionPoolConfig != null) { - if (typeof object.connectionPoolConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.connectionPoolConfig: object expected"); - message.connectionPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.fromObject(object.connectionPoolConfig); - } - if (object.gcaConfig != null) { - if (typeof object.gcaConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.gcaConfig: object expected"); - message.gcaConfig = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.fromObject(object.gcaConfig); - } - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {google.cloud.alloydb.v1beta.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.nodes = []; - object.outboundPublicIpAddresses = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.databaseFlags = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.machineConfig = null; - object.availabilityType = options.enums === String ? "AVAILABILITY_TYPE_UNSPECIFIED" : 0; - object.gceZone = ""; - object.readPoolConfig = null; - object.ipAddress = ""; - object.reconciling = false; - object.etag = ""; - object.writableNode = null; - object.queryInsightsConfig = null; - object.updatePolicy = null; - object.clientConnectionConfig = null; - object.satisfiesPzs = false; - object.observabilityConfig = null; - object.publicIpAddress = ""; - object.pscInstanceConfig = null; - object.networkConfig = null; - object.geminiConfig = null; - object.activationPolicy = options.enums === String ? "ACTIVATION_POLICY_UNSPECIFIED" : 0; - object.connectionPoolConfig = null; - object.gcaConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Instance.State[message.state] : message.state; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) - object.machineConfig = $root.google.cloud.alloydb.v1beta.Instance.MachineConfig.toObject(message.machineConfig, options); - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) - object.availabilityType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.alloydb.v1beta.Instance.AvailabilityType[message.availabilityType] : message.availabilityType; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) - object.gceZone = message.gceZone; - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.readPoolConfig != null && message.hasOwnProperty("readPoolConfig")) - object.readPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.toObject(message.readPoolConfig, options); - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.writableNode != null && message.hasOwnProperty("writableNode")) - object.writableNode = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.writableNode, options); - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.alloydb.v1beta.Instance.Node.toObject(message.nodes[j], options); - } - if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) - object.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); - if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) - object.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.toObject(message.updatePolicy, options); - if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) - object.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.observabilityConfig != null && message.hasOwnProperty("observabilityConfig")) - object.observabilityConfig = $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.toObject(message.observabilityConfig, options); - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - if (message.pscInstanceConfig != null && message.hasOwnProperty("pscInstanceConfig")) - object.pscInstanceConfig = $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.toObject(message.pscInstanceConfig, options); - if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) - object.networkConfig = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.toObject(message.networkConfig, options); - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) - object.geminiConfig = $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig.toObject(message.geminiConfig, options); - if (message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { - object.outboundPublicIpAddresses = []; - for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) - object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - object.activationPolicy = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.ActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.alloydb.v1beta.Instance.ActivationPolicy[message.activationPolicy] : message.activationPolicy; - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) - object.connectionPoolConfig = $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); - if (message.gcaConfig != null && message.hasOwnProperty("gcaConfig")) - object.gcaConfig = $root.google.cloud.alloydb.v1beta.GCAInstanceConfig.toObject(message.gcaConfig, options); - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance"; - }; - - Instance.MachineConfig = (function() { - - /** - * Properties of a MachineConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IMachineConfig - * @property {number|null} [cpuCount] MachineConfig cpuCount - * @property {string|null} [machineType] MachineConfig machineType - */ - - /** - * Constructs a new MachineConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a MachineConfig. - * @implements IMachineConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set - */ - function MachineConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MachineConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.cpuCount = 0; - - /** - * MachineConfig machineType. - * @member {string} machineType - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @instance - */ - MachineConfig.prototype.machineType = ""; - - /** - * Creates a new MachineConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig instance - */ - MachineConfig.create = function create(properties) { - return new MachineConfig(properties); - }; - - /** - * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineType); - return writer; - }; - - /** - * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.MachineConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IMachineConfig} message MachineConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - break; - } - case 4: { - message.machineType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MachineConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MachineConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MachineConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MachineConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - return null; - }; - - /** - * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.MachineConfig} MachineConfig - */ - MachineConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.MachineConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.MachineConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; - if (object.machineType != null) - message.machineType = String(object.machineType); - return message; - }; - - /** - * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.MachineConfig} message MachineConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MachineConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpuCount = 0; - object.machineType = ""; - } - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - return object; - }; - - /** - * Converts this MachineConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @instance - * @returns {Object.} JSON object - */ - MachineConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MachineConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.MachineConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.MachineConfig"; - }; - - return MachineConfig; - })(); - - Instance.Node = (function() { - - /** - * Properties of a Node. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface INode - * @property {string|null} [zoneId] Node zoneId - * @property {string|null} [id] Node id - * @property {string|null} [ip] Node ip - * @property {string|null} [state] Node state - */ - - /** - * Constructs a new Node. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set - */ - function Node(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Node zoneId. - * @member {string} zoneId - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.zoneId = ""; - - /** - * Node id. - * @member {string} id - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.id = ""; - - /** - * Node ip. - * @member {string} ip - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.ip = ""; - - /** - * Node state. - * @member {string} state - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - */ - Node.prototype.state = ""; - - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; - - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneId); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.ip != null && Object.hasOwnProperty.call(message, "ip")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ip); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); - return writer; - }; - - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.zoneId = reader.string(); - break; - } - case 2: { - message.id = reader.string(); - break; - } - case 3: { - message.ip = reader.string(); - break; - } - case 4: { - message.state = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - if (!$util.isString(message.zoneId)) - return "zoneId: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.ip != null && message.hasOwnProperty("ip")) - if (!$util.isString(message.ip)) - return "ip: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - if (!$util.isString(message.state)) - return "state: string expected"; - return null; - }; - - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.Node) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.Node(); - if (object.zoneId != null) - message.zoneId = String(object.zoneId); - if (object.id != null) - message.id = String(object.id); - if (object.ip != null) - message.ip = String(object.ip); - if (object.state != null) - message.state = String(object.state); - return message; - }; - - /** - * Creates a plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {google.cloud.alloydb.v1beta.Instance.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.zoneId = ""; - object.id = ""; - object.ip = ""; - object.state = ""; - } - if (message.zoneId != null && message.hasOwnProperty("zoneId")) - object.zoneId = message.zoneId; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.ip != null && message.hasOwnProperty("ip")) - object.ip = message.ip; - if (message.state != null && message.hasOwnProperty("state")) - object.state = message.state; - return object; - }; - - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.Node - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.Node"; - }; - - return Node; - })(); - - Instance.QueryInsightsInstanceConfig = (function() { - - /** - * Properties of a QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IQueryInsightsInstanceConfig - * @property {boolean|null} [recordApplicationTags] QueryInsightsInstanceConfig recordApplicationTags - * @property {boolean|null} [recordClientAddress] QueryInsightsInstanceConfig recordClientAddress - * @property {number|null} [queryStringLength] QueryInsightsInstanceConfig queryStringLength - * @property {number|null} [queryPlansPerMinute] QueryInsightsInstanceConfig queryPlansPerMinute - */ - - /** - * Constructs a new QueryInsightsInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a QueryInsightsInstanceConfig. - * @implements IQueryInsightsInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - */ - function QueryInsightsInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInsightsInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordApplicationTags = null; - - /** - * QueryInsightsInstanceConfig recordClientAddress. - * @member {boolean|null|undefined} recordClientAddress - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.recordClientAddress = null; - - /** - * QueryInsightsInstanceConfig queryStringLength. - * @member {number} queryStringLength - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryStringLength = 0; - - /** - * QueryInsightsInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - QueryInsightsInstanceConfig.prototype.queryPlansPerMinute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new QueryInsightsInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig instance - */ - QueryInsightsInstanceConfig.create = function create(properties) { - return new QueryInsightsInstanceConfig(properties); - }; - - /** - * Encodes the specified QueryInsightsInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recordApplicationTags); - if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordClientAddress); - if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.queryStringLength); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.queryPlansPerMinute); - return writer; - }; - - /** - * Encodes the specified QueryInsightsInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IQueryInsightsInstanceConfig} message QueryInsightsInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInsightsInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.recordApplicationTags = reader.bool(); - break; - } - case 3: { - message.recordClientAddress = reader.bool(); - break; - } - case 4: { - message.queryStringLength = reader.uint32(); - break; - } - case 5: { - message.queryPlansPerMinute = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInsightsInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInsightsInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInsightsInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInsightsInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - properties._recordClientAddress = 1; - if (typeof message.recordClientAddress !== "boolean") - return "recordClientAddress: boolean expected"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - if (!$util.isInteger(message.queryStringLength)) - return "queryStringLength: integer expected"; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - return null; - }; - - /** - * Creates a QueryInsightsInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} QueryInsightsInstanceConfig - */ - QueryInsightsInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig(); - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.recordClientAddress != null) - message.recordClientAddress = Boolean(object.recordClientAddress); - if (object.queryStringLength != null) - message.queryStringLength = object.queryStringLength >>> 0; - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute >>> 0; - return message; - }; - - /** - * Creates a plain object from a QueryInsightsInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig} message QueryInsightsInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInsightsInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.queryStringLength = 0; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) { - object.recordClientAddress = message.recordClientAddress; - if (options.oneofs) - object._recordClientAddress = "recordClientAddress"; - } - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = message.queryStringLength; - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - return object; - }; - - /** - * Converts this QueryInsightsInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - QueryInsightsInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryInsightsInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryInsightsInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig"; - }; - - return QueryInsightsInstanceConfig; - })(); - - Instance.ObservabilityInstanceConfig = (function() { - - /** - * Properties of an ObservabilityInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IObservabilityInstanceConfig - * @property {boolean|null} [enabled] ObservabilityInstanceConfig enabled - * @property {boolean|null} [preserveComments] ObservabilityInstanceConfig preserveComments - * @property {boolean|null} [trackWaitEvents] ObservabilityInstanceConfig trackWaitEvents - * @property {boolean|null} [trackWaitEventTypes] ObservabilityInstanceConfig trackWaitEventTypes - * @property {number|null} [maxQueryStringLength] ObservabilityInstanceConfig maxQueryStringLength - * @property {boolean|null} [recordApplicationTags] ObservabilityInstanceConfig recordApplicationTags - * @property {number|null} [queryPlansPerMinute] ObservabilityInstanceConfig queryPlansPerMinute - * @property {boolean|null} [trackActiveQueries] ObservabilityInstanceConfig trackActiveQueries - * @property {boolean|null} [trackClientAddress] ObservabilityInstanceConfig trackClientAddress - * @property {boolean|null} [assistiveExperiencesEnabled] ObservabilityInstanceConfig assistiveExperiencesEnabled - */ - - /** - * Constructs a new ObservabilityInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents an ObservabilityInstanceConfig. - * @implements IObservabilityInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig=} [properties] Properties to set - */ - function ObservabilityInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ObservabilityInstanceConfig enabled. - * @member {boolean|null|undefined} enabled - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.enabled = null; - - /** - * ObservabilityInstanceConfig preserveComments. - * @member {boolean|null|undefined} preserveComments - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.preserveComments = null; - - /** - * ObservabilityInstanceConfig trackWaitEvents. - * @member {boolean|null|undefined} trackWaitEvents - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackWaitEvents = null; - - /** - * ObservabilityInstanceConfig trackWaitEventTypes. - * @member {boolean|null|undefined} trackWaitEventTypes - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackWaitEventTypes = null; - - /** - * ObservabilityInstanceConfig maxQueryStringLength. - * @member {number|null|undefined} maxQueryStringLength - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.maxQueryStringLength = null; - - /** - * ObservabilityInstanceConfig recordApplicationTags. - * @member {boolean|null|undefined} recordApplicationTags - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.recordApplicationTags = null; - - /** - * ObservabilityInstanceConfig queryPlansPerMinute. - * @member {number|null|undefined} queryPlansPerMinute - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.queryPlansPerMinute = null; - - /** - * ObservabilityInstanceConfig trackActiveQueries. - * @member {boolean|null|undefined} trackActiveQueries - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackActiveQueries = null; - - /** - * ObservabilityInstanceConfig trackClientAddress. - * @member {boolean|null|undefined} trackClientAddress - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.trackClientAddress = null; - - /** - * ObservabilityInstanceConfig assistiveExperiencesEnabled. - * @member {boolean|null|undefined} assistiveExperiencesEnabled - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - */ - ObservabilityInstanceConfig.prototype.assistiveExperiencesEnabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_preserveComments", { - get: $util.oneOfGetter($oneOfFields = ["preserveComments"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEvents", { - get: $util.oneOfGetter($oneOfFields = ["trackWaitEvents"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackWaitEventTypes", { - get: $util.oneOfGetter($oneOfFields = ["trackWaitEventTypes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_maxQueryStringLength", { - get: $util.oneOfGetter($oneOfFields = ["maxQueryStringLength"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_queryPlansPerMinute", { - get: $util.oneOfGetter($oneOfFields = ["queryPlansPerMinute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackActiveQueries", { - get: $util.oneOfGetter($oneOfFields = ["trackActiveQueries"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_trackClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["trackClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ObservabilityInstanceConfig.prototype, "_assistiveExperiencesEnabled", { - get: $util.oneOfGetter($oneOfFields = ["assistiveExperiencesEnabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ObservabilityInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig instance - */ - ObservabilityInstanceConfig.create = function create(properties) { - return new ObservabilityInstanceConfig(properties); - }; - - /** - * Encodes the specified ObservabilityInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservabilityInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.preserveComments != null && Object.hasOwnProperty.call(message, "preserveComments")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.preserveComments); - if (message.trackWaitEvents != null && Object.hasOwnProperty.call(message, "trackWaitEvents")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.trackWaitEvents); - if (message.trackWaitEventTypes != null && Object.hasOwnProperty.call(message, "trackWaitEventTypes")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.trackWaitEventTypes); - if (message.maxQueryStringLength != null && Object.hasOwnProperty.call(message, "maxQueryStringLength")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxQueryStringLength); - if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recordApplicationTags); - if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.queryPlansPerMinute); - if (message.trackActiveQueries != null && Object.hasOwnProperty.call(message, "trackActiveQueries")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.trackActiveQueries); - if (message.trackClientAddress != null && Object.hasOwnProperty.call(message, "trackClientAddress")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trackClientAddress); - if (message.assistiveExperiencesEnabled != null && Object.hasOwnProperty.call(message, "assistiveExperiencesEnabled")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.assistiveExperiencesEnabled); - return writer; - }; - - /** - * Encodes the specified ObservabilityInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IObservabilityInstanceConfig} message ObservabilityInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservabilityInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservabilityInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enabled = reader.bool(); - break; - } - case 2: { - message.preserveComments = reader.bool(); - break; - } - case 3: { - message.trackWaitEvents = reader.bool(); - break; - } - case 4: { - message.trackWaitEventTypes = reader.bool(); - break; - } - case 5: { - message.maxQueryStringLength = reader.int32(); - break; - } - case 6: { - message.recordApplicationTags = reader.bool(); - break; - } - case 7: { - message.queryPlansPerMinute = reader.int32(); - break; - } - case 8: { - message.trackActiveQueries = reader.bool(); - break; - } - case 9: { - message.trackClientAddress = reader.bool(); - break; - } - case 10: { - message.assistiveExperiencesEnabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObservabilityInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservabilityInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObservabilityInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObservabilityInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - properties._enabled = 1; - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - } - if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { - properties._preserveComments = 1; - if (typeof message.preserveComments !== "boolean") - return "preserveComments: boolean expected"; - } - if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { - properties._trackWaitEvents = 1; - if (typeof message.trackWaitEvents !== "boolean") - return "trackWaitEvents: boolean expected"; - } - if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { - properties._trackWaitEventTypes = 1; - if (typeof message.trackWaitEventTypes !== "boolean") - return "trackWaitEventTypes: boolean expected"; - } - if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { - properties._maxQueryStringLength = 1; - if (!$util.isInteger(message.maxQueryStringLength)) - return "maxQueryStringLength: integer expected"; - } - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - properties._recordApplicationTags = 1; - if (typeof message.recordApplicationTags !== "boolean") - return "recordApplicationTags: boolean expected"; - } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - properties._queryPlansPerMinute = 1; - if (!$util.isInteger(message.queryPlansPerMinute)) - return "queryPlansPerMinute: integer expected"; - } - if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { - properties._trackActiveQueries = 1; - if (typeof message.trackActiveQueries !== "boolean") - return "trackActiveQueries: boolean expected"; - } - if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { - properties._trackClientAddress = 1; - if (typeof message.trackClientAddress !== "boolean") - return "trackClientAddress: boolean expected"; - } - if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { - properties._assistiveExperiencesEnabled = 1; - if (typeof message.assistiveExperiencesEnabled !== "boolean") - return "assistiveExperiencesEnabled: boolean expected"; - } - return null; - }; - - /** - * Creates an ObservabilityInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} ObservabilityInstanceConfig - */ - ObservabilityInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.preserveComments != null) - message.preserveComments = Boolean(object.preserveComments); - if (object.trackWaitEvents != null) - message.trackWaitEvents = Boolean(object.trackWaitEvents); - if (object.trackWaitEventTypes != null) - message.trackWaitEventTypes = Boolean(object.trackWaitEventTypes); - if (object.maxQueryStringLength != null) - message.maxQueryStringLength = object.maxQueryStringLength | 0; - if (object.recordApplicationTags != null) - message.recordApplicationTags = Boolean(object.recordApplicationTags); - if (object.queryPlansPerMinute != null) - message.queryPlansPerMinute = object.queryPlansPerMinute | 0; - if (object.trackActiveQueries != null) - message.trackActiveQueries = Boolean(object.trackActiveQueries); - if (object.trackClientAddress != null) - message.trackClientAddress = Boolean(object.trackClientAddress); - if (object.assistiveExperiencesEnabled != null) - message.assistiveExperiencesEnabled = Boolean(object.assistiveExperiencesEnabled); - return message; - }; - - /** - * Creates a plain object from an ObservabilityInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig} message ObservabilityInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObservabilityInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { - object.enabled = message.enabled; - if (options.oneofs) - object._enabled = "enabled"; - } - if (message.preserveComments != null && message.hasOwnProperty("preserveComments")) { - object.preserveComments = message.preserveComments; - if (options.oneofs) - object._preserveComments = "preserveComments"; - } - if (message.trackWaitEvents != null && message.hasOwnProperty("trackWaitEvents")) { - object.trackWaitEvents = message.trackWaitEvents; - if (options.oneofs) - object._trackWaitEvents = "trackWaitEvents"; - } - if (message.trackWaitEventTypes != null && message.hasOwnProperty("trackWaitEventTypes")) { - object.trackWaitEventTypes = message.trackWaitEventTypes; - if (options.oneofs) - object._trackWaitEventTypes = "trackWaitEventTypes"; - } - if (message.maxQueryStringLength != null && message.hasOwnProperty("maxQueryStringLength")) { - object.maxQueryStringLength = message.maxQueryStringLength; - if (options.oneofs) - object._maxQueryStringLength = "maxQueryStringLength"; - } - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) { - object.recordApplicationTags = message.recordApplicationTags; - if (options.oneofs) - object._recordApplicationTags = "recordApplicationTags"; - } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { - object.queryPlansPerMinute = message.queryPlansPerMinute; - if (options.oneofs) - object._queryPlansPerMinute = "queryPlansPerMinute"; - } - if (message.trackActiveQueries != null && message.hasOwnProperty("trackActiveQueries")) { - object.trackActiveQueries = message.trackActiveQueries; - if (options.oneofs) - object._trackActiveQueries = "trackActiveQueries"; - } - if (message.trackClientAddress != null && message.hasOwnProperty("trackClientAddress")) { - object.trackClientAddress = message.trackClientAddress; - if (options.oneofs) - object._trackClientAddress = "trackClientAddress"; - } - if (message.assistiveExperiencesEnabled != null && message.hasOwnProperty("assistiveExperiencesEnabled")) { - object.assistiveExperiencesEnabled = message.assistiveExperiencesEnabled; - if (options.oneofs) - object._assistiveExperiencesEnabled = "assistiveExperiencesEnabled"; - } - return object; - }; - - /** - * Converts this ObservabilityInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - ObservabilityInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ObservabilityInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ObservabilityInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig"; - }; - - return ObservabilityInstanceConfig; - })(); - - Instance.ReadPoolConfig = (function() { - - /** - * Properties of a ReadPoolConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount - */ - - /** - * Constructs a new ReadPoolConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set - */ - function ReadPoolConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @instance - */ - ReadPoolConfig.prototype.nodeCount = 0; - - /** - * Creates a new ReadPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig instance - */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); - }; - - /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); - return writer; - }; - - /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ReadPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - return null; - }; - - /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} ReadPoolConfig - */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.ReadPoolConfig} message ReadPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeCount = 0; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - return object; - }; - - /** - * Converts this ReadPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ReadPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.ReadPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ReadPoolConfig"; - }; - - return ReadPoolConfig; - })(); - - Instance.UpdatePolicy = (function() { - - /** - * Properties of an UpdatePolicy. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IUpdatePolicy - * @property {google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode|null} [mode] UpdatePolicy mode - */ - - /** - * Constructs a new UpdatePolicy. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents an UpdatePolicy. - * @implements IUpdatePolicy - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy=} [properties] Properties to set - */ - function UpdatePolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdatePolicy mode. - * @member {google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode} mode - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @instance - */ - UpdatePolicy.prototype.mode = 0; - - /** - * Creates a new UpdatePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy instance - */ - UpdatePolicy.create = function create(properties) { - return new UpdatePolicy(properties); - }; - - /** - * Encodes the specified UpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdatePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified UpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.UpdatePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy} message UpdatePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdatePolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdatePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdatePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdatePolicy message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdatePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an UpdatePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} UpdatePolicy - */ - UpdatePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy(); - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "DEFAULT": - case 1: - message.mode = 1; - break; - case "FORCE_APPLY": - case 2: - message.mode = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an UpdatePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {google.cloud.alloydb.v1beta.Instance.UpdatePolicy} message UpdatePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdatePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode[message.mode] : message.mode; - return object; - }; - - /** - * Converts this UpdatePolicy to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @instance - * @returns {Object.} JSON object - */ - UpdatePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdatePolicy - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.UpdatePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.UpdatePolicy"; - }; - - /** - * Mode enum. - * @name google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} DEFAULT=1 DEFAULT value - * @property {number} FORCE_APPLY=2 FORCE_APPLY value - */ - UpdatePolicy.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - values[valuesById[2] = "FORCE_APPLY"] = 2; - return values; - })(); - - return UpdatePolicy; - })(); - - Instance.ClientConnectionConfig = (function() { - - /** - * Properties of a ClientConnectionConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IClientConnectionConfig - * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors - * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig - */ - - /** - * Constructs a new ClientConnectionConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a ClientConnectionConfig. - * @implements IClientConnectionConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig=} [properties] Properties to set - */ - function ClientConnectionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientConnectionConfig requireConnectors. - * @member {boolean} requireConnectors - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @instance - */ - ClientConnectionConfig.prototype.requireConnectors = false; - - /** - * ClientConnectionConfig sslConfig. - * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @instance - */ - ClientConnectionConfig.prototype.sslConfig = null; - - /** - * Creates a new ClientConnectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig instance - */ - ClientConnectionConfig.create = function create(properties) { - return new ClientConnectionConfig(properties); - }; - - /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConnectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); - if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) - $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConnectionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requireConnectors = reader.bool(); - break; - } - case 2: { - message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientConnectionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientConnectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) - if (typeof message.requireConnectors !== "boolean") - return "requireConnectors: boolean expected"; - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { - var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); - if (error) - return "sslConfig." + error; - } - return null; - }; - - /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig - */ - ClientConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig(); - if (object.requireConnectors != null) - message.requireConnectors = Boolean(object.requireConnectors); - if (object.sslConfig != null) { - if (typeof object.sslConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.sslConfig: object expected"); - message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); - } - return message; - }; - - /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} message ClientConnectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientConnectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.requireConnectors = false; - object.sslConfig = null; - } - if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) - object.requireConnectors = message.requireConnectors; - if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) - object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); - return object; - }; - - /** - * Converts this ClientConnectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @instance - * @returns {Object.} JSON object - */ - ClientConnectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientConnectionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig"; - }; - - return ClientConnectionConfig; - })(); - - Instance.PscInterfaceConfig = (function() { - - /** - * Properties of a PscInterfaceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IPscInterfaceConfig - * @property {string|null} [networkAttachmentResource] PscInterfaceConfig networkAttachmentResource - */ - - /** - * Constructs a new PscInterfaceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a PscInterfaceConfig. - * @implements IPscInterfaceConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig=} [properties] Properties to set - */ - function PscInterfaceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscInterfaceConfig networkAttachmentResource. - * @member {string} networkAttachmentResource - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.networkAttachmentResource = ""; - - /** - * Creates a new PscInterfaceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig instance - */ - PscInterfaceConfig.create = function create(properties) { - return new PscInterfaceConfig(properties); - }; - - /** - * Encodes the specified PscInterfaceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInterfaceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkAttachmentResource != null && Object.hasOwnProperty.call(message, "networkAttachmentResource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.networkAttachmentResource); - return writer; - }; - - /** - * Encodes the specified PscInterfaceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig} message PscInterfaceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInterfaceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInterfaceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.networkAttachmentResource = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscInterfaceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInterfaceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscInterfaceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscInterfaceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) - if (!$util.isString(message.networkAttachmentResource)) - return "networkAttachmentResource: string expected"; - return null; - }; - - /** - * Creates a PscInterfaceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} PscInterfaceConfig - */ - PscInterfaceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig(); - if (object.networkAttachmentResource != null) - message.networkAttachmentResource = String(object.networkAttachmentResource); - return message; - }; - - /** - * Creates a plain object from a PscInterfaceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig} message PscInterfaceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscInterfaceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.networkAttachmentResource = ""; - if (message.networkAttachmentResource != null && message.hasOwnProperty("networkAttachmentResource")) - object.networkAttachmentResource = message.networkAttachmentResource; - return object; - }; - - /** - * Converts this PscInterfaceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @instance - * @returns {Object.} JSON object - */ - PscInterfaceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscInterfaceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscInterfaceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig"; - }; - - return PscInterfaceConfig; - })(); - - Instance.PscAutoConnectionConfig = (function() { - - /** - * Properties of a PscAutoConnectionConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IPscAutoConnectionConfig - * @property {string|null} [consumerProject] PscAutoConnectionConfig consumerProject - * @property {string|null} [consumerNetwork] PscAutoConnectionConfig consumerNetwork - * @property {string|null} [ipAddress] PscAutoConnectionConfig ipAddress - * @property {string|null} [status] PscAutoConnectionConfig status - * @property {string|null} [consumerNetworkStatus] PscAutoConnectionConfig consumerNetworkStatus - */ - - /** - * Constructs a new PscAutoConnectionConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a PscAutoConnectionConfig. - * @implements IPscAutoConnectionConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig=} [properties] Properties to set - */ - function PscAutoConnectionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscAutoConnectionConfig consumerProject. - * @member {string} consumerProject - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerProject = ""; - - /** - * PscAutoConnectionConfig consumerNetwork. - * @member {string} consumerNetwork - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerNetwork = ""; - - /** - * PscAutoConnectionConfig ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.ipAddress = ""; - - /** - * PscAutoConnectionConfig status. - * @member {string} status - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.status = ""; - - /** - * PscAutoConnectionConfig consumerNetworkStatus. - * @member {string} consumerNetworkStatus - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @instance - */ - PscAutoConnectionConfig.prototype.consumerNetworkStatus = ""; - - /** - * Creates a new PscAutoConnectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig instance - */ - PscAutoConnectionConfig.create = function create(properties) { - return new PscAutoConnectionConfig(properties); - }; - - /** - * Encodes the specified PscAutoConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscAutoConnectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); - if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.consumerNetwork); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.status); - if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.consumerNetworkStatus); - return writer; - }; - - /** - * Encodes the specified PscAutoConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscAutoConnectionConfig} message PscAutoConnectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscAutoConnectionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.consumerProject = reader.string(); - break; - } - case 2: { - message.consumerNetwork = reader.string(); - break; - } - case 3: { - message.ipAddress = reader.string(); - break; - } - case 4: { - message.status = reader.string(); - break; - } - case 5: { - message.consumerNetworkStatus = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscAutoConnectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscAutoConnectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscAutoConnectionConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscAutoConnectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) - if (!$util.isString(message.consumerProject)) - return "consumerProject: string expected"; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) - if (!$util.isString(message.consumerNetwork)) - return "consumerNetwork: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) - if (!$util.isString(message.consumerNetworkStatus)) - return "consumerNetworkStatus: string expected"; - return null; - }; - - /** - * Creates a PscAutoConnectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} PscAutoConnectionConfig - */ - PscAutoConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig(); - if (object.consumerProject != null) - message.consumerProject = String(object.consumerProject); - if (object.consumerNetwork != null) - message.consumerNetwork = String(object.consumerNetwork); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.status != null) - message.status = String(object.status); - if (object.consumerNetworkStatus != null) - message.consumerNetworkStatus = String(object.consumerNetworkStatus); - return message; - }; - - /** - * Creates a plain object from a PscAutoConnectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig} message PscAutoConnectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscAutoConnectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.consumerProject = ""; - object.consumerNetwork = ""; - object.ipAddress = ""; - object.status = ""; - object.consumerNetworkStatus = ""; - } - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) - object.consumerProject = message.consumerProject; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) - object.consumerNetwork = message.consumerNetwork; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) - object.consumerNetworkStatus = message.consumerNetworkStatus; - return object; - }; - - /** - * Converts this PscAutoConnectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @instance - * @returns {Object.} JSON object - */ - PscAutoConnectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscAutoConnectionConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscAutoConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig"; - }; - - return PscAutoConnectionConfig; - })(); - - Instance.PscInstanceConfig = (function() { - - /** - * Properties of a PscInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IPscInstanceConfig - * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink - * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects - * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName - * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs - * @property {Array.|null} [pscAutoConnections] PscInstanceConfig pscAutoConnections - */ - - /** - * Constructs a new PscInstanceConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a PscInstanceConfig. - * @implements IPscInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig=} [properties] Properties to set - */ - function PscInstanceConfig(properties) { - this.allowedConsumerProjects = []; - this.pscInterfaceConfigs = []; - this.pscAutoConnections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PscInstanceConfig serviceAttachmentLink. - * @member {string} serviceAttachmentLink - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.serviceAttachmentLink = ""; - - /** - * PscInstanceConfig allowedConsumerProjects. - * @member {Array.} allowedConsumerProjects - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.allowedConsumerProjects = $util.emptyArray; - - /** - * PscInstanceConfig pscDnsName. - * @member {string} pscDnsName - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscDnsName = ""; - - /** - * PscInstanceConfig pscInterfaceConfigs. - * @member {Array.} pscInterfaceConfigs - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; - - /** - * PscInstanceConfig pscAutoConnections. - * @member {Array.} pscAutoConnections - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscAutoConnections = $util.emptyArray; - - /** - * Creates a new PscInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig instance - */ - PscInstanceConfig.create = function create(properties) { - return new PscInstanceConfig(properties); - }; - - /** - * Encodes the specified PscInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAttachmentLink != null && Object.hasOwnProperty.call(message, "serviceAttachmentLink")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachmentLink); - if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) - for (var i = 0; i < message.allowedConsumerProjects.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); - if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscDnsName); - if (message.pscInterfaceConfigs != null && message.pscInterfaceConfigs.length) - for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.encode(message.pscInterfaceConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.pscAutoConnections != null && message.pscAutoConnections.length) - for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PscInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IPscInstanceConfig} message PscInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.serviceAttachmentLink = reader.string(); - break; - } - case 2: { - if (!(message.allowedConsumerProjects && message.allowedConsumerProjects.length)) - message.allowedConsumerProjects = []; - message.allowedConsumerProjects.push(reader.string()); - break; - } - case 7: { - message.pscDnsName = reader.string(); - break; - } - case 8: { - if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) - message.pscInterfaceConfigs = []; - message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.pscAutoConnections && message.pscAutoConnections.length)) - message.pscAutoConnections = []; - message.pscAutoConnections.push($root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PscInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PscInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) - if (!$util.isString(message.serviceAttachmentLink)) - return "serviceAttachmentLink: string expected"; - if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { - if (!Array.isArray(message.allowedConsumerProjects)) - return "allowedConsumerProjects: array expected"; - for (var i = 0; i < message.allowedConsumerProjects.length; ++i) - if (!$util.isString(message.allowedConsumerProjects[i])) - return "allowedConsumerProjects: string[] expected"; - } - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - if (!$util.isString(message.pscDnsName)) - return "pscDnsName: string expected"; - if (message.pscInterfaceConfigs != null && message.hasOwnProperty("pscInterfaceConfigs")) { - if (!Array.isArray(message.pscInterfaceConfigs)) - return "pscInterfaceConfigs: array expected"; - for (var i = 0; i < message.pscInterfaceConfigs.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.verify(message.pscInterfaceConfigs[i]); - if (error) - return "pscInterfaceConfigs." + error; - } - } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { - if (!Array.isArray(message.pscAutoConnections)) - return "pscAutoConnections: array expected"; - for (var i = 0; i < message.pscAutoConnections.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.verify(message.pscAutoConnections[i]); - if (error) - return "pscAutoConnections." + error; - } - } - return null; - }; - - /** - * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} PscInstanceConfig - */ - PscInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.PscInstanceConfig(); - if (object.serviceAttachmentLink != null) - message.serviceAttachmentLink = String(object.serviceAttachmentLink); - if (object.allowedConsumerProjects) { - if (!Array.isArray(object.allowedConsumerProjects)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.allowedConsumerProjects: array expected"); - message.allowedConsumerProjects = []; - for (var i = 0; i < object.allowedConsumerProjects.length; ++i) - message.allowedConsumerProjects[i] = String(object.allowedConsumerProjects[i]); - } - if (object.pscDnsName != null) - message.pscDnsName = String(object.pscDnsName); - if (object.pscInterfaceConfigs) { - if (!Array.isArray(object.pscInterfaceConfigs)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscInterfaceConfigs: array expected"); - message.pscInterfaceConfigs = []; - for (var i = 0; i < object.pscInterfaceConfigs.length; ++i) { - if (typeof object.pscInterfaceConfigs[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscInterfaceConfigs: object expected"); - message.pscInterfaceConfigs[i] = $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.fromObject(object.pscInterfaceConfigs[i]); - } - } - if (object.pscAutoConnections) { - if (!Array.isArray(object.pscAutoConnections)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscAutoConnections: array expected"); - message.pscAutoConnections = []; - for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.pscAutoConnections: object expected"); - message.pscAutoConnections[i] = $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.PscInstanceConfig} message PscInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PscInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedConsumerProjects = []; - object.pscInterfaceConfigs = []; - object.pscAutoConnections = []; - } - if (options.defaults) { - object.serviceAttachmentLink = ""; - object.pscDnsName = ""; - } - if (message.serviceAttachmentLink != null && message.hasOwnProperty("serviceAttachmentLink")) - object.serviceAttachmentLink = message.serviceAttachmentLink; - if (message.allowedConsumerProjects && message.allowedConsumerProjects.length) { - object.allowedConsumerProjects = []; - for (var j = 0; j < message.allowedConsumerProjects.length; ++j) - object.allowedConsumerProjects[j] = message.allowedConsumerProjects[j]; - } - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - object.pscDnsName = message.pscDnsName; - if (message.pscInterfaceConfigs && message.pscInterfaceConfigs.length) { - object.pscInterfaceConfigs = []; - for (var j = 0; j < message.pscInterfaceConfigs.length; ++j) - object.pscInterfaceConfigs[j] = $root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.toObject(message.pscInterfaceConfigs[j], options); - } - if (message.pscAutoConnections && message.pscAutoConnections.length) { - object.pscAutoConnections = []; - for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); - } - return object; - }; - - /** - * Converts this PscInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - PscInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PscInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.PscInstanceConfig"; - }; - - return PscInstanceConfig; - })(); - - Instance.InstanceNetworkConfig = (function() { - - /** - * Properties of an InstanceNetworkConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IInstanceNetworkConfig - * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks - * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp - * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp - * @property {string|null} [network] InstanceNetworkConfig network - * @property {string|null} [allocatedIpRangeOverride] InstanceNetworkConfig allocatedIpRangeOverride - */ - - /** - * Constructs a new InstanceNetworkConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents an InstanceNetworkConfig. - * @implements IInstanceNetworkConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig=} [properties] Properties to set - */ - function InstanceNetworkConfig(properties) { - this.authorizedExternalNetworks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceNetworkConfig authorizedExternalNetworks. - * @member {Array.} authorizedExternalNetworks - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; - - /** - * InstanceNetworkConfig enablePublicIp. - * @member {boolean} enablePublicIp - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.enablePublicIp = false; - - /** - * InstanceNetworkConfig enableOutboundPublicIp. - * @member {boolean} enableOutboundPublicIp - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; - - /** - * InstanceNetworkConfig network. - * @member {string} network - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.network = ""; - - /** - * InstanceNetworkConfig allocatedIpRangeOverride. - * @member {string} allocatedIpRangeOverride - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @instance - */ - InstanceNetworkConfig.prototype.allocatedIpRangeOverride = ""; - - /** - * Creates a new InstanceNetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance - */ - InstanceNetworkConfig.create = function create(properties) { - return new InstanceNetworkConfig(properties); - }; - - /** - * Encodes the specified InstanceNetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceNetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.authorizedExternalNetworks != null && message.authorizedExternalNetworks.length) - for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.encode(message.authorizedExternalNetworks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.enablePublicIp != null && Object.hasOwnProperty.call(message, "enablePublicIp")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enablePublicIp); - if (message.enableOutboundPublicIp != null && Object.hasOwnProperty.call(message, "enableOutboundPublicIp")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOutboundPublicIp); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.network); - if (message.allocatedIpRangeOverride != null && Object.hasOwnProperty.call(message, "allocatedIpRangeOverride")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRangeOverride); - return writer; - }; - - /** - * Encodes the specified InstanceNetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IInstanceNetworkConfig} message InstanceNetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceNetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.authorizedExternalNetworks && message.authorizedExternalNetworks.length)) - message.authorizedExternalNetworks = []; - message.authorizedExternalNetworks.push($root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.decode(reader, reader.uint32())); - break; - } - case 2: { - message.enablePublicIp = reader.bool(); - break; - } - case 3: { - message.enableOutboundPublicIp = reader.bool(); - break; - } - case 4: { - message.network = reader.string(); - break; - } - case 5: { - message.allocatedIpRangeOverride = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceNetworkConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceNetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.authorizedExternalNetworks != null && message.hasOwnProperty("authorizedExternalNetworks")) { - if (!Array.isArray(message.authorizedExternalNetworks)) - return "authorizedExternalNetworks: array expected"; - for (var i = 0; i < message.authorizedExternalNetworks.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify(message.authorizedExternalNetworks[i]); - if (error) - return "authorizedExternalNetworks." + error; - } - } - if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) - if (typeof message.enablePublicIp !== "boolean") - return "enablePublicIp: boolean expected"; - if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) - if (typeof message.enableOutboundPublicIp !== "boolean") - return "enableOutboundPublicIp: boolean expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) - if (!$util.isString(message.allocatedIpRangeOverride)) - return "allocatedIpRangeOverride: string expected"; - return null; - }; - - /** - * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} InstanceNetworkConfig - */ - InstanceNetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig(); - if (object.authorizedExternalNetworks) { - if (!Array.isArray(object.authorizedExternalNetworks)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.authorizedExternalNetworks: array expected"); - message.authorizedExternalNetworks = []; - for (var i = 0; i < object.authorizedExternalNetworks.length; ++i) { - if (typeof object.authorizedExternalNetworks[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.authorizedExternalNetworks: object expected"); - message.authorizedExternalNetworks[i] = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.fromObject(object.authorizedExternalNetworks[i]); - } - } - if (object.enablePublicIp != null) - message.enablePublicIp = Boolean(object.enablePublicIp); - if (object.enableOutboundPublicIp != null) - message.enableOutboundPublicIp = Boolean(object.enableOutboundPublicIp); - if (object.network != null) - message.network = String(object.network); - if (object.allocatedIpRangeOverride != null) - message.allocatedIpRangeOverride = String(object.allocatedIpRangeOverride); - return message; - }; - - /** - * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig} message InstanceNetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceNetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.authorizedExternalNetworks = []; - if (options.defaults) { - object.enablePublicIp = false; - object.enableOutboundPublicIp = false; - object.network = ""; - object.allocatedIpRangeOverride = ""; - } - if (message.authorizedExternalNetworks && message.authorizedExternalNetworks.length) { - object.authorizedExternalNetworks = []; - for (var j = 0; j < message.authorizedExternalNetworks.length; ++j) - object.authorizedExternalNetworks[j] = $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.toObject(message.authorizedExternalNetworks[j], options); - } - if (message.enablePublicIp != null && message.hasOwnProperty("enablePublicIp")) - object.enablePublicIp = message.enablePublicIp; - if (message.enableOutboundPublicIp != null && message.hasOwnProperty("enableOutboundPublicIp")) - object.enableOutboundPublicIp = message.enableOutboundPublicIp; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.allocatedIpRangeOverride != null && message.hasOwnProperty("allocatedIpRangeOverride")) - object.allocatedIpRangeOverride = message.allocatedIpRangeOverride; - return object; - }; - - /** - * Converts this InstanceNetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceNetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceNetworkConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceNetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig"; - }; - - InstanceNetworkConfig.AuthorizedNetwork = (function() { - - /** - * Properties of an AuthorizedNetwork. - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @interface IAuthorizedNetwork - * @property {string|null} [cidrRange] AuthorizedNetwork cidrRange - */ - - /** - * Constructs a new AuthorizedNetwork. - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig - * @classdesc Represents an AuthorizedNetwork. - * @implements IAuthorizedNetwork - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set - */ - function AuthorizedNetwork(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuthorizedNetwork cidrRange. - * @member {string} cidrRange - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @instance - */ - AuthorizedNetwork.prototype.cidrRange = ""; - - /** - * Creates a new AuthorizedNetwork instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork instance - */ - AuthorizedNetwork.create = function create(properties) { - return new AuthorizedNetwork(properties); - }; - - /** - * Encodes the specified AuthorizedNetwork message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthorizedNetwork.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cidrRange != null && Object.hasOwnProperty.call(message, "cidrRange")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cidrRange); - return writer; - }; - - /** - * Encodes the specified AuthorizedNetwork message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.IAuthorizedNetwork} message AuthorizedNetwork message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthorizedNetwork.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthorizedNetwork.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cidrRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuthorizedNetwork message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthorizedNetwork.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuthorizedNetwork message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuthorizedNetwork.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) - if (!$util.isString(message.cidrRange)) - return "cidrRange: string expected"; - return null; - }; - - /** - * Creates an AuthorizedNetwork message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} AuthorizedNetwork - */ - AuthorizedNetwork.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork(); - if (object.cidrRange != null) - message.cidrRange = String(object.cidrRange); - return message; - }; - - /** - * Creates a plain object from an AuthorizedNetwork message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork} message AuthorizedNetwork - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuthorizedNetwork.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cidrRange = ""; - if (message.cidrRange != null && message.hasOwnProperty("cidrRange")) - object.cidrRange = message.cidrRange; - return object; - }; - - /** - * Converts this AuthorizedNetwork to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @instance - * @returns {Object.} JSON object - */ - AuthorizedNetwork.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuthorizedNetwork - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuthorizedNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork"; - }; - - return AuthorizedNetwork; - })(); - - return InstanceNetworkConfig; - })(); - - Instance.ConnectionPoolConfig = (function() { - - /** - * Properties of a ConnectionPoolConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @interface IConnectionPoolConfig - * @property {boolean|null} [enabled] ConnectionPoolConfig enabled - * @property {Object.|null} [flags] ConnectionPoolConfig flags - * @property {number|null} [poolerCount] ConnectionPoolConfig poolerCount - */ - - /** - * Constructs a new ConnectionPoolConfig. - * @memberof google.cloud.alloydb.v1beta.Instance - * @classdesc Represents a ConnectionPoolConfig. - * @implements IConnectionPoolConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig=} [properties] Properties to set - */ - function ConnectionPoolConfig(properties) { - this.flags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionPoolConfig enabled. - * @member {boolean} enabled - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.enabled = false; - - /** - * ConnectionPoolConfig flags. - * @member {Object.} flags - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.flags = $util.emptyObject; - - /** - * ConnectionPoolConfig poolerCount. - * @member {number} poolerCount - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @instance - */ - ConnectionPoolConfig.prototype.poolerCount = 0; - - /** - * Creates a new ConnectionPoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig instance - */ - ConnectionPoolConfig.create = function create(properties) { - return new ConnectionPoolConfig(properties); - }; - - /** - * Encodes the specified ConnectionPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enabled); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) - for (var keys = Object.keys(message.flags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.flags[keys[i]]).ldelim(); - if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.poolerCount); - return writer; - }; - - /** - * Encodes the specified ConnectionPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.IConnectionPoolConfig} message ConnectionPoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 12: { - message.enabled = reader.bool(); - break; - } - case 13: { - if (message.flags === $util.emptyObject) - message.flags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.flags[key] = value; - break; - } - case 14: { - message.poolerCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionPoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionPoolConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionPoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isObject(message.flags)) - return "flags: object expected"; - var key = Object.keys(message.flags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.flags[key[i]])) - return "flags: string{k:string} expected"; - } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) - if (!$util.isInteger(message.poolerCount)) - return "poolerCount: integer expected"; - return null; - }; - - /** - * Creates a ConnectionPoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} ConnectionPoolConfig - */ - ConnectionPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig(); - if (object.enabled != null) - message.enabled = Boolean(object.enabled); - if (object.flags) { - if (typeof object.flags !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.flags: object expected"); - message.flags = {}; - for (var keys = Object.keys(object.flags), i = 0; i < keys.length; ++i) - message.flags[keys[i]] = String(object.flags[keys[i]]); - } - if (object.poolerCount != null) - message.poolerCount = object.poolerCount | 0; - return message; - }; - - /** - * Creates a plain object from a ConnectionPoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig} message ConnectionPoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionPoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.flags = {}; - if (options.defaults) { - object.enabled = false; - object.poolerCount = 0; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = message.enabled; - var keys2; - if (message.flags && (keys2 = Object.keys(message.flags)).length) { - object.flags = {}; - for (var j = 0; j < keys2.length; ++j) - object.flags[keys2[j]] = message.flags[keys2[j]]; - } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) - object.poolerCount = message.poolerCount; - return object; - }; - - /** - * Converts this ConnectionPoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @instance - * @returns {Object.} JSON object - */ - ConnectionPoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectionPoolConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectionPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig"; - }; - - return ConnectionPoolConfig; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1beta.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} STOPPED=2 STOPPED value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} MAINTENANCE=5 MAINTENANCE value - * @property {number} FAILED=6 FAILED value - * @property {number} BOOTSTRAPPING=8 BOOTSTRAPPING value - * @property {number} PROMOTING=9 PROMOTING value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "STOPPED"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "MAINTENANCE"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[8] = "BOOTSTRAPPING"] = 8; - values[valuesById[9] = "PROMOTING"] = 9; - return values; - })(); - - /** - * InstanceType enum. - * @name google.cloud.alloydb.v1beta.Instance.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} READ_POOL=2 READ_POOL value - * @property {number} SECONDARY=3 SECONDARY value - */ - Instance.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "READ_POOL"] = 2; - values[valuesById[3] = "SECONDARY"] = 3; - return values; - })(); - - /** - * AvailabilityType enum. - * @name google.cloud.alloydb.v1beta.Instance.AvailabilityType - * @enum {number} - * @property {number} AVAILABILITY_TYPE_UNSPECIFIED=0 AVAILABILITY_TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value - */ - Instance.AvailabilityType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; - return values; - })(); - - /** - * ActivationPolicy enum. - * @name google.cloud.alloydb.v1beta.Instance.ActivationPolicy - * @enum {number} - * @property {number} ACTIVATION_POLICY_UNSPECIFIED=0 ACTIVATION_POLICY_UNSPECIFIED value - * @property {number} ALWAYS=1 ALWAYS value - * @property {number} NEVER=2 NEVER value - */ - Instance.ActivationPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTIVATION_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALWAYS"] = 1; - values[valuesById[2] = "NEVER"] = 2; - return values; - })(); - - return Instance; - })(); - - v1beta.ConnectionInfo = (function() { - - /** - * Properties of a ConnectionInfo. - * @memberof google.cloud.alloydb.v1beta - * @interface IConnectionInfo - * @property {string|null} [name] ConnectionInfo name - * @property {string|null} [ipAddress] ConnectionInfo ipAddress - * @property {string|null} [publicIpAddress] ConnectionInfo publicIpAddress - * @property {Array.|null} [pemCertificateChain] ConnectionInfo pemCertificateChain - * @property {string|null} [instanceUid] ConnectionInfo instanceUid - * @property {string|null} [pscDnsName] ConnectionInfo pscDnsName - */ - - /** - * Constructs a new ConnectionInfo. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ConnectionInfo. - * @implements IConnectionInfo - * @constructor - * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set - */ - function ConnectionInfo(properties) { - this.pemCertificateChain = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionInfo name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.name = ""; - - /** - * ConnectionInfo ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.ipAddress = ""; - - /** - * ConnectionInfo publicIpAddress. - * @member {string} publicIpAddress - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.publicIpAddress = ""; - - /** - * ConnectionInfo pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.pemCertificateChain = $util.emptyArray; - - /** - * ConnectionInfo instanceUid. - * @member {string} instanceUid - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.instanceUid = ""; - - /** - * ConnectionInfo pscDnsName. - * @member {string} pscDnsName - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - */ - ConnectionInfo.prototype.pscDnsName = ""; - - /** - * Creates a new ConnectionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IConnectionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo instance - */ - ConnectionInfo.create = function create(properties) { - return new ConnectionInfo(properties); - }; - - /** - * Encodes the specified ConnectionInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCertificateChain[i]); - if (message.instanceUid != null && Object.hasOwnProperty.call(message, "instanceUid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.instanceUid); - if (message.publicIpAddress != null && Object.hasOwnProperty.call(message, "publicIpAddress")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicIpAddress); - if (message.pscDnsName != null && Object.hasOwnProperty.call(message, "pscDnsName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pscDnsName); - return writer; - }; - - /** - * Encodes the specified ConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ConnectionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.IConnectionInfo} message ConnectionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.ipAddress = reader.string(); - break; - } - case 5: { - message.publicIpAddress = reader.string(); - break; - } - case 3: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 4: { - message.instanceUid = reader.string(); - break; - } - case 6: { - message.pscDnsName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - if (!$util.isString(message.publicIpAddress)) - return "publicIpAddress: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - if (!$util.isString(message.instanceUid)) - return "instanceUid: string expected"; - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - if (!$util.isString(message.pscDnsName)) - return "pscDnsName: string expected"; - return null; - }; - - /** - * Creates a ConnectionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ConnectionInfo} ConnectionInfo - */ - ConnectionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ConnectionInfo) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ConnectionInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.publicIpAddress != null) - message.publicIpAddress = String(object.publicIpAddress); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1beta.ConnectionInfo.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.instanceUid != null) - message.instanceUid = String(object.instanceUid); - if (object.pscDnsName != null) - message.pscDnsName = String(object.pscDnsName); - return message; - }; - - /** - * Creates a plain object from a ConnectionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {google.cloud.alloydb.v1beta.ConnectionInfo} message ConnectionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) { - object.name = ""; - object.ipAddress = ""; - object.instanceUid = ""; - object.publicIpAddress = ""; - object.pscDnsName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - object.instanceUid = message.instanceUid; - if (message.publicIpAddress != null && message.hasOwnProperty("publicIpAddress")) - object.publicIpAddress = message.publicIpAddress; - if (message.pscDnsName != null && message.hasOwnProperty("pscDnsName")) - object.pscDnsName = message.pscDnsName; - return object; - }; - - /** - * Converts this ConnectionInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @instance - * @returns {Object.} JSON object - */ - ConnectionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConnectionInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ConnectionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ConnectionInfo"; - }; - - return ConnectionInfo; - })(); - - v1beta.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.cloud.alloydb.v1beta - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [displayName] Backup displayName - * @property {string|null} [uid] Backup uid - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Backup deleteTime - * @property {google.protobuf.ITimestamp|null} [createCompletionTime] Backup createCompletionTime - * @property {Object.|null} [labels] Backup labels - * @property {google.cloud.alloydb.v1beta.Backup.State|null} [state] Backup state - * @property {google.cloud.alloydb.v1beta.Backup.Type|null} [type] Backup type - * @property {string|null} [description] Backup description - * @property {string|null} [clusterUid] Backup clusterUid - * @property {string|null} [clusterName] Backup clusterName - * @property {boolean|null} [reconciling] Backup reconciling - * @property {google.cloud.alloydb.v1beta.IEncryptionConfig|null} [encryptionConfig] Backup encryptionConfig - * @property {google.cloud.alloydb.v1beta.IEncryptionInfo|null} [encryptionInfo] Backup encryptionInfo - * @property {string|null} [etag] Backup etag - * @property {Object.|null} [annotations] Backup annotations - * @property {number|Long|null} [sizeBytes] Backup sizeBytes - * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime - * @property {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity - * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Backup databaseVersion - * @property {Object.|null} [tags] Backup tags - */ - - /** - * Constructs a new Backup. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set - */ - function Backup(properties) { - this.labels = {}; - this.annotations = {}; - this.tags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.displayName = ""; - - /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.uid = ""; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.updateTime = null; - - /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.deleteTime = null; - - /** - * Backup createCompletionTime. - * @member {google.protobuf.ITimestamp|null|undefined} createCompletionTime - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.createCompletionTime = null; - - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; - - /** - * Backup state. - * @member {google.cloud.alloydb.v1beta.Backup.State} state - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup type. - * @member {google.cloud.alloydb.v1beta.Backup.Type} type - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.type = 0; - - /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.description = ""; - - /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.clusterUid = ""; - - /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.clusterName = ""; - - /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.reconciling = false; - - /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1beta.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.encryptionConfig = null; - - /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1beta.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.encryptionInfo = null; - - /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.etag = ""; - - /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.annotations = $util.emptyObject; - - /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.expiryTime = null; - - /** - * Backup expiryQuantity. - * @member {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.expiryQuantity = null; - - /** - * Backup satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.satisfiesPzs = false; - - /** - * Backup databaseVersion. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.databaseVersion = 0; - - /** - * Backup tags. - * @member {Object.} tags - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - */ - Backup.prototype.tags = $util.emptyObject; - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterName); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.reconciling); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.alloydb.v1beta.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.cloud.alloydb.v1beta.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.sizeBytes); - if (message.clusterUid != null && Object.hasOwnProperty.call(message, "clusterUid")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); - if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) - $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); - if (message.createCompletionTime != null && Object.hasOwnProperty.call(message, "createCompletionTime")) - $root.google.protobuf.Timestamp.encode(message.createCompletionTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 26: { - message.createCompletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.description = reader.string(); - break; - } - case 18: { - message.clusterUid = reader.string(); - break; - } - case 10: { - message.clusterName = reader.string(); - break; - } - case 11: { - message.reconciling = reader.bool(); - break; - } - case 12: { - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.decode(reader, reader.uint32()); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 16: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 17: { - message.sizeBytes = reader.int64(); - break; - } - case 19: { - message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 20: { - message.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); - break; - } - case 21: { - message.satisfiesPzs = reader.bool(); - break; - } - case 22: { - message.databaseVersion = reader.int32(); - break; - } - case 25: { - if (message.tags === $util.emptyObject) - message.tags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.tags[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Backup message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Backup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createCompletionTime); - if (error) - return "createCompletionTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - if (!$util.isString(message.clusterUid)) - return "clusterUid: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { - var error = $root.google.cloud.alloydb.v1beta.EncryptionInfo.verify(message.encryptionInfo); - if (error) - return "encryptionInfo." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) - return "sizeBytes: integer|Long expected"; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expiryTime); - if (error) - return "expiryTime." + error; - } - if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { - var error = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); - if (error) - return "expiryQuantity." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!$util.isObject(message.tags)) - return "tags: object expected"; - var key = Object.keys(message.tags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.tags[key[i]])) - return "tags: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Backup} Backup - */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Backup) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Backup(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.createCompletionTime != null) { - if (typeof object.createCompletionTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.createCompletionTime: object expected"); - message.createCompletionTime = $root.google.protobuf.Timestamp.fromObject(object.createCompletionTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "READY": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ON_DEMAND": - case 1: - message.type = 1; - break; - case "AUTOMATED": - case 2: - message.type = 2; - break; - case "CONTINUOUS": - case 3: - message.type = 3; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.clusterUid != null) - message.clusterUid = String(object.clusterUid); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.encryptionInfo: object expected"); - message.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.fromObject(object.encryptionInfo); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.sizeBytes != null) - if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; - else if (typeof object.sizeBytes === "string") - message.sizeBytes = parseInt(object.sizeBytes, 10); - else if (typeof object.sizeBytes === "number") - message.sizeBytes = object.sizeBytes; - else if (typeof object.sizeBytes === "object") - message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); - if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryTime: object expected"); - message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); - } - if (object.expiryQuantity != null) { - if (typeof object.expiryQuantity !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryQuantity: object expected"); - message.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.databaseVersion = 6; - break; - } - if (object.tags) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.Backup.tags: object expected"); - message.tags = {}; - for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) - message.tags[keys[i]] = String(object.tags[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {google.cloud.alloydb.v1beta.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - object.tags = {}; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.uid = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.description = ""; - object.clusterName = ""; - object.reconciling = false; - object.encryptionConfig = null; - object.encryptionInfo = null; - object.etag = ""; - object.deleteTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeBytes = options.longs === String ? "0" : 0; - object.clusterUid = ""; - object.expiryTime = null; - object.expiryQuantity = null; - object.satisfiesPzs = false; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.createCompletionTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.Backup.State[message.state] : message.state; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Backup.Type[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1beta.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.cloud.alloydb.v1beta.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") - object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; - else - object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.clusterUid != null && message.hasOwnProperty("clusterUid")) - object.clusterUid = message.clusterUid; - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); - if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) - object.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.tags && (keys2 = Object.keys(message.tags)).length) { - object.tags = {}; - for (var j = 0; j < keys2.length; ++j) - object.tags[keys2[j]] = message.tags[keys2[j]]; - } - if (message.createCompletionTime != null && message.hasOwnProperty("createCompletionTime")) - object.createCompletionTime = $root.google.protobuf.Timestamp.toObject(message.createCompletionTime, options); - return object; - }; - - /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Backup - * @instance - * @returns {Object.} JSON object - */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup"; - }; - - Backup.QuantityBasedExpiry = (function() { - - /** - * Properties of a QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1beta.Backup - * @interface IQuantityBasedExpiry - * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount - * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount - */ - - /** - * Constructs a new QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1beta.Backup - * @classdesc Represents a QuantityBasedExpiry. - * @implements IQuantityBasedExpiry - * @constructor - * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry=} [properties] Properties to set - */ - function QuantityBasedExpiry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuantityBasedExpiry retentionCount. - * @member {number} retentionCount - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @instance - */ - QuantityBasedExpiry.prototype.retentionCount = 0; - - /** - * QuantityBasedExpiry totalRetentionCount. - * @member {number} totalRetentionCount - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @instance - */ - QuantityBasedExpiry.prototype.totalRetentionCount = 0; - - /** - * Creates a new QuantityBasedExpiry instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance - */ - QuantityBasedExpiry.create = function create(properties) { - return new QuantityBasedExpiry(properties); - }; - - /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedExpiry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); - if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); - return writer; - }; - - /** - * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedExpiry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionCount = reader.int32(); - break; - } - case 2: { - message.totalRetentionCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuantityBasedExpiry message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuantityBasedExpiry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - if (!$util.isInteger(message.retentionCount)) - return "retentionCount: integer expected"; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - if (!$util.isInteger(message.totalRetentionCount)) - return "totalRetentionCount: integer expected"; - return null; - }; - - /** - * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry - */ - QuantityBasedExpiry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry(); - if (object.retentionCount != null) - message.retentionCount = object.retentionCount | 0; - if (object.totalRetentionCount != null) - message.totalRetentionCount = object.totalRetentionCount | 0; - return message; - }; - - /** - * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} message QuantityBasedExpiry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuantityBasedExpiry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.retentionCount = 0; - object.totalRetentionCount = 0; - } - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - object.retentionCount = message.retentionCount; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - object.totalRetentionCount = message.totalRetentionCount; - return object; - }; - - /** - * Converts this QuantityBasedExpiry to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @instance - * @returns {Object.} JSON object - */ - QuantityBasedExpiry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QuantityBasedExpiry - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry"; - }; - - return QuantityBasedExpiry; - })(); - - /** - * State enum. - * @name google.cloud.alloydb.v1beta.Backup.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} FAILED=3 FAILED value - * @property {number} DELETING=4 DELETING value - */ - Backup.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "DELETING"] = 4; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.alloydb.v1beta.Backup.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ON_DEMAND=1 ON_DEMAND value - * @property {number} AUTOMATED=2 AUTOMATED value - * @property {number} CONTINUOUS=3 CONTINUOUS value - */ - Backup.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ON_DEMAND"] = 1; - values[valuesById[2] = "AUTOMATED"] = 2; - values[valuesById[3] = "CONTINUOUS"] = 3; - return values; - })(); - - return Backup; - })(); - - v1beta.SupportedDatabaseFlag = (function() { - - /** - * Properties of a SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1beta - * @interface ISupportedDatabaseFlag - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null} [stringRestrictions] SupportedDatabaseFlag stringRestrictions - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null} [integerRestrictions] SupportedDatabaseFlag integerRestrictions - * @property {string|null} [recommendedStringValue] SupportedDatabaseFlag recommendedStringValue - * @property {google.protobuf.IInt64Value|null} [recommendedIntegerValue] SupportedDatabaseFlag recommendedIntegerValue - * @property {string|null} [name] SupportedDatabaseFlag name - * @property {string|null} [flagName] SupportedDatabaseFlag flagName - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType|null} [valueType] SupportedDatabaseFlag valueType - * @property {boolean|null} [acceptsMultipleValues] SupportedDatabaseFlag acceptsMultipleValues - * @property {Array.|null} [supportedDbVersions] SupportedDatabaseFlag supportedDbVersions - * @property {boolean|null} [requiresDbRestart] SupportedDatabaseFlag requiresDbRestart - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null} [scope] SupportedDatabaseFlag scope - */ - - /** - * Constructs a new SupportedDatabaseFlag. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag - * @constructor - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set - */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; - - /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; - - /** - * SupportedDatabaseFlag recommendedStringValue. - * @member {string|null|undefined} recommendedStringValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.recommendedStringValue = null; - - /** - * SupportedDatabaseFlag recommendedIntegerValue. - * @member {google.protobuf.IInt64Value|null|undefined} recommendedIntegerValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.recommendedIntegerValue = null; - - /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.name = ""; - - /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.flagName = ""; - - /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.valueType = 0; - - /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; - - /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; - - /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; - - /** - * SupportedDatabaseFlag scope. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} scope - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - SupportedDatabaseFlag.prototype.scope = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SupportedDatabaseFlag recommendedValue. - * @member {"recommendedStringValue"|"recommendedIntegerValue"|undefined} recommendedValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "recommendedValue", { - get: $util.oneOfGetter($oneOfFields = ["recommendedStringValue", "recommendedIntegerValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag instance - */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); - }; - - /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.flagName != null && Object.hasOwnProperty.call(message, "flagName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.flagName); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.valueType); - if (message.acceptsMultipleValues != null && Object.hasOwnProperty.call(message, "acceptsMultipleValues")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.acceptsMultipleValues); - if (message.supportedDbVersions != null && message.supportedDbVersions.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedDbVersions.length; ++i) - writer.int32(message.supportedDbVersions[i]); - writer.ldelim(); - } - if (message.requiresDbRestart != null && Object.hasOwnProperty.call(message, "requiresDbRestart")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requiresDbRestart); - if (message.stringRestrictions != null && Object.hasOwnProperty.call(message, "stringRestrictions")) - $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.encode(message.stringRestrictions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.integerRestrictions != null && Object.hasOwnProperty.call(message, "integerRestrictions")) - $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.encode(message.integerRestrictions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); - if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.recommendedStringValue); - if (message.recommendedIntegerValue != null && Object.hasOwnProperty.call(message, "recommendedIntegerValue")) - $root.google.protobuf.Int64Value.encode(message.recommendedIntegerValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1beta.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 7: { - message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.decode(reader, reader.uint32()); - break; - } - case 8: { - message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.decode(reader, reader.uint32()); - break; - } - case 10: { - message.recommendedStringValue = reader.string(); - break; - } - case 11: { - message.recommendedIntegerValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.flagName = reader.string(); - break; - } - case 3: { - message.valueType = reader.int32(); - break; - } - case 4: { - message.acceptsMultipleValues = reader.bool(); - break; - } - case 5: { - if (!(message.supportedDbVersions && message.supportedDbVersions.length)) - message.supportedDbVersions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.supportedDbVersions.push(reader.int32()); - } else - message.supportedDbVersions.push(reader.int32()); - break; - } - case 6: { - message.requiresDbRestart = reader.bool(); - break; - } - case 9: { - message.scope = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SupportedDatabaseFlag message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SupportedDatabaseFlag.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify(message.stringRestrictions); - if (error) - return "stringRestrictions." + error; - } - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - if (properties.restrictions === 1) - return "restrictions: multiple values"; - properties.restrictions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify(message.integerRestrictions); - if (error) - return "integerRestrictions." + error; - } - } - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { - properties.recommendedValue = 1; - if (!$util.isString(message.recommendedStringValue)) - return "recommendedStringValue: string expected"; - } - if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { - if (properties.recommendedValue === 1) - return "recommendedValue: multiple values"; - properties.recommendedValue = 1; - { - var error = $root.google.protobuf.Int64Value.verify(message.recommendedIntegerValue); - if (error) - return "recommendedIntegerValue." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.flagName != null && message.hasOwnProperty("flagName")) - if (!$util.isString(message.flagName)) - return "flagName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - if (typeof message.acceptsMultipleValues !== "boolean") - return "acceptsMultipleValues: boolean expected"; - if (message.supportedDbVersions != null && message.hasOwnProperty("supportedDbVersions")) { - if (!Array.isArray(message.supportedDbVersions)) - return "supportedDbVersions: array expected"; - for (var i = 0; i < message.supportedDbVersions.length; ++i) - switch (message.supportedDbVersions[i]) { - default: - return "supportedDbVersions: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} SupportedDatabaseFlag - */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag(); - if (object.stringRestrictions != null) { - if (typeof object.stringRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.stringRestrictions: object expected"); - message.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.fromObject(object.stringRestrictions); - } - if (object.integerRestrictions != null) { - if (typeof object.integerRestrictions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.integerRestrictions: object expected"); - message.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.fromObject(object.integerRestrictions); - } - if (object.recommendedStringValue != null) - message.recommendedStringValue = String(object.recommendedStringValue); - if (object.recommendedIntegerValue != null) { - if (typeof object.recommendedIntegerValue !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.recommendedIntegerValue: object expected"); - message.recommendedIntegerValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntegerValue); - } - if (object.name != null) - message.name = String(object.name); - if (object.flagName != null) - message.flagName = String(object.flagName); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "STRING": - case 1: - message.valueType = 1; - break; - case "INTEGER": - case 2: - message.valueType = 2; - break; - case "FLOAT": - case 3: - message.valueType = 3; - break; - case "NONE": - case 4: - message.valueType = 4; - break; - } - if (object.acceptsMultipleValues != null) - message.acceptsMultipleValues = Boolean(object.acceptsMultipleValues); - if (object.supportedDbVersions) { - if (!Array.isArray(object.supportedDbVersions)) - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.supportedDbVersions: array expected"); - message.supportedDbVersions = []; - for (var i = 0; i < object.supportedDbVersions.length; ++i) - switch (object.supportedDbVersions[i]) { - default: - if (typeof object.supportedDbVersions[i] === "number") { - message.supportedDbVersions[i] = object.supportedDbVersions[i]; - break; - } - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.supportedDbVersions[i] = 0; - break; - case "POSTGRES_13": - case 1: - message.supportedDbVersions[i] = 1; - break; - case "POSTGRES_14": - case 2: - message.supportedDbVersions[i] = 2; - break; - case "POSTGRES_15": - case 3: - message.supportedDbVersions[i] = 3; - break; - case "POSTGRES_16": - case 4: - message.supportedDbVersions[i] = 4; - break; - case "POSTGRES_17": - case 5: - message.supportedDbVersions[i] = 5; - break; - case "POSTGRES_18": - case 6: - message.supportedDbVersions[i] = 6; - break; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "DATABASE": - case 1: - message.scope = 1; - break; - case "CONNECTION_POOL": - case 2: - message.scope = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag} message SupportedDatabaseFlag - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDbVersions = []; - if (options.defaults) { - object.name = ""; - object.flagName = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.acceptsMultipleValues = false; - object.requiresDbRestart = false; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.flagName != null && message.hasOwnProperty("flagName")) - object.flagName = message.flagName; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType[message.valueType] : message.valueType; - if (message.acceptsMultipleValues != null && message.hasOwnProperty("acceptsMultipleValues")) - object.acceptsMultipleValues = message.acceptsMultipleValues; - if (message.supportedDbVersions && message.supportedDbVersions.length) { - object.supportedDbVersions = []; - for (var j = 0; j < message.supportedDbVersions.length; ++j) - object.supportedDbVersions[j] = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] === undefined ? message.supportedDbVersions[j] : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.supportedDbVersions[j]] : message.supportedDbVersions[j]; - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - object.requiresDbRestart = message.requiresDbRestart; - if (message.stringRestrictions != null && message.hasOwnProperty("stringRestrictions")) { - object.stringRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.toObject(message.stringRestrictions, options); - if (options.oneofs) - object.restrictions = "stringRestrictions"; - } - if (message.integerRestrictions != null && message.hasOwnProperty("integerRestrictions")) { - object.integerRestrictions = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.toObject(message.integerRestrictions, options); - if (options.oneofs) - object.restrictions = "integerRestrictions"; - } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] : message.scope; - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { - object.recommendedStringValue = message.recommendedStringValue; - if (options.oneofs) - object.recommendedValue = "recommendedStringValue"; - } - if (message.recommendedIntegerValue != null && message.hasOwnProperty("recommendedIntegerValue")) { - object.recommendedIntegerValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntegerValue, options); - if (options.oneofs) - object.recommendedValue = "recommendedIntegerValue"; - } - return object; - }; - - /** - * Converts this SupportedDatabaseFlag to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @instance - * @returns {Object.} JSON object - */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SupportedDatabaseFlag - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag"; - }; - - SupportedDatabaseFlag.StringRestrictions = (function() { - - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ - - /** - * Constructs a new StringRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @classdesc Represents a StringRestrictions. - * @implements IStringRestrictions - * @constructor - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - */ - function StringRestrictions(properties) { - this.allowedValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; - - /** - * Creates a new StringRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions instance - */ - StringRestrictions.create = function create(properties) { - return new StringRestrictions(properties); - }; - - /** - * Encodes the specified StringRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedValues != null && message.allowedValues.length) - for (var i = 0; i < message.allowedValues.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); - return writer; - }; - - /** - * Encodes the specified StringRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IStringRestrictions} message StringRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.allowedValues && message.allowedValues.length)) - message.allowedValues = []; - message.allowedValues.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { - if (!Array.isArray(message.allowedValues)) - return "allowedValues: array expected"; - for (var i = 0; i < message.allowedValues.length; ++i) - if (!$util.isString(message.allowedValues[i])) - return "allowedValues: string[] expected"; - } - return null; - }; - - /** - * Creates a StringRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} StringRestrictions - */ - StringRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions(); - if (object.allowedValues) { - if (!Array.isArray(object.allowedValues)) - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions.allowedValues: array expected"); - message.allowedValues = []; - for (var i = 0; i < object.allowedValues.length; ++i) - message.allowedValues[i] = String(object.allowedValues[i]); - } - return message; - }; - - /** - * Creates a plain object from a StringRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions} message StringRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedValues = []; - if (message.allowedValues && message.allowedValues.length) { - object.allowedValues = []; - for (var j = 0; j < message.allowedValues.length; ++j) - object.allowedValues[j] = message.allowedValues[j]; - } - return object; - }; - - /** - * Converts this StringRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @instance - * @returns {Object.} JSON object - */ - StringRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions"; - }; - - return StringRestrictions; - })(); - - SupportedDatabaseFlag.IntegerRestrictions = (function() { - - /** - * Properties of an IntegerRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @interface IIntegerRestrictions - * @property {google.protobuf.IInt64Value|null} [minValue] IntegerRestrictions minValue - * @property {google.protobuf.IInt64Value|null} [maxValue] IntegerRestrictions maxValue - */ - - /** - * Constructs a new IntegerRestrictions. - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag - * @classdesc Represents an IntegerRestrictions. - * @implements IIntegerRestrictions - * @constructor - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - */ - function IntegerRestrictions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.minValue = null; - - /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.maxValue = null; - - /** - * Creates a new IntegerRestrictions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance - */ - IntegerRestrictions.create = function create(properties) { - return new IntegerRestrictions(properties); - }; - - /** - * Encodes the specified IntegerRestrictions message. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IntegerRestrictions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IIntegerRestrictions} message IntegerRestrictions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 2: { - message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntegerRestrictions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntegerRestrictions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minValue != null && message.hasOwnProperty("minValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.minValue); - if (error) - return "minValue." + error; - } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { - var error = $root.google.protobuf.Int64Value.verify(message.maxValue); - if (error) - return "maxValue." + error; - } - return null; - }; - - /** - * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions - */ - IntegerRestrictions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions(); - if (object.minValue != null) { - if (typeof object.minValue !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.minValue: object expected"); - message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue); - } - if (object.maxValue != null) { - if (typeof object.maxValue !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions.maxValue: object expected"); - message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue); - } - return message; - }; - - /** - * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntegerRestrictions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minValue = null; - object.maxValue = null; - } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); - return object; - }; - - /** - * Converts this IntegerRestrictions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @instance - * @returns {Object.} JSON object - */ - IntegerRestrictions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IntegerRestrictions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions"; - }; - - return IntegerRestrictions; - })(); - - /** - * ValueType enum. - * @name google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} STRING=1 STRING value - * @property {number} INTEGER=2 INTEGER value - * @property {number} FLOAT=3 FLOAT value - * @property {number} NONE=4 NONE value - */ - SupportedDatabaseFlag.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRING"] = 1; - values[valuesById[2] = "INTEGER"] = 2; - values[valuesById[3] = "FLOAT"] = 3; - values[valuesById[4] = "NONE"] = 4; - return values; - })(); - - /** - * Scope enum. - * @name google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope - * @enum {number} - * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value - * @property {number} DATABASE=1 DATABASE value - * @property {number} CONNECTION_POOL=2 CONNECTION_POOL value - */ - SupportedDatabaseFlag.Scope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATABASE"] = 1; - values[valuesById[2] = "CONNECTION_POOL"] = 2; - return values; - })(); - - return SupportedDatabaseFlag; - })(); - - v1beta.User = (function() { - - /** - * Properties of a User. - * @memberof google.cloud.alloydb.v1beta - * @interface IUser - * @property {string|null} [name] User name - * @property {string|null} [password] User password - * @property {Array.|null} [databaseRoles] User databaseRoles - * @property {google.cloud.alloydb.v1beta.User.UserType|null} [userType] User userType - * @property {boolean|null} [keepExtraRoles] User keepExtraRoles - */ - - /** - * Constructs a new User. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a User. - * @implements IUser - * @constructor - * @param {google.cloud.alloydb.v1beta.IUser=} [properties] Properties to set - */ - function User(properties) { - this.databaseRoles = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * User name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.User - * @instance - */ - User.prototype.name = ""; - - /** - * User password. - * @member {string} password - * @memberof google.cloud.alloydb.v1beta.User - * @instance - */ - User.prototype.password = ""; - - /** - * User databaseRoles. - * @member {Array.} databaseRoles - * @memberof google.cloud.alloydb.v1beta.User - * @instance - */ - User.prototype.databaseRoles = $util.emptyArray; - - /** - * User userType. - * @member {google.cloud.alloydb.v1beta.User.UserType} userType - * @memberof google.cloud.alloydb.v1beta.User - * @instance - */ - User.prototype.userType = 0; - - /** - * User keepExtraRoles. - * @member {boolean} keepExtraRoles - * @memberof google.cloud.alloydb.v1beta.User - * @instance - */ - User.prototype.keepExtraRoles = false; - - /** - * Creates a new User instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {google.cloud.alloydb.v1beta.IUser=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.User} User instance - */ - User.create = function create(properties) { - return new User(properties); - }; - - /** - * Encodes the specified User message. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {google.cloud.alloydb.v1beta.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); - if (message.databaseRoles != null && message.databaseRoles.length) - for (var i = 0; i < message.databaseRoles.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseRoles[i]); - if (message.userType != null && Object.hasOwnProperty.call(message, "userType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.userType); - if (message.keepExtraRoles != null && Object.hasOwnProperty.call(message, "keepExtraRoles")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.keepExtraRoles); - return writer; - }; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.User.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {google.cloud.alloydb.v1beta.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a User message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.User(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.password = reader.string(); - break; - } - case 4: { - if (!(message.databaseRoles && message.databaseRoles.length)) - message.databaseRoles = []; - message.databaseRoles.push(reader.string()); - break; - } - case 5: { - message.userType = reader.int32(); - break; - } - case 6: { - message.keepExtraRoles = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a User message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - User.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { - if (!Array.isArray(message.databaseRoles)) - return "databaseRoles: array expected"; - for (var i = 0; i < message.databaseRoles.length; ++i) - if (!$util.isString(message.databaseRoles[i])) - return "databaseRoles: string[] expected"; - } - if (message.userType != null && message.hasOwnProperty("userType")) - switch (message.userType) { - default: - return "userType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) - if (typeof message.keepExtraRoles !== "boolean") - return "keepExtraRoles: boolean expected"; - return null; - }; - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.User} User - */ - User.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.User) - return object; - var message = new $root.google.cloud.alloydb.v1beta.User(); - if (object.name != null) - message.name = String(object.name); - if (object.password != null) - message.password = String(object.password); - if (object.databaseRoles) { - if (!Array.isArray(object.databaseRoles)) - throw TypeError(".google.cloud.alloydb.v1beta.User.databaseRoles: array expected"); - message.databaseRoles = []; - for (var i = 0; i < object.databaseRoles.length; ++i) - message.databaseRoles[i] = String(object.databaseRoles[i]); - } - switch (object.userType) { - default: - if (typeof object.userType === "number") { - message.userType = object.userType; - break; - } - break; - case "USER_TYPE_UNSPECIFIED": - case 0: - message.userType = 0; - break; - case "ALLOYDB_BUILT_IN": - case 1: - message.userType = 1; - break; - case "ALLOYDB_IAM_USER": - case 2: - message.userType = 2; - break; - } - if (object.keepExtraRoles != null) - message.keepExtraRoles = Boolean(object.keepExtraRoles); - return message; - }; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {google.cloud.alloydb.v1beta.User} message User - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - User.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databaseRoles = []; - if (options.defaults) { - object.name = ""; - object.password = ""; - object.userType = options.enums === String ? "USER_TYPE_UNSPECIFIED" : 0; - object.keepExtraRoles = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.databaseRoles && message.databaseRoles.length) { - object.databaseRoles = []; - for (var j = 0; j < message.databaseRoles.length; ++j) - object.databaseRoles[j] = message.databaseRoles[j]; - } - if (message.userType != null && message.hasOwnProperty("userType")) - object.userType = options.enums === String ? $root.google.cloud.alloydb.v1beta.User.UserType[message.userType] === undefined ? message.userType : $root.google.cloud.alloydb.v1beta.User.UserType[message.userType] : message.userType; - if (message.keepExtraRoles != null && message.hasOwnProperty("keepExtraRoles")) - object.keepExtraRoles = message.keepExtraRoles; - return object; - }; - - /** - * Converts this User to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.User - * @instance - * @returns {Object.} JSON object - */ - User.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for User - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.User - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.User"; - }; - - /** - * UserType enum. - * @name google.cloud.alloydb.v1beta.User.UserType - * @enum {number} - * @property {number} USER_TYPE_UNSPECIFIED=0 USER_TYPE_UNSPECIFIED value - * @property {number} ALLOYDB_BUILT_IN=1 ALLOYDB_BUILT_IN value - * @property {number} ALLOYDB_IAM_USER=2 ALLOYDB_IAM_USER value - */ - User.UserType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOYDB_BUILT_IN"] = 1; - values[valuesById[2] = "ALLOYDB_IAM_USER"] = 2; - return values; - })(); - - return User; - })(); - - v1beta.Database = (function() { - - /** - * Properties of a Database. - * @memberof google.cloud.alloydb.v1beta - * @interface IDatabase - * @property {string|null} [name] Database name - * @property {string|null} [charset] Database charset - * @property {string|null} [collation] Database collation - * @property {string|null} [characterType] Database characterType - * @property {boolean|null} [isTemplate] Database isTemplate - * @property {string|null} [databaseTemplate] Database databaseTemplate - * @property {boolean|null} [isTemplateDatabase] Database isTemplateDatabase - */ - - /** - * Constructs a new Database. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a Database. - * @implements IDatabase - * @constructor - * @param {google.cloud.alloydb.v1beta.IDatabase=} [properties] Properties to set - */ - function Database(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Database name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.name = ""; - - /** - * Database charset. - * @member {string} charset - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.charset = ""; - - /** - * Database collation. - * @member {string} collation - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.collation = ""; - - /** - * Database characterType. - * @member {string} characterType - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.characterType = ""; - - /** - * Database isTemplate. - * @member {boolean} isTemplate - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.isTemplate = false; - - /** - * Database databaseTemplate. - * @member {string} databaseTemplate - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.databaseTemplate = ""; - - /** - * Database isTemplateDatabase. - * @member {boolean|null|undefined} isTemplateDatabase - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - */ - Database.prototype.isTemplateDatabase = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Database.prototype, "_isTemplateDatabase", { - get: $util.oneOfGetter($oneOfFields = ["isTemplateDatabase"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Database instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {google.cloud.alloydb.v1beta.IDatabase=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.Database} Database instance - */ - Database.create = function create(properties) { - return new Database(properties); - }; - - /** - * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {google.cloud.alloydb.v1beta.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.charset); - if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.collation); - if (message.characterType != null && Object.hasOwnProperty.call(message, "characterType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.characterType); - if (message.isTemplate != null && Object.hasOwnProperty.call(message, "isTemplate")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isTemplate); - if (message.databaseTemplate != null && Object.hasOwnProperty.call(message, "databaseTemplate")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseTemplate); - if (message.isTemplateDatabase != null && Object.hasOwnProperty.call(message, "isTemplateDatabase")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isTemplateDatabase); - return writer; - }; - - /** - * Encodes the specified Database message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Database.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {google.cloud.alloydb.v1beta.IDatabase} message Database message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Database.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Database message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Database(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.charset = reader.string(); - break; - } - case 3: { - message.collation = reader.string(); - break; - } - case 4: { - message.characterType = reader.string(); - break; - } - case 5: { - message.isTemplate = reader.bool(); - break; - } - case 6: { - message.databaseTemplate = reader.string(); - break; - } - case 7: { - message.isTemplateDatabase = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Database message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.Database} Database - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Database.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Database message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Database.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.charset != null && message.hasOwnProperty("charset")) - if (!$util.isString(message.charset)) - return "charset: string expected"; - if (message.collation != null && message.hasOwnProperty("collation")) - if (!$util.isString(message.collation)) - return "collation: string expected"; - if (message.characterType != null && message.hasOwnProperty("characterType")) - if (!$util.isString(message.characterType)) - return "characterType: string expected"; - if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) - if (typeof message.isTemplate !== "boolean") - return "isTemplate: boolean expected"; - if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) - if (!$util.isString(message.databaseTemplate)) - return "databaseTemplate: string expected"; - if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { - properties._isTemplateDatabase = 1; - if (typeof message.isTemplateDatabase !== "boolean") - return "isTemplateDatabase: boolean expected"; - } - return null; - }; - - /** - * Creates a Database message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.Database} Database - */ - Database.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.Database) - return object; - var message = new $root.google.cloud.alloydb.v1beta.Database(); - if (object.name != null) - message.name = String(object.name); - if (object.charset != null) - message.charset = String(object.charset); - if (object.collation != null) - message.collation = String(object.collation); - if (object.characterType != null) - message.characterType = String(object.characterType); - if (object.isTemplate != null) - message.isTemplate = Boolean(object.isTemplate); - if (object.databaseTemplate != null) - message.databaseTemplate = String(object.databaseTemplate); - if (object.isTemplateDatabase != null) - message.isTemplateDatabase = Boolean(object.isTemplateDatabase); - return message; - }; - - /** - * Creates a plain object from a Database message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {google.cloud.alloydb.v1beta.Database} message Database - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Database.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.charset = ""; - object.collation = ""; - object.characterType = ""; - object.isTemplate = false; - object.databaseTemplate = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.charset != null && message.hasOwnProperty("charset")) - object.charset = message.charset; - if (message.collation != null && message.hasOwnProperty("collation")) - object.collation = message.collation; - if (message.characterType != null && message.hasOwnProperty("characterType")) - object.characterType = message.characterType; - if (message.isTemplate != null && message.hasOwnProperty("isTemplate")) - object.isTemplate = message.isTemplate; - if (message.databaseTemplate != null && message.hasOwnProperty("databaseTemplate")) - object.databaseTemplate = message.databaseTemplate; - if (message.isTemplateDatabase != null && message.hasOwnProperty("isTemplateDatabase")) { - object.isTemplateDatabase = message.isTemplateDatabase; - if (options.oneofs) - object._isTemplateDatabase = "isTemplateDatabase"; - } - return object; - }; - - /** - * Converts this Database to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.Database - * @instance - * @returns {Object.} JSON object - */ - Database.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Database - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.Database - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Database"; - }; - - return Database; - })(); - - /** - * GCAEntitlementType enum. - * @name google.cloud.alloydb.v1beta.GCAEntitlementType - * @enum {number} - * @property {number} GCA_ENTITLEMENT_TYPE_UNSPECIFIED=0 GCA_ENTITLEMENT_TYPE_UNSPECIFIED value - * @property {number} GCA_STANDARD=1 GCA_STANDARD value - */ - v1beta.GCAEntitlementType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GCA_ENTITLEMENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "GCA_STANDARD"] = 1; - return values; - })(); - - v1beta.GeminiClusterConfig = (function() { - - /** - * Properties of a GeminiClusterConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IGeminiClusterConfig - * @property {boolean|null} [entitled] GeminiClusterConfig entitled - */ - - /** - * Constructs a new GeminiClusterConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GeminiClusterConfig. - * @implements IGeminiClusterConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig=} [properties] Properties to set - */ - function GeminiClusterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeminiClusterConfig entitled. - * @member {boolean} entitled - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @instance - */ - GeminiClusterConfig.prototype.entitled = false; - - /** - * Creates a new GeminiClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig instance - */ - GeminiClusterConfig.create = function create(properties) { - return new GeminiClusterConfig(properties); - }; - - /** - * Encodes the specified GeminiClusterConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); - return writer; - }; - - /** - * Encodes the specified GeminiClusterConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGeminiClusterConfig} message GeminiClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GeminiClusterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entitled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeminiClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeminiClusterConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeminiClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entitled != null && message.hasOwnProperty("entitled")) - if (typeof message.entitled !== "boolean") - return "entitled: boolean expected"; - return null; - }; - - /** - * Creates a GeminiClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GeminiClusterConfig} GeminiClusterConfig - */ - GeminiClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GeminiClusterConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GeminiClusterConfig(); - if (object.entitled != null) - message.entitled = Boolean(object.entitled); - return message; - }; - - /** - * Creates a plain object from a GeminiClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {google.cloud.alloydb.v1beta.GeminiClusterConfig} message GeminiClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeminiClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.entitled = false; - if (message.entitled != null && message.hasOwnProperty("entitled")) - object.entitled = message.entitled; - return object; - }; - - /** - * Converts this GeminiClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @instance - * @returns {Object.} JSON object - */ - GeminiClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeminiClusterConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GeminiClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeminiClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GeminiClusterConfig"; - }; - - return GeminiClusterConfig; - })(); - - v1beta.GeminiInstanceConfig = (function() { - - /** - * Properties of a GeminiInstanceConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IGeminiInstanceConfig - * @property {boolean|null} [entitled] GeminiInstanceConfig entitled - */ - - /** - * Constructs a new GeminiInstanceConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GeminiInstanceConfig. - * @implements IGeminiInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig=} [properties] Properties to set - */ - function GeminiInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeminiInstanceConfig entitled. - * @member {boolean} entitled - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @instance - */ - GeminiInstanceConfig.prototype.entitled = false; - - /** - * Creates a new GeminiInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig instance - */ - GeminiInstanceConfig.create = function create(properties) { - return new GeminiInstanceConfig(properties); - }; - - /** - * Encodes the specified GeminiInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); - return writer; - }; - - /** - * Encodes the specified GeminiInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GeminiInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGeminiInstanceConfig} message GeminiInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeminiInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entitled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeminiInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeminiInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeminiInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeminiInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entitled != null && message.hasOwnProperty("entitled")) - if (typeof message.entitled !== "boolean") - return "entitled: boolean expected"; - return null; - }; - - /** - * Creates a GeminiInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GeminiInstanceConfig} GeminiInstanceConfig - */ - GeminiInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GeminiInstanceConfig(); - if (object.entitled != null) - message.entitled = Boolean(object.entitled); - return message; - }; - - /** - * Creates a plain object from a GeminiInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.GeminiInstanceConfig} message GeminiInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeminiInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.entitled = false; - if (message.entitled != null && message.hasOwnProperty("entitled")) - object.entitled = message.entitled; - return object; - }; - - /** - * Converts this GeminiInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - GeminiInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeminiInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GeminiInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeminiInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GeminiInstanceConfig"; - }; - - return GeminiInstanceConfig; - })(); - - v1beta.GCAInstanceConfig = (function() { - - /** - * Properties of a GCAInstanceConfig. - * @memberof google.cloud.alloydb.v1beta - * @interface IGCAInstanceConfig - * @property {google.cloud.alloydb.v1beta.GCAEntitlementType|null} [gcaEntitlement] GCAInstanceConfig gcaEntitlement - */ - - /** - * Constructs a new GCAInstanceConfig. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GCAInstanceConfig. - * @implements IGCAInstanceConfig - * @constructor - * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig=} [properties] Properties to set - */ - function GCAInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCAInstanceConfig gcaEntitlement. - * @member {google.cloud.alloydb.v1beta.GCAEntitlementType} gcaEntitlement - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @instance - */ - GCAInstanceConfig.prototype.gcaEntitlement = 0; - - /** - * Creates a new GCAInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig instance - */ - GCAInstanceConfig.create = function create(properties) { - return new GCAInstanceConfig(properties); - }; - - /** - * Encodes the specified GCAInstanceConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCAInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcaEntitlement != null && Object.hasOwnProperty.call(message, "gcaEntitlement")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.gcaEntitlement); - return writer; - }; - - /** - * Encodes the specified GCAInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GCAInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.IGCAInstanceConfig} message GCAInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCAInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCAInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GCAInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcaEntitlement = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCAInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCAInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCAInstanceConfig message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCAInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) - switch (message.gcaEntitlement) { - default: - return "gcaEntitlement: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a GCAInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GCAInstanceConfig} GCAInstanceConfig - */ - GCAInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GCAInstanceConfig) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GCAInstanceConfig(); - switch (object.gcaEntitlement) { - default: - if (typeof object.gcaEntitlement === "number") { - message.gcaEntitlement = object.gcaEntitlement; - break; - } - break; - case "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": - case 0: - message.gcaEntitlement = 0; - break; - case "GCA_STANDARD": - case 1: - message.gcaEntitlement = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a GCAInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {google.cloud.alloydb.v1beta.GCAInstanceConfig} message GCAInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCAInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcaEntitlement = options.enums === String ? "GCA_ENTITLEMENT_TYPE_UNSPECIFIED" : 0; - if (message.gcaEntitlement != null && message.hasOwnProperty("gcaEntitlement")) - object.gcaEntitlement = options.enums === String ? $root.google.cloud.alloydb.v1beta.GCAEntitlementType[message.gcaEntitlement] === undefined ? message.gcaEntitlement : $root.google.cloud.alloydb.v1beta.GCAEntitlementType[message.gcaEntitlement] : message.gcaEntitlement; - return object; - }; - - /** - * Converts this GCAInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - GCAInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCAInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GCAInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCAInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GCAInstanceConfig"; - }; - - return GCAInstanceConfig; - })(); - - v1beta.AlloyDBAdmin = (function() { - - /** - * Constructs a new AlloyDBAdmin service. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an AlloyDBAdmin - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; - - /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @function create - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AlloyDBAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listClusters}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListClustersResponse} [response] ListClustersResponse - */ - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.alloydb.v1beta.ListClustersRequest, $root.google.cloud.alloydb.v1beta.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Cluster} [response] Cluster - */ - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.alloydb.v1beta.GetClusterRequest, $root.google.cloud.alloydb.v1beta.Cluster, request, callback); - }, "name", { value: "GetCluster" }); - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1beta.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1beta.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|exportCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ExportClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportCluster. - * @function exportCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} request ExportClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.exportCluster = function exportCluster(request, callback) { - return this.rpcCall(exportCluster, $root.google.cloud.alloydb.v1beta.ExportClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportCluster" }); - - /** - * Calls ExportCluster. - * @function exportCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} request ExportClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|importCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ImportClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportCluster. - * @function importCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} request ImportClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.importCluster = function importCluster(request, callback) { - return this.rpcCall(importCluster, $root.google.cloud.alloydb.v1beta.ImportClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportCluster" }); - - /** - * Calls ImportCluster. - * @function importCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} request ImportClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|upgradeCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpgradeClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpgradeCluster. - * @function upgradeCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.upgradeCluster = function upgradeCluster(request, callback) { - return this.rpcCall(upgradeCluster, $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpgradeCluster" }); - - /** - * Calls UpgradeCluster. - * @function upgradeCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} request UpgradeClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1beta.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|promoteCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef PromoteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.promoteCluster = function promoteCluster(request, callback) { - return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1beta.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PromoteCluster" }); - - /** - * Calls PromoteCluster. - * @function promoteCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|switchoverCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef SwitchoverClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SwitchoverCluster. - * @function switchoverCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.switchoverCluster = function switchoverCluster(request, callback) { - return this.rpcCall(switchoverCluster, $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SwitchoverCluster" }); - - /** - * Calls SwitchoverCluster. - * @function switchoverCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} request SwitchoverClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restoreCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef RestoreClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1beta.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); - - /** - * Calls RestoreCluster. - * @function restoreCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryCluster}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateSecondaryClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryCluster = function createSecondaryCluster(request, callback) { - return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryCluster" }); - - /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listInstances}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.alloydb.v1beta.ListInstancesRequest, $root.google.cloud.alloydb.v1beta.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.alloydb.v1beta.GetInstanceRequest, $root.google.cloud.alloydb.v1beta.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.alloydb.v1beta.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createSecondaryInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateSecondaryInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createSecondaryInstance = function createSecondaryInstance(request, callback) { - return this.rpcCall(createSecondaryInstance, $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryInstance" }); - - /** - * Calls CreateSecondaryInstance. - * @function createSecondaryInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} request CreateSecondaryInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|batchCreateInstances}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef BatchCreateInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.batchCreateInstances = function batchCreateInstances(request, callback) { - return this.rpcCall(batchCreateInstances, $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateInstances" }); - - /** - * Calls BatchCreateInstances. - * @function batchCreateInstances - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} request BatchCreateInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); - - /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|failoverInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef FailoverInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.failoverInstance = function failoverInstance(request, callback) { - return this.rpcCall(failoverInstance, $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "FailoverInstance" }); - - /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|injectFault}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef InjectFaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls InjectFault. - * @function injectFault - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} request InjectFaultRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFaultCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.injectFault = function injectFault(request, callback) { - return this.rpcCall(injectFault, $root.google.cloud.alloydb.v1beta.InjectFaultRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "InjectFault" }); - - /** - * Calls InjectFault. - * @function injectFault - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} request InjectFaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|restartInstance}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef RestartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.restartInstance = function restartInstance(request, callback) { - return this.rpcCall(restartInstance, $root.google.cloud.alloydb.v1beta.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartInstance" }); - - /** - * Calls RestartInstance. - * @function restartInstance - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} request RestartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|executeSql}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ExecuteSqlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ExecuteSqlResponse} [response] ExecuteSqlResponse - */ - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSqlCallback} callback Node-style callback called with the error, if any, and ExecuteSqlResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest, $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse, request, callback); - }, "name", { value: "ExecuteSql" }); - - /** - * Calls ExecuteSql. - * @function executeSql - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} request ExecuteSqlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listBackups}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} [response] ListBackupsResponse - */ - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.alloydb.v1beta.ListBackupsRequest, $root.google.cloud.alloydb.v1beta.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Backup} [response] Backup - */ - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.alloydb.v1beta.GetBackupRequest, $root.google.cloud.alloydb.v1beta.Backup, request, callback); - }, "name", { value: "GetBackup" }); - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.alloydb.v1beta.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackup" }); - - /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.alloydb.v1beta.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteBackup}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.alloydb.v1beta.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listSupportedDatabaseFlags}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListSupportedDatabaseFlagsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse - */ - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlagsCallback} callback Node-style callback called with the error, if any, and ListSupportedDatabaseFlagsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listSupportedDatabaseFlags = function listSupportedDatabaseFlags(request, callback) { - return this.rpcCall(listSupportedDatabaseFlags, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest, $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse, request, callback); - }, "name", { value: "ListSupportedDatabaseFlags" }); - - /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|generateClientCertificate}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GenerateClientCertificateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse - */ - - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificateCallback} callback Node-style callback called with the error, if any, and GenerateClientCertificateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.generateClientCertificate = function generateClientCertificate(request, callback) { - return this.rpcCall(generateClientCertificate, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest, $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse, request, callback); - }, "name", { value: "GenerateClientCertificate" }); - - /** - * Calls GenerateClientCertificate. - * @function generateClientCertificate - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} request GenerateClientCertificateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getConnectionInfo}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetConnectionInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ConnectionInfo} [response] ConnectionInfo - */ - - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfoCallback} callback Node-style callback called with the error, if any, and ConnectionInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getConnectionInfo = function getConnectionInfo(request, callback) { - return this.rpcCall(getConnectionInfo, $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest, $root.google.cloud.alloydb.v1beta.ConnectionInfo, request, callback); - }, "name", { value: "GetConnectionInfo" }); - - /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} request GetConnectionInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listUsers}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListUsersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListUsersResponse} [response] ListUsersResponse - */ - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListUsersRequest} request ListUsersRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listUsers = function listUsers(request, callback) { - return this.rpcCall(listUsers, $root.google.cloud.alloydb.v1beta.ListUsersRequest, $root.google.cloud.alloydb.v1beta.ListUsersResponse, request, callback); - }, "name", { value: "ListUsers" }); - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListUsersRequest} request ListUsersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|getUser}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef GetUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.User} [response] User - */ - - /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetUserRequest} request GetUserRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.getUser = function getUser(request, callback) { - return this.rpcCall(getUser, $root.google.cloud.alloydb.v1beta.GetUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); - }, "name", { value: "GetUser" }); - - /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IGetUserRequest} request GetUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createUser}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.User} [response] User - */ - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createUser = function createUser(request, callback) { - return this.rpcCall(createUser, $root.google.cloud.alloydb.v1beta.CreateUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); - }, "name", { value: "CreateUser" }); - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|updateUser}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef UpdateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.User} [response] User - */ - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.updateUser = function updateUser(request, callback) { - return this.rpcCall(updateUser, $root.google.cloud.alloydb.v1beta.UpdateUserRequest, $root.google.cloud.alloydb.v1beta.User, request, callback); - }, "name", { value: "UpdateUser" }); - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|deleteUser}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef DeleteUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.deleteUser = function deleteUser(request, callback) { - return this.rpcCall(deleteUser, $root.google.cloud.alloydb.v1beta.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteUser" }); - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|listDatabases}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef ListDatabasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.ListDatabasesResponse} [response] ListDatabasesResponse - */ - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabasesCallback} callback Node-style callback called with the error, if any, and ListDatabasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.listDatabases = function listDatabases(request, callback) { - return this.rpcCall(listDatabases, $root.google.cloud.alloydb.v1beta.ListDatabasesRequest, $root.google.cloud.alloydb.v1beta.ListDatabasesResponse, request, callback); - }, "name", { value: "ListDatabases" }); - - /** - * Calls ListDatabases. - * @function listDatabases - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} request ListDatabasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.alloydb.v1beta.AlloyDBAdmin|createDatabase}. - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @typedef CreateDatabaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1beta.Database} [response] Database - */ - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @param {google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabaseCallback} callback Node-style callback called with the error, if any, and Database - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AlloyDBAdmin.prototype.createDatabase = function createDatabase(request, callback) { - return this.rpcCall(createDatabase, $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest, $root.google.cloud.alloydb.v1beta.Database, request, callback); - }, "name", { value: "CreateDatabase" }); - - /** - * Calls CreateDatabase. - * @function createDatabase - * @memberof google.cloud.alloydb.v1beta.AlloyDBAdmin - * @instance - * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} request CreateDatabaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlloyDBAdmin; - })(); - - v1beta.ListClustersRequest = (function() { - - /** - * Properties of a ListClustersRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IListClustersRequest - * @property {string|null} [parent] ListClustersRequest parent - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - * @property {string|null} [filter] ListClustersRequest filter - * @property {string|null} [orderBy] ListClustersRequest orderBy - */ - - /** - * Constructs a new ListClustersRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set - */ - function ListClustersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.parent = ""; - - /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageSize = 0; - - /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageToken = ""; - - /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.filter = ""; - - /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest instance - */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); - }; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListClustersRequest} ListClustersRequest - */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListClustersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {google.cloud.alloydb.v1beta.ListClustersRequest} message ListClustersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListClustersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @instance - * @returns {Object.} JSON object - */ - ListClustersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListClustersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersRequest"; - }; - - return ListClustersRequest; - })(); - - v1beta.ListClustersResponse = (function() { - - /** - * Properties of a ListClustersResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - * @property {Array.|null} [unreachable] ListClustersResponse unreachable - */ - - /** - * Constructs a new ListClustersResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set - */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.clusters = $util.emptyArray; - - /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.nextPageToken = ""; - - /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse instance - */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); - }; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.clusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListClustersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.clusters[i]); - if (error) - return "clusters." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListClustersResponse} ListClustersResponse - */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListClustersResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.clusters[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListClustersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {google.cloud.alloydb.v1beta.ListClustersResponse} message ListClustersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.clusters = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.clusters[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListClustersResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @instance - * @returns {Object.} JSON object - */ - ListClustersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListClustersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListClustersResponse"; - }; - - return ListClustersResponse; - })(); - - v1beta.GetClusterRequest = (function() { - - /** - * Properties of a GetClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name - * @property {google.cloud.alloydb.v1beta.ClusterView|null} [view] GetClusterRequest view - */ - - /** - * Constructs a new GetClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set - */ - function GetClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.name = ""; - - /** - * GetClusterRequest view. - * @member {google.cloud.alloydb.v1beta.ClusterView} view - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.view = 0; - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest instance - */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); - }; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetClusterRequest} GetClusterRequest - */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GetClusterRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "CLUSTER_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "CLUSTER_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "CLUSTER_VIEW_CONTINUOUS_BACKUP": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.GetClusterRequest} message GetClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.ClusterView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.ClusterView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @instance - * @returns {Object.} JSON object - */ - GetClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetClusterRequest"; - }; - - return GetClusterRequest; - })(); - - v1beta.CreateSecondaryClusterRequest = (function() { - - /** - * Properties of a CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateSecondaryClusterRequest - * @property {string|null} [parent] CreateSecondaryClusterRequest parent - * @property {string|null} [clusterId] CreateSecondaryClusterRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateSecondaryClusterRequest cluster - * @property {string|null} [requestId] CreateSecondaryClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryClusterRequest validateOnly - */ - - /** - * Constructs a new CreateSecondaryClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateSecondaryClusterRequest. - * @implements ICreateSecondaryClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set - */ - function CreateSecondaryClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecondaryClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.parent = ""; - - /** - * CreateSecondaryClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.clusterId = ""; - - /** - * CreateSecondaryClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.cluster = null; - - /** - * CreateSecondaryClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.requestId = ""; - - /** - * CreateSecondaryClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - */ - CreateSecondaryClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance - */ - CreateSecondaryClusterRequest.create = function create(properties) { - return new CreateSecondaryClusterRequest(properties); - }; - - /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecondaryClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest - */ - CreateSecondaryClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateSecondaryClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecondaryClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest"; - }; - - return CreateSecondaryClusterRequest; - })(); - - v1beta.CreateClusterRequest = (function() { - - /** - * Properties of a CreateClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateClusterRequest - * @property {string|null} [parent] CreateClusterRequest parent - * @property {string|null} [clusterId] CreateClusterRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly - */ - - /** - * Constructs a new CreateClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set - */ - function CreateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.parent = ""; - - /** - * CreateClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.clusterId = ""; - - /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.cluster = null; - - /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.requestId = ""; - - /** - * CreateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest instance - */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); - }; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateClusterRequest} CreateClusterRequest - */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateClusterRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateClusterRequest} message CreateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateClusterRequest"; - }; - - return CreateClusterRequest; - })(); - - v1beta.UpdateClusterRequest = (function() { - - /** - * Properties of an UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateClusterRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {string|null} [requestId] UpdateClusterRequest requestId - * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateClusterRequest allowMissing - */ - - /** - * Constructs a new UpdateClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set - */ - function UpdateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.updateMask = null; - - /** - * UpdateClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.cluster = null; - - /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.requestId = ""; - - /** - * UpdateClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.validateOnly = false; - - /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest instance - */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); - }; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateClusterRequest} UpdateClusterRequest - */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateClusterRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.UpdateClusterRequest} message UpdateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateClusterRequest"; - }; - - return UpdateClusterRequest; - })(); - - v1beta.GcsDestination = (function() { - - /** - * Properties of a GcsDestination. - * @memberof google.cloud.alloydb.v1beta - * @interface IGcsDestination - * @property {string|null} [uri] GcsDestination uri - */ - - /** - * Constructs a new GcsDestination. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination - * @constructor - * @param {google.cloud.alloydb.v1beta.IGcsDestination=} [properties] Properties to set - */ - function GcsDestination(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsDestination uri. - * @member {string} uri - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @instance - */ - GcsDestination.prototype.uri = ""; - - /** - * Creates a new GcsDestination instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {google.cloud.alloydb.v1beta.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination instance - */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); - }; - - /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {google.cloud.alloydb.v1beta.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; - - /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GcsDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {google.cloud.alloydb.v1beta.IGcsDestination} message GcsDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GcsDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDestination message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GcsDestination} GcsDestination - */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GcsDestination) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GcsDestination(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {google.cloud.alloydb.v1beta.GcsDestination} message GcsDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this GcsDestination to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @instance - * @returns {Object.} JSON object - */ - GcsDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDestination - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GcsDestination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GcsDestination"; - }; - - return GcsDestination; - })(); - - v1beta.ExportClusterRequest = (function() { - - /** - * Properties of an ExportClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IExportClusterRequest - * @property {google.cloud.alloydb.v1beta.IGcsDestination|null} [gcsDestination] ExportClusterRequest gcsDestination - * @property {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null} [csvExportOptions] ExportClusterRequest csvExportOptions - * @property {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null} [sqlExportOptions] ExportClusterRequest sqlExportOptions - * @property {string|null} [name] ExportClusterRequest name - * @property {string|null} [database] ExportClusterRequest database - */ - - /** - * Constructs a new ExportClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ExportClusterRequest. - * @implements IExportClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IExportClusterRequest=} [properties] Properties to set - */ - function ExportClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportClusterRequest gcsDestination. - * @member {google.cloud.alloydb.v1beta.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.gcsDestination = null; - - /** - * ExportClusterRequest csvExportOptions. - * @member {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions|null|undefined} csvExportOptions - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.csvExportOptions = null; - - /** - * ExportClusterRequest sqlExportOptions. - * @member {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions|null|undefined} sqlExportOptions - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.sqlExportOptions = null; - - /** - * ExportClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.name = ""; - - /** - * ExportClusterRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - ExportClusterRequest.prototype.database = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportClusterRequest destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - Object.defineProperty(ExportClusterRequest.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * ExportClusterRequest exportOptions. - * @member {"csvExportOptions"|"sqlExportOptions"|undefined} exportOptions - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - */ - Object.defineProperty(ExportClusterRequest.prototype, "exportOptions", { - get: $util.oneOfGetter($oneOfFields = ["csvExportOptions", "sqlExportOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IExportClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest instance - */ - ExportClusterRequest.create = function create(properties) { - return new ExportClusterRequest(properties); - }; - - /** - * Encodes the specified ExportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} message ExportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.alloydb.v1beta.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); - if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) - $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) - $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IExportClusterRequest} message ExportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.decode(reader, reader.uint32()); - break; - } - case 4: { - message.csvExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.sqlExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.database = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.alloydb.v1beta.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { - properties.exportOptions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify(message.csvExportOptions); - if (error) - return "csvExportOptions." + error; - } - } - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { - if (properties.exportOptions === 1) - return "exportOptions: multiple values"; - properties.exportOptions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify(message.sqlExportOptions); - if (error) - return "sqlExportOptions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - return null; - }; - - /** - * Creates an ExportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest} ExportClusterRequest - */ - ExportClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.fromObject(object.gcsDestination); - } - if (object.csvExportOptions != null) { - if (typeof object.csvExportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.csvExportOptions: object expected"); - message.csvExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.fromObject(object.csvExportOptions); - } - if (object.sqlExportOptions != null) { - if (typeof object.sqlExportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.sqlExportOptions: object expected"); - message.sqlExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.fromObject(object.sqlExportOptions); - } - if (object.name != null) - message.name = String(object.name); - if (object.database != null) - message.database = String(object.database); - return message; - }; - - /** - * Creates a plain object from an ExportClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest} message ExportClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.database = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { - object.csvExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.toObject(message.csvExportOptions, options); - if (options.oneofs) - object.exportOptions = "csvExportOptions"; - } - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { - object.sqlExportOptions = $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.toObject(message.sqlExportOptions, options); - if (options.oneofs) - object.exportOptions = "sqlExportOptions"; - } - return object; - }; - - /** - * Converts this ExportClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @instance - * @returns {Object.} JSON object - */ - ExportClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterRequest"; - }; - - ExportClusterRequest.CsvExportOptions = (function() { - - /** - * Properties of a CsvExportOptions. - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @interface ICsvExportOptions - * @property {string|null} [selectQuery] CsvExportOptions selectQuery - * @property {string|null} [fieldDelimiter] CsvExportOptions fieldDelimiter - * @property {string|null} [quoteCharacter] CsvExportOptions quoteCharacter - * @property {string|null} [escapeCharacter] CsvExportOptions escapeCharacter - */ - - /** - * Constructs a new CsvExportOptions. - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @classdesc Represents a CsvExportOptions. - * @implements ICsvExportOptions - * @constructor - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set - */ - function CsvExportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CsvExportOptions selectQuery. - * @member {string} selectQuery - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.selectQuery = ""; - - /** - * CsvExportOptions fieldDelimiter. - * @member {string} fieldDelimiter - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.fieldDelimiter = ""; - - /** - * CsvExportOptions quoteCharacter. - * @member {string} quoteCharacter - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.quoteCharacter = ""; - - /** - * CsvExportOptions escapeCharacter. - * @member {string} escapeCharacter - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @instance - */ - CsvExportOptions.prototype.escapeCharacter = ""; - - /** - * Creates a new CsvExportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions instance - */ - CsvExportOptions.create = function create(properties) { - return new CsvExportOptions(properties); - }; - - /** - * Encodes the specified CsvExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvExportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); - if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldDelimiter); - if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.quoteCharacter); - if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.escapeCharacter); - return writer; - }; - - /** - * Encodes the specified CsvExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ICsvExportOptions} message CsvExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvExportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selectQuery = reader.string(); - break; - } - case 2: { - message.fieldDelimiter = reader.string(); - break; - } - case 3: { - message.quoteCharacter = reader.string(); - break; - } - case 4: { - message.escapeCharacter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CsvExportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvExportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CsvExportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CsvExportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) - if (!$util.isString(message.selectQuery)) - return "selectQuery: string expected"; - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - if (!$util.isString(message.fieldDelimiter)) - return "fieldDelimiter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - if (!$util.isString(message.quoteCharacter)) - return "quoteCharacter: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - if (!$util.isString(message.escapeCharacter)) - return "escapeCharacter: string expected"; - return null; - }; - - /** - * Creates a CsvExportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} CsvExportOptions - */ - CsvExportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions(); - if (object.selectQuery != null) - message.selectQuery = String(object.selectQuery); - if (object.fieldDelimiter != null) - message.fieldDelimiter = String(object.fieldDelimiter); - if (object.quoteCharacter != null) - message.quoteCharacter = String(object.quoteCharacter); - if (object.escapeCharacter != null) - message.escapeCharacter = String(object.escapeCharacter); - return message; - }; - - /** - * Creates a plain object from a CsvExportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} message CsvExportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CsvExportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.selectQuery = ""; - object.fieldDelimiter = ""; - object.quoteCharacter = ""; - object.escapeCharacter = ""; - } - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) - object.selectQuery = message.selectQuery; - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - object.fieldDelimiter = message.fieldDelimiter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - object.quoteCharacter = message.quoteCharacter; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - object.escapeCharacter = message.escapeCharacter; - return object; - }; - - /** - * Converts this CsvExportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @instance - * @returns {Object.} JSON object - */ - CsvExportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CsvExportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CsvExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions"; - }; - - return CsvExportOptions; - })(); - - ExportClusterRequest.SqlExportOptions = (function() { - - /** - * Properties of a SqlExportOptions. - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @interface ISqlExportOptions - * @property {Array.|null} [tables] SqlExportOptions tables - * @property {boolean|null} [schemaOnly] SqlExportOptions schemaOnly - * @property {boolean|null} [cleanTargetObjects] SqlExportOptions cleanTargetObjects - * @property {boolean|null} [ifExistTargetObjects] SqlExportOptions ifExistTargetObjects - */ - - /** - * Constructs a new SqlExportOptions. - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest - * @classdesc Represents a SqlExportOptions. - * @implements ISqlExportOptions - * @constructor - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set - */ - function SqlExportOptions(properties) { - this.tables = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlExportOptions tables. - * @member {Array.} tables - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.tables = $util.emptyArray; - - /** - * SqlExportOptions schemaOnly. - * @member {boolean|null|undefined} schemaOnly - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.schemaOnly = null; - - /** - * SqlExportOptions cleanTargetObjects. - * @member {boolean|null|undefined} cleanTargetObjects - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.cleanTargetObjects = null; - - /** - * SqlExportOptions ifExistTargetObjects. - * @member {boolean|null|undefined} ifExistTargetObjects - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @instance - */ - SqlExportOptions.prototype.ifExistTargetObjects = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_schemaOnly", { - get: $util.oneOfGetter($oneOfFields = ["schemaOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_cleanTargetObjects", { - get: $util.oneOfGetter($oneOfFields = ["cleanTargetObjects"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlExportOptions.prototype, "_ifExistTargetObjects", { - get: $util.oneOfGetter($oneOfFields = ["ifExistTargetObjects"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SqlExportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions instance - */ - SqlExportOptions.create = function create(properties) { - return new SqlExportOptions(properties); - }; - - /** - * Encodes the specified SqlExportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlExportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tables != null && message.tables.length) - for (var i = 0; i < message.tables.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); - if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.schemaOnly); - if (message.cleanTargetObjects != null && Object.hasOwnProperty.call(message, "cleanTargetObjects")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanTargetObjects); - if (message.ifExistTargetObjects != null && Object.hasOwnProperty.call(message, "ifExistTargetObjects")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ifExistTargetObjects); - return writer; - }; - - /** - * Encodes the specified SqlExportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.ISqlExportOptions} message SqlExportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlExportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tables && message.tables.length)) - message.tables = []; - message.tables.push(reader.string()); - break; - } - case 2: { - message.schemaOnly = reader.bool(); - break; - } - case 3: { - message.cleanTargetObjects = reader.bool(); - break; - } - case 4: { - message.ifExistTargetObjects = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlExportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlExportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlExportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlExportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tables != null && message.hasOwnProperty("tables")) { - if (!Array.isArray(message.tables)) - return "tables: array expected"; - for (var i = 0; i < message.tables.length; ++i) - if (!$util.isString(message.tables[i])) - return "tables: string[] expected"; - } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { - properties._schemaOnly = 1; - if (typeof message.schemaOnly !== "boolean") - return "schemaOnly: boolean expected"; - } - if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { - properties._cleanTargetObjects = 1; - if (typeof message.cleanTargetObjects !== "boolean") - return "cleanTargetObjects: boolean expected"; - } - if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { - properties._ifExistTargetObjects = 1; - if (typeof message.ifExistTargetObjects !== "boolean") - return "ifExistTargetObjects: boolean expected"; - } - return null; - }; - - /** - * Creates a SqlExportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} SqlExportOptions - */ - SqlExportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions(); - if (object.tables) { - if (!Array.isArray(object.tables)) - throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions.tables: array expected"); - message.tables = []; - for (var i = 0; i < object.tables.length; ++i) - message.tables[i] = String(object.tables[i]); - } - if (object.schemaOnly != null) - message.schemaOnly = Boolean(object.schemaOnly); - if (object.cleanTargetObjects != null) - message.cleanTargetObjects = Boolean(object.cleanTargetObjects); - if (object.ifExistTargetObjects != null) - message.ifExistTargetObjects = Boolean(object.ifExistTargetObjects); - return message; - }; - - /** - * Creates a plain object from a SqlExportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} message SqlExportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlExportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tables = []; - if (message.tables && message.tables.length) { - object.tables = []; - for (var j = 0; j < message.tables.length; ++j) - object.tables[j] = message.tables[j]; - } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { - object.schemaOnly = message.schemaOnly; - if (options.oneofs) - object._schemaOnly = "schemaOnly"; - } - if (message.cleanTargetObjects != null && message.hasOwnProperty("cleanTargetObjects")) { - object.cleanTargetObjects = message.cleanTargetObjects; - if (options.oneofs) - object._cleanTargetObjects = "cleanTargetObjects"; - } - if (message.ifExistTargetObjects != null && message.hasOwnProperty("ifExistTargetObjects")) { - object.ifExistTargetObjects = message.ifExistTargetObjects; - if (options.oneofs) - object._ifExistTargetObjects = "ifExistTargetObjects"; - } - return object; - }; - - /** - * Converts this SqlExportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @instance - * @returns {Object.} JSON object - */ - SqlExportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlExportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions"; - }; - - return SqlExportOptions; - })(); - - return ExportClusterRequest; - })(); - - v1beta.ExportClusterResponse = (function() { - - /** - * Properties of an ExportClusterResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IExportClusterResponse - * @property {google.cloud.alloydb.v1beta.IGcsDestination|null} [gcsDestination] ExportClusterResponse gcsDestination - */ - - /** - * Constructs a new ExportClusterResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ExportClusterResponse. - * @implements IExportClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IExportClusterResponse=} [properties] Properties to set - */ - function ExportClusterResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportClusterResponse gcsDestination. - * @member {google.cloud.alloydb.v1beta.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @instance - */ - ExportClusterResponse.prototype.gcsDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExportClusterResponse destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @instance - */ - Object.defineProperty(ExportClusterResponse.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExportClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IExportClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse instance - */ - ExportClusterResponse.create = function create(properties) { - return new ExportClusterResponse(properties); - }; - - /** - * Encodes the specified ExportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IExportClusterResponse} message ExportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - $root.google.cloud.alloydb.v1beta.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExportClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IExportClusterResponse} message ExportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExportClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.alloydb.v1beta.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } - } - return null; - }; - - /** - * Creates an ExportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExportClusterResponse} ExportClusterResponse - */ - ExportClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExportClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExportClusterResponse(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExportClusterResponse.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.fromObject(object.gcsDestination); - } - return message; - }; - - /** - * Creates a plain object from an ExportClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.ExportClusterResponse} message ExportClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.alloydb.v1beta.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; - } - return object; - }; - - /** - * Converts this ExportClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @instance - * @returns {Object.} JSON object - */ - ExportClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExportClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExportClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExportClusterResponse"; - }; - - return ExportClusterResponse; - })(); - - v1beta.ImportClusterRequest = (function() { - - /** - * Properties of an ImportClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IImportClusterRequest - * @property {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null} [sqlImportOptions] ImportClusterRequest sqlImportOptions - * @property {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null} [csvImportOptions] ImportClusterRequest csvImportOptions - * @property {string|null} [name] ImportClusterRequest name - * @property {string|null} [gcsUri] ImportClusterRequest gcsUri - * @property {string|null} [database] ImportClusterRequest database - * @property {string|null} [user] ImportClusterRequest user - */ - - /** - * Constructs a new ImportClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ImportClusterRequest. - * @implements IImportClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IImportClusterRequest=} [properties] Properties to set - */ - function ImportClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportClusterRequest sqlImportOptions. - * @member {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions|null|undefined} sqlImportOptions - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.sqlImportOptions = null; - - /** - * ImportClusterRequest csvImportOptions. - * @member {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions|null|undefined} csvImportOptions - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.csvImportOptions = null; - - /** - * ImportClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.name = ""; - - /** - * ImportClusterRequest gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.gcsUri = ""; - - /** - * ImportClusterRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.database = ""; - - /** - * ImportClusterRequest user. - * @member {string} user - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - ImportClusterRequest.prototype.user = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportClusterRequest importOptions. - * @member {"sqlImportOptions"|"csvImportOptions"|undefined} importOptions - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - */ - Object.defineProperty(ImportClusterRequest.prototype, "importOptions", { - get: $util.oneOfGetter($oneOfFields = ["sqlImportOptions", "csvImportOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IImportClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest instance - */ - ImportClusterRequest.create = function create(properties) { - return new ImportClusterRequest(properties); - }; - - /** - * Encodes the specified ImportClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} message ImportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.database); - if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) - $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.user); - if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) - $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IImportClusterRequest} message ImportClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.sqlImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.decode(reader, reader.uint32()); - break; - } - case 7: { - message.csvImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.gcsUri = reader.string(); - break; - } - case 3: { - message.database = reader.string(); - break; - } - case 5: { - message.user = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { - properties.importOptions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify(message.sqlImportOptions); - if (error) - return "sqlImportOptions." + error; - } - } - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { - if (properties.importOptions === 1) - return "importOptions: multiple values"; - properties.importOptions = 1; - { - var error = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify(message.csvImportOptions); - if (error) - return "csvImportOptions." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - return null; - }; - - /** - * Creates an ImportClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest} ImportClusterRequest - */ - ImportClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest(); - if (object.sqlImportOptions != null) { - if (typeof object.sqlImportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ImportClusterRequest.sqlImportOptions: object expected"); - message.sqlImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.fromObject(object.sqlImportOptions); - } - if (object.csvImportOptions != null) { - if (typeof object.csvImportOptions !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ImportClusterRequest.csvImportOptions: object expected"); - message.csvImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.fromObject(object.csvImportOptions); - } - if (object.name != null) - message.name = String(object.name); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.database != null) - message.database = String(object.database); - if (object.user != null) - message.user = String(object.user); - return message; - }; - - /** - * Creates a plain object from an ImportClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest} message ImportClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.gcsUri = ""; - object.database = ""; - object.user = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { - object.sqlImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.toObject(message.sqlImportOptions, options); - if (options.oneofs) - object.importOptions = "sqlImportOptions"; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { - object.csvImportOptions = $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.toObject(message.csvImportOptions, options); - if (options.oneofs) - object.importOptions = "csvImportOptions"; - } - return object; - }; - - /** - * Converts this ImportClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @instance - * @returns {Object.} JSON object - */ - ImportClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterRequest"; - }; - - ImportClusterRequest.SqlImportOptions = (function() { - - /** - * Properties of a SqlImportOptions. - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @interface ISqlImportOptions - */ - - /** - * Constructs a new SqlImportOptions. - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @classdesc Represents a SqlImportOptions. - * @implements ISqlImportOptions - * @constructor - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set - */ - function SqlImportOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new SqlImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions instance - */ - SqlImportOptions.create = function create(properties) { - return new SqlImportOptions(properties); - }; - - /** - * Encodes the specified SqlImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SqlImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ISqlImportOptions} message SqlImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlImportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SqlImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} SqlImportOptions - */ - SqlImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions) - return object; - return new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions(); - }; - - /** - * Creates a plain object from a SqlImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} message SqlImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlImportOptions.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SqlImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @instance - * @returns {Object.} JSON object - */ - SqlImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlImportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions"; - }; - - return SqlImportOptions; - })(); - - ImportClusterRequest.CsvImportOptions = (function() { - - /** - * Properties of a CsvImportOptions. - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @interface ICsvImportOptions - * @property {string|null} [table] CsvImportOptions table - * @property {Array.|null} [columns] CsvImportOptions columns - * @property {string|null} [fieldDelimiter] CsvImportOptions fieldDelimiter - * @property {string|null} [quoteCharacter] CsvImportOptions quoteCharacter - * @property {string|null} [escapeCharacter] CsvImportOptions escapeCharacter - */ - - /** - * Constructs a new CsvImportOptions. - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest - * @classdesc Represents a CsvImportOptions. - * @implements ICsvImportOptions - * @constructor - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set - */ - function CsvImportOptions(properties) { - this.columns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CsvImportOptions table. - * @member {string} table - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.table = ""; - - /** - * CsvImportOptions columns. - * @member {Array.} columns - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.columns = $util.emptyArray; - - /** - * CsvImportOptions fieldDelimiter. - * @member {string} fieldDelimiter - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.fieldDelimiter = ""; - - /** - * CsvImportOptions quoteCharacter. - * @member {string} quoteCharacter - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.quoteCharacter = ""; - - /** - * CsvImportOptions escapeCharacter. - * @member {string} escapeCharacter - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @instance - */ - CsvImportOptions.prototype.escapeCharacter = ""; - - /** - * Creates a new CsvImportOptions instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions instance - */ - CsvImportOptions.create = function create(properties) { - return new CsvImportOptions(properties); - }; - - /** - * Encodes the specified CsvImportOptions message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvImportOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); - if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldDelimiter); - if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.quoteCharacter); - if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.escapeCharacter); - return writer; - }; - - /** - * Encodes the specified CsvImportOptions message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.ICsvImportOptions} message CsvImportOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvImportOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.table = reader.string(); - break; - } - case 2: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push(reader.string()); - break; - } - case 3: { - message.fieldDelimiter = reader.string(); - break; - } - case 4: { - message.quoteCharacter = reader.string(); - break; - } - case 5: { - message.escapeCharacter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CsvImportOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CsvImportOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CsvImportOptions message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CsvImportOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) - if (!$util.isString(message.columns[i])) - return "columns: string[] expected"; - } - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - if (!$util.isString(message.fieldDelimiter)) - return "fieldDelimiter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - if (!$util.isString(message.quoteCharacter)) - return "quoteCharacter: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - if (!$util.isString(message.escapeCharacter)) - return "escapeCharacter: string expected"; - return null; - }; - - /** - * Creates a CsvImportOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} CsvImportOptions - */ - CsvImportOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions(); - if (object.table != null) - message.table = String(object.table); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) - message.columns[i] = String(object.columns[i]); - } - if (object.fieldDelimiter != null) - message.fieldDelimiter = String(object.fieldDelimiter); - if (object.quoteCharacter != null) - message.quoteCharacter = String(object.quoteCharacter); - if (object.escapeCharacter != null) - message.escapeCharacter = String(object.escapeCharacter); - return message; - }; - - /** - * Creates a plain object from a CsvImportOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} message CsvImportOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CsvImportOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.columns = []; - if (options.defaults) { - object.table = ""; - object.fieldDelimiter = ""; - object.quoteCharacter = ""; - object.escapeCharacter = ""; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = message.columns[j]; - } - if (message.fieldDelimiter != null && message.hasOwnProperty("fieldDelimiter")) - object.fieldDelimiter = message.fieldDelimiter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) - object.quoteCharacter = message.quoteCharacter; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) - object.escapeCharacter = message.escapeCharacter; - return object; - }; - - /** - * Converts this CsvImportOptions to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @instance - * @returns {Object.} JSON object - */ - CsvImportOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CsvImportOptions - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CsvImportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions"; - }; - - return CsvImportOptions; - })(); - - return ImportClusterRequest; - })(); - - v1beta.ImportClusterResponse = (function() { - - /** - * Properties of an ImportClusterResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IImportClusterResponse - * @property {number|Long|null} [bytesDownloaded] ImportClusterResponse bytesDownloaded - */ - - /** - * Constructs a new ImportClusterResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ImportClusterResponse. - * @implements IImportClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IImportClusterResponse=} [properties] Properties to set - */ - function ImportClusterResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportClusterResponse bytesDownloaded. - * @member {number|Long} bytesDownloaded - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @instance - */ - ImportClusterResponse.prototype.bytesDownloaded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ImportClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IImportClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse instance - */ - ImportClusterResponse.create = function create(properties) { - return new ImportClusterResponse(properties); - }; - - /** - * Encodes the specified ImportClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IImportClusterResponse} message ImportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bytesDownloaded != null && Object.hasOwnProperty.call(message, "bytesDownloaded")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bytesDownloaded); - return writer; - }; - - /** - * Encodes the specified ImportClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ImportClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IImportClusterResponse} message ImportClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ImportClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bytesDownloaded = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) - if (!$util.isInteger(message.bytesDownloaded) && !(message.bytesDownloaded && $util.isInteger(message.bytesDownloaded.low) && $util.isInteger(message.bytesDownloaded.high))) - return "bytesDownloaded: integer|Long expected"; - return null; - }; - - /** - * Creates an ImportClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ImportClusterResponse} ImportClusterResponse - */ - ImportClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ImportClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ImportClusterResponse(); - if (object.bytesDownloaded != null) - if ($util.Long) - (message.bytesDownloaded = $util.Long.fromValue(object.bytesDownloaded)).unsigned = false; - else if (typeof object.bytesDownloaded === "string") - message.bytesDownloaded = parseInt(object.bytesDownloaded, 10); - else if (typeof object.bytesDownloaded === "number") - message.bytesDownloaded = object.bytesDownloaded; - else if (typeof object.bytesDownloaded === "object") - message.bytesDownloaded = new $util.LongBits(object.bytesDownloaded.low >>> 0, object.bytesDownloaded.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an ImportClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.ImportClusterResponse} message ImportClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bytesDownloaded = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bytesDownloaded = options.longs === String ? "0" : 0; - if (message.bytesDownloaded != null && message.hasOwnProperty("bytesDownloaded")) - if (typeof message.bytesDownloaded === "number") - object.bytesDownloaded = options.longs === String ? String(message.bytesDownloaded) : message.bytesDownloaded; - else - object.bytesDownloaded = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDownloaded) : options.longs === Number ? new $util.LongBits(message.bytesDownloaded.low >>> 0, message.bytesDownloaded.high >>> 0).toNumber() : message.bytesDownloaded; - return object; - }; - - /** - * Converts this ImportClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @instance - * @returns {Object.} JSON object - */ - ImportClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ImportClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ImportClusterResponse"; - }; - - return ImportClusterResponse; - })(); - - v1beta.UpgradeClusterRequest = (function() { - - /** - * Properties of an UpgradeClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpgradeClusterRequest - * @property {string|null} [name] UpgradeClusterRequest name - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [version] UpgradeClusterRequest version - * @property {string|null} [requestId] UpgradeClusterRequest requestId - * @property {boolean|null} [validateOnly] UpgradeClusterRequest validateOnly - * @property {string|null} [etag] UpgradeClusterRequest etag - */ - - /** - * Constructs a new UpgradeClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpgradeClusterRequest. - * @implements IUpgradeClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest=} [properties] Properties to set - */ - function UpgradeClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.name = ""; - - /** - * UpgradeClusterRequest version. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} version - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.version = 0; - - /** - * UpgradeClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.requestId = ""; - - /** - * UpgradeClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.validateOnly = false; - - /** - * UpgradeClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @instance - */ - UpgradeClusterRequest.prototype.etag = ""; - - /** - * Creates a new UpgradeClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest instance - */ - UpgradeClusterRequest.create = function create(properties) { - return new UpgradeClusterRequest(properties); - }; - - /** - * Encodes the specified UpgradeClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterRequest} message UpgradeClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.version = reader.int32(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - switch (message.version) { - default: - return "version: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an UpgradeClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterRequest} UpgradeClusterRequest - */ - UpgradeClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.version) { - default: - if (typeof object.version === "number") { - message.version = object.version; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.version = 0; - break; - case "POSTGRES_13": - case 1: - message.version = 1; - break; - case "POSTGRES_14": - case 2: - message.version = 2; - break; - case "POSTGRES_15": - case 3: - message.version = 3; - break; - case "POSTGRES_16": - case 4: - message.version = 4; - break; - case "POSTGRES_17": - case 5: - message.version = 5; - break; - case "POSTGRES_18": - case 6: - message.version = 6; - break; - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterRequest} message UpgradeClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.version = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.version] === undefined ? message.version : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.version] : message.version; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this UpgradeClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterRequest"; - }; - - return UpgradeClusterRequest; - })(); - - v1beta.UpgradeClusterResponse = (function() { - - /** - * Properties of an UpgradeClusterResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpgradeClusterResponse - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [status] UpgradeClusterResponse status - * @property {string|null} [message] UpgradeClusterResponse message - * @property {Array.|null} [clusterUpgradeDetails] UpgradeClusterResponse clusterUpgradeDetails - */ - - /** - * Constructs a new UpgradeClusterResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpgradeClusterResponse. - * @implements IUpgradeClusterResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse=} [properties] Properties to set - */ - function UpgradeClusterResponse(properties) { - this.clusterUpgradeDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterResponse status. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} status - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.status = 0; - - /** - * UpgradeClusterResponse message. - * @member {string} message - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.message = ""; - - /** - * UpgradeClusterResponse clusterUpgradeDetails. - * @member {Array.} clusterUpgradeDetails - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @instance - */ - UpgradeClusterResponse.prototype.clusterUpgradeDetails = $util.emptyArray; - - /** - * Creates a new UpgradeClusterResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse instance - */ - UpgradeClusterResponse.create = function create(properties) { - return new UpgradeClusterResponse(properties); - }; - - /** - * Encodes the specified UpgradeClusterResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.clusterUpgradeDetails != null && message.clusterUpgradeDetails.length) - for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) - $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.encode(message.clusterUpgradeDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterResponse} message UpgradeClusterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.status = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.clusterUpgradeDetails && message.clusterUpgradeDetails.length)) - message.clusterUpgradeDetails = []; - message.clusterUpgradeDetails.push($root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.clusterUpgradeDetails != null && message.hasOwnProperty("clusterUpgradeDetails")) { - if (!Array.isArray(message.clusterUpgradeDetails)) - return "clusterUpgradeDetails: array expected"; - for (var i = 0; i < message.clusterUpgradeDetails.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify(message.clusterUpgradeDetails[i]); - if (error) - return "clusterUpgradeDetails." + error; - } - } - return null; - }; - - /** - * Creates an UpgradeClusterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse} UpgradeClusterResponse - */ - UpgradeClusterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse(); - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "NOT_STARTED": - case 4: - message.status = 4; - break; - case "IN_PROGRESS": - case 5: - message.status = 5; - break; - case "SUCCESS": - case 1: - message.status = 1; - break; - case "FAILED": - case 2: - message.status = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.status = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.status = 6; - break; - case "CANCELLED": - case 7: - message.status = 7; - break; - } - if (object.message != null) - message.message = String(object.message); - if (object.clusterUpgradeDetails) { - if (!Array.isArray(object.clusterUpgradeDetails)) - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.clusterUpgradeDetails: array expected"); - message.clusterUpgradeDetails = []; - for (var i = 0; i < object.clusterUpgradeDetails.length; ++i) { - if (typeof object.clusterUpgradeDetails[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.clusterUpgradeDetails: object expected"); - message.clusterUpgradeDetails[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.fromObject(object.clusterUpgradeDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse} message UpgradeClusterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clusterUpgradeDetails = []; - if (options.defaults) { - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.message = ""; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] : message.status; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.clusterUpgradeDetails && message.clusterUpgradeDetails.length) { - object.clusterUpgradeDetails = []; - for (var j = 0; j < message.clusterUpgradeDetails.length; ++j) - object.clusterUpgradeDetails[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.toObject(message.clusterUpgradeDetails[j], options); - } - return object; - }; - - /** - * Converts this UpgradeClusterResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse"; - }; - - UpgradeClusterResponse.StageInfo = (function() { - - /** - * Properties of a StageInfo. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @interface IStageInfo - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null} [stage] StageInfo stage - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [status] StageInfo status - * @property {string|null} [logsUrl] StageInfo logsUrl - */ - - /** - * Constructs a new StageInfo. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @classdesc Represents a StageInfo. - * @implements IStageInfo - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set - */ - function StageInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageInfo stage. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage} stage - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.stage = 0; - - /** - * StageInfo status. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} status - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.status = 0; - - /** - * StageInfo logsUrl. - * @member {string} logsUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @instance - */ - StageInfo.prototype.logsUrl = ""; - - /** - * Creates a new StageInfo instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo instance - */ - StageInfo.create = function create(properties) { - return new StageInfo(properties); - }; - - /** - * Encodes the specified StageInfo message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); - if (message.logsUrl != null && Object.hasOwnProperty.call(message, "logsUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.logsUrl); - return writer; - }; - - /** - * Encodes the specified StageInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IStageInfo} message StageInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stage = reader.int32(); - break; - } - case 2: { - message.status = reader.int32(); - break; - } - case 3: { - message.logsUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageInfo message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stage != null && message.hasOwnProperty("stage")) - switch (message.stage) { - default: - return "stage: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) - if (!$util.isString(message.logsUrl)) - return "logsUrl: string expected"; - return null; - }; - - /** - * Creates a StageInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} StageInfo - */ - StageInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo(); - switch (object.stage) { - default: - if (typeof object.stage === "number") { - message.stage = object.stage; - break; - } - break; - case "STAGE_UNSPECIFIED": - case 0: - message.stage = 0; - break; - case "ALLOYDB_PRECHECK": - case 1: - message.stage = 1; - break; - case "PG_UPGRADE_CHECK": - case 2: - message.stage = 2; - break; - case "PREPARE_FOR_UPGRADE": - case 5: - message.stage = 5; - break; - case "PRIMARY_INSTANCE_UPGRADE": - case 3: - message.stage = 3; - break; - case "READ_POOL_INSTANCES_UPGRADE": - case 4: - message.stage = 4; - break; - case "ROLLBACK": - case 6: - message.stage = 6; - break; - case "CLEANUP": - case 7: - message.stage = 7; - break; - } - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "NOT_STARTED": - case 4: - message.status = 4; - break; - case "IN_PROGRESS": - case 5: - message.status = 5; - break; - case "SUCCESS": - case 1: - message.status = 1; - break; - case "FAILED": - case 2: - message.status = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.status = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.status = 6; - break; - case "CANCELLED": - case 7: - message.status = 7; - break; - } - if (object.logsUrl != null) - message.logsUrl = String(object.logsUrl); - return message; - }; - - /** - * Creates a plain object from a StageInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo} message StageInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.logsUrl = ""; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] : message.stage; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.status] : message.status; - if (message.logsUrl != null && message.hasOwnProperty("logsUrl")) - object.logsUrl = message.logsUrl; - return object; - }; - - /** - * Converts this StageInfo to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @instance - * @returns {Object.} JSON object - */ - StageInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageInfo - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo"; - }; - - return StageInfo; - })(); - - UpgradeClusterResponse.InstanceUpgradeDetails = (function() { - - /** - * Properties of an InstanceUpgradeDetails. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @interface IInstanceUpgradeDetails - * @property {string|null} [name] InstanceUpgradeDetails name - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [upgradeStatus] InstanceUpgradeDetails upgradeStatus - * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [instanceType] InstanceUpgradeDetails instanceType - */ - - /** - * Constructs a new InstanceUpgradeDetails. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @classdesc Represents an InstanceUpgradeDetails. - * @implements IInstanceUpgradeDetails - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set - */ - function InstanceUpgradeDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceUpgradeDetails name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.name = ""; - - /** - * InstanceUpgradeDetails upgradeStatus. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} upgradeStatus - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.upgradeStatus = 0; - - /** - * InstanceUpgradeDetails instanceType. - * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} instanceType - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - */ - InstanceUpgradeDetails.prototype.instanceType = 0; - - /** - * Creates a new InstanceUpgradeDetails instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails instance - */ - InstanceUpgradeDetails.create = function create(properties) { - return new InstanceUpgradeDetails(properties); - }; - - /** - * Encodes the specified InstanceUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceUpgradeDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); - if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.instanceType); - return writer; - }; - - /** - * Encodes the specified InstanceUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IInstanceUpgradeDetails} message InstanceUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceUpgradeDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.upgradeStatus = reader.int32(); - break; - } - case 3: { - message.instanceType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceUpgradeDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceUpgradeDetails message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceUpgradeDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - switch (message.upgradeStatus) { - default: - return "upgradeStatus: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - switch (message.instanceType) { - default: - return "instanceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an InstanceUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} InstanceUpgradeDetails - */ - InstanceUpgradeDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails(); - if (object.name != null) - message.name = String(object.name); - switch (object.upgradeStatus) { - default: - if (typeof object.upgradeStatus === "number") { - message.upgradeStatus = object.upgradeStatus; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.upgradeStatus = 0; - break; - case "NOT_STARTED": - case 4: - message.upgradeStatus = 4; - break; - case "IN_PROGRESS": - case 5: - message.upgradeStatus = 5; - break; - case "SUCCESS": - case 1: - message.upgradeStatus = 1; - break; - case "FAILED": - case 2: - message.upgradeStatus = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.upgradeStatus = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.upgradeStatus = 6; - break; - case "CANCELLED": - case 7: - message.upgradeStatus = 7; - break; - } - switch (object.instanceType) { - default: - if (typeof object.instanceType === "number") { - message.instanceType = object.instanceType; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.instanceType = 0; - break; - case "PRIMARY": - case 1: - message.instanceType = 1; - break; - case "READ_POOL": - case 2: - message.instanceType = 2; - break; - case "SECONDARY": - case 3: - message.instanceType = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an InstanceUpgradeDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails} message InstanceUpgradeDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceUpgradeDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.instanceType = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) - object.instanceType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.instanceType] : message.instanceType; - return object; - }; - - /** - * Converts this InstanceUpgradeDetails to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @instance - * @returns {Object.} JSON object - */ - InstanceUpgradeDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceUpgradeDetails - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails"; - }; - - return InstanceUpgradeDetails; - })(); - - UpgradeClusterResponse.ClusterUpgradeDetails = (function() { - - /** - * Properties of a ClusterUpgradeDetails. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @interface IClusterUpgradeDetails - * @property {string|null} [name] ClusterUpgradeDetails name - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [upgradeStatus] ClusterUpgradeDetails upgradeStatus - * @property {google.cloud.alloydb.v1beta.Cluster.ClusterType|null} [clusterType] ClusterUpgradeDetails clusterType - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] ClusterUpgradeDetails databaseVersion - * @property {Array.|null} [stageInfo] ClusterUpgradeDetails stageInfo - * @property {Array.|null} [instanceUpgradeDetails] ClusterUpgradeDetails instanceUpgradeDetails - */ - - /** - * Constructs a new ClusterUpgradeDetails. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse - * @classdesc Represents a ClusterUpgradeDetails. - * @implements IClusterUpgradeDetails - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set - */ - function ClusterUpgradeDetails(properties) { - this.stageInfo = []; - this.instanceUpgradeDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterUpgradeDetails name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.name = ""; - - /** - * ClusterUpgradeDetails upgradeStatus. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} upgradeStatus - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.upgradeStatus = 0; - - /** - * ClusterUpgradeDetails clusterType. - * @member {google.cloud.alloydb.v1beta.Cluster.ClusterType} clusterType - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.clusterType = 0; - - /** - * ClusterUpgradeDetails databaseVersion. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.databaseVersion = 0; - - /** - * ClusterUpgradeDetails stageInfo. - * @member {Array.} stageInfo - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.stageInfo = $util.emptyArray; - - /** - * ClusterUpgradeDetails instanceUpgradeDetails. - * @member {Array.} instanceUpgradeDetails - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - */ - ClusterUpgradeDetails.prototype.instanceUpgradeDetails = $util.emptyArray; - - /** - * Creates a new ClusterUpgradeDetails instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails instance - */ - ClusterUpgradeDetails.create = function create(properties) { - return new ClusterUpgradeDetails(properties); - }; - - /** - * Encodes the specified ClusterUpgradeDetails message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterUpgradeDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.upgradeStatus); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.clusterType); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.databaseVersion); - if (message.stageInfo != null && message.stageInfo.length) - for (var i = 0; i < message.stageInfo.length; ++i) - $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.encode(message.stageInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.instanceUpgradeDetails != null && message.instanceUpgradeDetails.length) - for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) - $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.encode(message.instanceUpgradeDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClusterUpgradeDetails message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.IClusterUpgradeDetails} message ClusterUpgradeDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterUpgradeDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterUpgradeDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.upgradeStatus = reader.int32(); - break; - } - case 3: { - message.clusterType = reader.int32(); - break; - } - case 4: { - message.databaseVersion = reader.int32(); - break; - } - case 5: { - if (!(message.stageInfo && message.stageInfo.length)) - message.stageInfo = []; - message.stageInfo.push($root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.instanceUpgradeDetails && message.instanceUpgradeDetails.length)) - message.instanceUpgradeDetails = []; - message.instanceUpgradeDetails.push($root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterUpgradeDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterUpgradeDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterUpgradeDetails message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterUpgradeDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - switch (message.upgradeStatus) { - default: - return "upgradeStatus: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stageInfo != null && message.hasOwnProperty("stageInfo")) { - if (!Array.isArray(message.stageInfo)) - return "stageInfo: array expected"; - for (var i = 0; i < message.stageInfo.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.verify(message.stageInfo[i]); - if (error) - return "stageInfo." + error; - } - } - if (message.instanceUpgradeDetails != null && message.hasOwnProperty("instanceUpgradeDetails")) { - if (!Array.isArray(message.instanceUpgradeDetails)) - return "instanceUpgradeDetails: array expected"; - for (var i = 0; i < message.instanceUpgradeDetails.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.verify(message.instanceUpgradeDetails[i]); - if (error) - return "instanceUpgradeDetails." + error; - } - } - return null; - }; - - /** - * Creates a ClusterUpgradeDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} ClusterUpgradeDetails - */ - ClusterUpgradeDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails(); - if (object.name != null) - message.name = String(object.name); - switch (object.upgradeStatus) { - default: - if (typeof object.upgradeStatus === "number") { - message.upgradeStatus = object.upgradeStatus; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.upgradeStatus = 0; - break; - case "NOT_STARTED": - case 4: - message.upgradeStatus = 4; - break; - case "IN_PROGRESS": - case 5: - message.upgradeStatus = 5; - break; - case "SUCCESS": - case 1: - message.upgradeStatus = 1; - break; - case "FAILED": - case 2: - message.upgradeStatus = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.upgradeStatus = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.upgradeStatus = 6; - break; - case "CANCELLED": - case 7: - message.upgradeStatus = 7; - break; - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "PRIMARY": - case 1: - message.clusterType = 1; - break; - case "SECONDARY": - case 2: - message.clusterType = 2; - break; - } - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.databaseVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.databaseVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.databaseVersion = 6; - break; - } - if (object.stageInfo) { - if (!Array.isArray(object.stageInfo)) - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: array expected"); - message.stageInfo = []; - for (var i = 0; i < object.stageInfo.length; ++i) { - if (typeof object.stageInfo[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.stageInfo: object expected"); - message.stageInfo[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.fromObject(object.stageInfo[i]); - } - } - if (object.instanceUpgradeDetails) { - if (!Array.isArray(object.instanceUpgradeDetails)) - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: array expected"); - message.instanceUpgradeDetails = []; - for (var i = 0; i < object.instanceUpgradeDetails.length; ++i) { - if (typeof object.instanceUpgradeDetails[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails.instanceUpgradeDetails: object expected"); - message.instanceUpgradeDetails[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.fromObject(object.instanceUpgradeDetails[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClusterUpgradeDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails} message ClusterUpgradeDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterUpgradeDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.stageInfo = []; - object.instanceUpgradeDetails = []; - } - if (options.defaults) { - object.name = ""; - object.upgradeStatus = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) - object.upgradeStatus = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] === undefined ? message.upgradeStatus : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.upgradeStatus] : message.upgradeStatus; - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.alloydb.v1beta.Cluster.ClusterType[message.clusterType] : message.clusterType; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.stageInfo && message.stageInfo.length) { - object.stageInfo = []; - for (var j = 0; j < message.stageInfo.length; ++j) - object.stageInfo[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo.toObject(message.stageInfo[j], options); - } - if (message.instanceUpgradeDetails && message.instanceUpgradeDetails.length) { - object.instanceUpgradeDetails = []; - for (var j = 0; j < message.instanceUpgradeDetails.length; ++j) - object.instanceUpgradeDetails[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails.toObject(message.instanceUpgradeDetails[j], options); - } - return object; - }; - - /** - * Converts this ClusterUpgradeDetails to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @instance - * @returns {Object.} JSON object - */ - ClusterUpgradeDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterUpgradeDetails - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterUpgradeDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails"; - }; - - return ClusterUpgradeDetails; - })(); - - /** - * Status enum. - * @name google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} NOT_STARTED=4 NOT_STARTED value - * @property {number} IN_PROGRESS=5 IN_PROGRESS value - * @property {number} SUCCESS=1 SUCCESS value - * @property {number} FAILED=2 FAILED value - * @property {number} PARTIAL_SUCCESS=3 PARTIAL_SUCCESS value - * @property {number} CANCEL_IN_PROGRESS=6 CANCEL_IN_PROGRESS value - * @property {number} CANCELLED=7 CANCELLED value - */ - UpgradeClusterResponse.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[4] = "NOT_STARTED"] = 4; - values[valuesById[5] = "IN_PROGRESS"] = 5; - values[valuesById[1] = "SUCCESS"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "PARTIAL_SUCCESS"] = 3; - values[valuesById[6] = "CANCEL_IN_PROGRESS"] = 6; - values[valuesById[7] = "CANCELLED"] = 7; - return values; - })(); - - /** - * Stage enum. - * @name google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage - * @enum {number} - * @property {number} STAGE_UNSPECIFIED=0 STAGE_UNSPECIFIED value - * @property {number} ALLOYDB_PRECHECK=1 ALLOYDB_PRECHECK value - * @property {number} PG_UPGRADE_CHECK=2 PG_UPGRADE_CHECK value - * @property {number} PREPARE_FOR_UPGRADE=5 PREPARE_FOR_UPGRADE value - * @property {number} PRIMARY_INSTANCE_UPGRADE=3 PRIMARY_INSTANCE_UPGRADE value - * @property {number} READ_POOL_INSTANCES_UPGRADE=4 READ_POOL_INSTANCES_UPGRADE value - * @property {number} ROLLBACK=6 ROLLBACK value - * @property {number} CLEANUP=7 CLEANUP value - */ - UpgradeClusterResponse.Stage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STAGE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOYDB_PRECHECK"] = 1; - values[valuesById[2] = "PG_UPGRADE_CHECK"] = 2; - values[valuesById[5] = "PREPARE_FOR_UPGRADE"] = 5; - values[valuesById[3] = "PRIMARY_INSTANCE_UPGRADE"] = 3; - values[valuesById[4] = "READ_POOL_INSTANCES_UPGRADE"] = 4; - values[valuesById[6] = "ROLLBACK"] = 6; - values[valuesById[7] = "CLEANUP"] = 7; - return values; - })(); - - return UpgradeClusterResponse; - })(); - - v1beta.DeleteClusterRequest = (function() { - - /** - * Properties of a DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteClusterRequest - * @property {string|null} [name] DeleteClusterRequest name - * @property {string|null} [requestId] DeleteClusterRequest requestId - * @property {string|null} [etag] DeleteClusterRequest etag - * @property {boolean|null} [validateOnly] DeleteClusterRequest validateOnly - * @property {boolean|null} [force] DeleteClusterRequest force - */ - - /** - * Constructs a new DeleteClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set - */ - function DeleteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.name = ""; - - /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.requestId = ""; - - /** - * DeleteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.etag = ""; - - /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.validateOnly = false; - - /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.force = false; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest instance - */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); - }; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); - return writer; - }; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - return null; - }; - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteClusterRequest} DeleteClusterRequest - */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.DeleteClusterRequest} message DeleteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - object.force = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; - }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteClusterRequest"; - }; - - return DeleteClusterRequest; - })(); - - v1beta.SwitchoverClusterRequest = (function() { - - /** - * Properties of a SwitchoverClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ISwitchoverClusterRequest - * @property {string|null} [name] SwitchoverClusterRequest name - * @property {string|null} [requestId] SwitchoverClusterRequest requestId - * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly - */ - - /** - * Constructs a new SwitchoverClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SwitchoverClusterRequest. - * @implements ISwitchoverClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest=} [properties] Properties to set - */ - function SwitchoverClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SwitchoverClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.name = ""; - - /** - * SwitchoverClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.requestId = ""; - - /** - * SwitchoverClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @instance - */ - SwitchoverClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new SwitchoverClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest instance - */ - SwitchoverClusterRequest.create = function create(properties) { - return new SwitchoverClusterRequest(properties); - }; - - /** - * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwitchoverClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified SwitchoverClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SwitchoverClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.ISwitchoverClusterRequest} message SwitchoverClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwitchoverClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SwitchoverClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SwitchoverClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} SwitchoverClusterRequest - */ - SwitchoverClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SwitchoverClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.SwitchoverClusterRequest} message SwitchoverClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SwitchoverClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this SwitchoverClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @instance - * @returns {Object.} JSON object - */ - SwitchoverClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SwitchoverClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SwitchoverClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SwitchoverClusterRequest"; - }; - - return SwitchoverClusterRequest; - })(); - - v1beta.PromoteClusterRequest = (function() { - - /** - * Properties of a PromoteClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IPromoteClusterRequest - * @property {string|null} [name] PromoteClusterRequest name - * @property {string|null} [requestId] PromoteClusterRequest requestId - * @property {string|null} [etag] PromoteClusterRequest etag - * @property {boolean|null} [validateOnly] PromoteClusterRequest validateOnly - */ - - /** - * Constructs a new PromoteClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a PromoteClusterRequest. - * @implements IPromoteClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set - */ - function PromoteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromoteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.name = ""; - - /** - * PromoteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.requestId = ""; - - /** - * PromoteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.etag = ""; - - /** - * PromoteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - */ - PromoteClusterRequest.prototype.validateOnly = false; - - /** - * Creates a new PromoteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest instance - */ - PromoteClusterRequest.create = function create(properties) { - return new PromoteClusterRequest(properties); - }; - - /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromoteClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromoteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.PromoteClusterRequest} PromoteClusterRequest - */ - PromoteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.PromoteClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.PromoteClusterRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.PromoteClusterRequest} message PromoteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromoteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this PromoteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - PromoteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromoteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.PromoteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.PromoteClusterRequest"; - }; - - return PromoteClusterRequest; - })(); - - v1beta.RestoreClusterRequest = (function() { - - /** - * Properties of a RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IRestoreClusterRequest - * @property {google.cloud.alloydb.v1beta.IBackupSource|null} [backupSource] RestoreClusterRequest backupSource - * @property {google.cloud.alloydb.v1beta.IContinuousBackupSource|null} [continuousBackupSource] RestoreClusterRequest continuousBackupSource - * @property {string|null} [parent] RestoreClusterRequest parent - * @property {string|null} [clusterId] RestoreClusterRequest clusterId - * @property {google.cloud.alloydb.v1beta.ICluster|null} [cluster] RestoreClusterRequest cluster - * @property {string|null} [requestId] RestoreClusterRequest requestId - * @property {boolean|null} [validateOnly] RestoreClusterRequest validateOnly - */ - - /** - * Constructs a new RestoreClusterRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set - */ - function RestoreClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreClusterRequest backupSource. - * @member {google.cloud.alloydb.v1beta.IBackupSource|null|undefined} backupSource - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.backupSource = null; - - /** - * RestoreClusterRequest continuousBackupSource. - * @member {google.cloud.alloydb.v1beta.IContinuousBackupSource|null|undefined} continuousBackupSource - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.continuousBackupSource = null; - - /** - * RestoreClusterRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.parent = ""; - - /** - * RestoreClusterRequest clusterId. - * @member {string} clusterId - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.clusterId = ""; - - /** - * RestoreClusterRequest cluster. - * @member {google.cloud.alloydb.v1beta.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.cluster = null; - - /** - * RestoreClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.requestId = ""; - - /** - * RestoreClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - RestoreClusterRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreClusterRequest source. - * @member {"backupSource"|"continuousBackupSource"|undefined} source - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest instance - */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); - }; - - /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.alloydb.v1beta.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.backupSource != null && Object.hasOwnProperty.call(message, "backupSource")) - $root.google.cloud.alloydb.v1beta.BackupSource.encode(message.backupSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - if (message.continuousBackupSource != null && Object.hasOwnProperty.call(message, "continuousBackupSource")) - $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.encode(message.continuousBackupSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestoreClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.decode(reader, reader.uint32()); - break; - } - case 8: { - message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clusterId = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.decode(reader, reader.uint32()); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreClusterRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.BackupSource.verify(message.backupSource); - if (error) - return "backupSource." + error; - } - } - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.verify(message.continuousBackupSource); - if (error) - return "continuousBackupSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - if (!$util.isString(message.clusterId)) - return "clusterId: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.alloydb.v1beta.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.RestoreClusterRequest} RestoreClusterRequest - */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.RestoreClusterRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.RestoreClusterRequest(); - if (object.backupSource != null) { - if (typeof object.backupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.backupSource: object expected"); - message.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.fromObject(object.backupSource); - } - if (object.continuousBackupSource != null) { - if (typeof object.continuousBackupSource !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.continuousBackupSource: object expected"); - message.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.fromObject(object.continuousBackupSource); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.clusterId != null) - message.clusterId = String(object.clusterId); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.RestoreClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.alloydb.v1beta.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {google.cloud.alloydb.v1beta.RestoreClusterRequest} message RestoreClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clusterId != null && message.hasOwnProperty("clusterId")) - object.clusterId = message.clusterId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.alloydb.v1beta.Cluster.toObject(message.cluster, options); - if (message.backupSource != null && message.hasOwnProperty("backupSource")) { - object.backupSource = $root.google.cloud.alloydb.v1beta.BackupSource.toObject(message.backupSource, options); - if (options.oneofs) - object.source = "backupSource"; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.continuousBackupSource != null && message.hasOwnProperty("continuousBackupSource")) { - object.continuousBackupSource = $root.google.cloud.alloydb.v1beta.ContinuousBackupSource.toObject(message.continuousBackupSource, options); - if (options.oneofs) - object.source = "continuousBackupSource"; - } - return object; - }; - - /** - * Converts this RestoreClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreClusterRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.RestoreClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestoreClusterRequest"; - }; - - return RestoreClusterRequest; - })(); - - v1beta.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set - */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.filter = ""; - - /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v1beta.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.ListInstancesResponse} message ListInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v1beta.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1beta.InstanceView|null} [view] GetInstanceRequest view - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * GetInstanceRequest view. - * @member {google.cloud.alloydb.v1beta.InstanceView} view - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.view = 0; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "INSTANCE_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "INSTANCE_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "INSTANCE_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.GetInstanceRequest} message GetInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "INSTANCE_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.alloydb.v1beta.InstanceView[message.view] === undefined ? message.view : $root.google.cloud.alloydb.v1beta.InstanceView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v1beta.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [requestId] CreateInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * CreateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.requestId = ""; - - /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v1beta.CreateSecondaryInstanceRequest = (function() { - - /** - * Properties of a CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateSecondaryInstanceRequest - * @property {string|null} [parent] CreateSecondaryInstanceRequest parent - * @property {string|null} [instanceId] CreateSecondaryInstanceRequest instanceId - * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] CreateSecondaryInstanceRequest instance - * @property {string|null} [requestId] CreateSecondaryInstanceRequest requestId - * @property {boolean|null} [validateOnly] CreateSecondaryInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateSecondaryInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateSecondaryInstanceRequest. - * @implements ICreateSecondaryInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set - */ - function CreateSecondaryInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSecondaryInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.parent = ""; - - /** - * CreateSecondaryInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.instanceId = ""; - - /** - * CreateSecondaryInstanceRequest instance. - * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.instance = null; - - /** - * CreateSecondaryInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.requestId = ""; - - /** - * CreateSecondaryInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - */ - CreateSecondaryInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance - */ - CreateSecondaryInstanceRequest.create = function create(properties) { - return new CreateSecondaryInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSecondaryInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSecondaryInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest - */ - CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateSecondaryInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSecondaryInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest"; - }; - - return CreateSecondaryInstanceRequest; - })(); - - v1beta.CreateInstanceRequests = (function() { - - /** - * Properties of a CreateInstanceRequests. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests - */ - - /** - * Constructs a new CreateInstanceRequests. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set - */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @instance - */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; - - /** - * Creates a new CreateInstanceRequests instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests instance - */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); - }; - - /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequests.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createInstanceRequests != null && message.createInstanceRequests.length) - for (var i = 0; i < message.createInstanceRequests.length; ++i) - $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.encode(message.createInstanceRequests[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateInstanceRequests.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1beta.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequests.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.createInstanceRequests && message.createInstanceRequests.length)) - message.createInstanceRequests = []; - message.createInstanceRequests.push($root.google.cloud.alloydb.v1beta.CreateInstanceRequest.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequests message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequests.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createInstanceRequests != null && message.hasOwnProperty("createInstanceRequests")) { - if (!Array.isArray(message.createInstanceRequests)) - return "createInstanceRequests: array expected"; - for (var i = 0; i < message.createInstanceRequests.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.verify(message.createInstanceRequests[i]); - if (error) - return "createInstanceRequests." + error; - } - } - return null; - }; - - /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateInstanceRequests} CreateInstanceRequests - */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateInstanceRequests) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateInstanceRequests(); - if (object.createInstanceRequests) { - if (!Array.isArray(object.createInstanceRequests)) - throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: array expected"); - message.createInstanceRequests = []; - for (var i = 0; i < object.createInstanceRequests.length; ++i) { - if (typeof object.createInstanceRequests[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateInstanceRequests.createInstanceRequests: object expected"); - message.createInstanceRequests[i] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.fromObject(object.createInstanceRequests[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {google.cloud.alloydb.v1beta.CreateInstanceRequests} message CreateInstanceRequests - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequests.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.createInstanceRequests = []; - if (message.createInstanceRequests && message.createInstanceRequests.length) { - object.createInstanceRequests = []; - for (var j = 0; j < message.createInstanceRequests.length; ++j) - object.createInstanceRequests[j] = $root.google.cloud.alloydb.v1beta.CreateInstanceRequest.toObject(message.createInstanceRequests[j], options); - } - return object; - }; - - /** - * Converts this CreateInstanceRequests to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequests - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateInstanceRequests - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateInstanceRequests"; - }; - - return CreateInstanceRequests; - })(); - - v1beta.BatchCreateInstancesRequest = (function() { - - /** - * Properties of a BatchCreateInstancesRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstancesRequest - * @property {string|null} [parent] BatchCreateInstancesRequest parent - * @property {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null} [requests] BatchCreateInstancesRequest requests - * @property {string|null} [requestId] BatchCreateInstancesRequest requestId - */ - - /** - * Constructs a new BatchCreateInstancesRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set - */ - function BatchCreateInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.parent = ""; - - /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1beta.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.requests = null; - - /** - * BatchCreateInstancesRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @instance - */ - BatchCreateInstancesRequest.prototype.requestId = ""; - - /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance - */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requests != null && Object.hasOwnProperty.call(message, "requests")) - $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.encode(message.requests, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requests != null && message.hasOwnProperty("requests")) { - var error = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.verify(message.requests); - if (error) - return "requests." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} BatchCreateInstancesRequest - */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests != null) { - if (typeof object.requests !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesRequest.requests: object expected"); - message.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.fromObject(object.requests); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesRequest} message BatchCreateInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requests = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests != null && message.hasOwnProperty("requests")) - object.requests = $root.google.cloud.alloydb.v1beta.CreateInstanceRequests.toObject(message.requests, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this BatchCreateInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesRequest"; - }; - - return BatchCreateInstancesRequest; - })(); - - v1beta.BatchCreateInstancesResponse = (function() { - - /** - * Properties of a BatchCreateInstancesResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances - */ - - /** - * Constructs a new BatchCreateInstancesResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set - */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @instance - */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance - */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} BatchCreateInstancesResponse - */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesResponse} message BatchCreateInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this BatchCreateInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesResponse"; - }; - - return BatchCreateInstancesResponse; - })(); - - v1beta.BatchCreateInstancesMetadata = (function() { - - /** - * Properties of a BatchCreateInstancesMetadata. - * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses - */ - - /** - * Constructs a new BatchCreateInstancesMetadata. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata - * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set - */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @instance - */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; - - /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @instance - */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; - - /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance - */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); - }; - - /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceTargets != null && message.instanceTargets.length) - for (var i = 0; i < message.instanceTargets.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTargets[i]); - if (message.instanceStatuses != null && Object.hasOwnProperty.call(message, "instanceStatuses")) - for (var keys = Object.keys(message.instanceStatuses), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.encode(message.instanceStatuses[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); - break; - } - case 2: { - if (message.instanceStatuses === $util.emptyObject) - message.instanceStatuses = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.instanceStatuses[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstancesMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstancesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceTargets != null && message.hasOwnProperty("instanceTargets")) { - if (!Array.isArray(message.instanceTargets)) - return "instanceTargets: array expected"; - for (var i = 0; i < message.instanceTargets.length; ++i) - if (!$util.isString(message.instanceTargets[i])) - return "instanceTargets: string[] expected"; - } - if (message.instanceStatuses != null && message.hasOwnProperty("instanceStatuses")) { - if (!$util.isObject(message.instanceStatuses)) - return "instanceStatuses: object expected"; - var key = Object.keys(message.instanceStatuses); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify(message.instanceStatuses[key[i]]); - if (error) - return "instanceStatuses." + error; - } - } - return null; - }; - - /** - * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata - */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata(); - if (object.instanceTargets) { - if (!Array.isArray(object.instanceTargets)) - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceTargets: array expected"); - message.instanceTargets = []; - for (var i = 0; i < object.instanceTargets.length; ++i) - message.instanceTargets[i] = String(object.instanceTargets[i]); - } - if (object.instanceStatuses) { - if (typeof object.instanceStatuses !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses = {}; - for (var keys = Object.keys(object.instanceStatuses), i = 0; i < keys.length; ++i) { - if (typeof object.instanceStatuses[keys[i]] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.instanceStatuses: object expected"); - message.instanceStatuses[keys[i]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.fromObject(object.instanceStatuses[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instanceTargets = []; - if (options.objects || options.defaults) - object.instanceStatuses = {}; - if (message.instanceTargets && message.instanceTargets.length) { - object.instanceTargets = []; - for (var j = 0; j < message.instanceTargets.length; ++j) - object.instanceTargets[j] = message.instanceTargets[j]; - } - var keys2; - if (message.instanceStatuses && (keys2 = Object.keys(message.instanceStatuses)).length) { - object.instanceStatuses = {}; - for (var j = 0; j < keys2.length; ++j) - object.instanceStatuses[keys2[j]] = $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.toObject(message.instanceStatuses[keys2[j]], options); - } - return object; - }; - - /** - * Converts this BatchCreateInstancesMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstancesMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata"; - }; - - return BatchCreateInstancesMetadata; - })(); - - v1beta.BatchCreateInstanceStatus = (function() { - - /** - * Properties of a BatchCreateInstanceStatus. - * @memberof google.cloud.alloydb.v1beta - * @interface IBatchCreateInstanceStatus - * @property {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State|null} [state] BatchCreateInstanceStatus state - * @property {string|null} [errorMsg] BatchCreateInstanceStatus errorMsg - * @property {google.rpc.IStatus|null} [error] BatchCreateInstanceStatus error - * @property {google.cloud.alloydb.v1beta.Instance.InstanceType|null} [type] BatchCreateInstanceStatus type - */ - - /** - * Constructs a new BatchCreateInstanceStatus. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus - * @constructor - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set - */ - function BatchCreateInstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchCreateInstanceStatus state. - * @member {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State} state - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.state = 0; - - /** - * BatchCreateInstanceStatus errorMsg. - * @member {string} errorMsg - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; - - /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.error = null; - - /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1beta.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @instance - */ - BatchCreateInstanceStatus.prototype.type = 0; - - /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance - */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); - }; - - /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.errorMsg != null && Object.hasOwnProperty.call(message, "errorMsg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMsg); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1beta.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstanceStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.errorMsg = reader.string(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchCreateInstanceStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateInstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - if (!$util.isString(message.errorMsg)) - return "errorMsg: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} BatchCreateInstanceStatus - */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus) - return object; - var message = new $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING_CREATE": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "ROLLED_BACK": - case 6: - message.state = 6; - break; - } - if (object.errorMsg != null) - message.errorMsg = String(object.errorMsg); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PRIMARY": - case 1: - message.type = 1; - break; - case "READ_POOL": - case 2: - message.type = 2; - break; - case "SECONDARY": - case 3: - message.type = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {google.cloud.alloydb.v1beta.BatchCreateInstanceStatus} message BatchCreateInstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.errorMsg = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.error = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State[message.state] : message.state; - if (message.errorMsg != null && message.hasOwnProperty("errorMsg")) - object.errorMsg = message.errorMsg; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.alloydb.v1beta.Instance.InstanceType[message.type] : message.type; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - return object; - }; - - /** - * Converts this BatchCreateInstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @instance - * @returns {Object.} JSON object - */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchCreateInstanceStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.BatchCreateInstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.BatchCreateInstanceStatus"; - }; - - /** - * State enum. - * @name google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING_CREATE=1 PENDING_CREATE value - * @property {number} READY=2 READY value - * @property {number} CREATING=3 CREATING value - * @property {number} DELETING=4 DELETING value - * @property {number} FAILED=5 FAILED value - * @property {number} ROLLED_BACK=6 ROLLED_BACK value - */ - BatchCreateInstanceStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING_CREATE"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "ROLLED_BACK"] = 6; - return values; - })(); - - return BatchCreateInstanceStatus; - })(); - - v1beta.UpdateInstanceRequest = (function() { - - /** - * Properties of an UpdateInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.alloydb.v1beta.IInstance|null} [instance] UpdateInstanceRequest instance - * @property {string|null} [requestId] UpdateInstanceRequest requestId - * @property {boolean|null} [validateOnly] UpdateInstanceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateInstanceRequest allowMissing - */ - - /** - * Constructs a new UpdateInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set - */ - function UpdateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.updateMask = null; - - /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1beta.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.instance = null; - - /** - * UpdateInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.requestId = ""; - - /** - * UpdateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.validateOnly = false; - - /** - * UpdateInstanceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - */ - UpdateInstanceRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest instance - */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); - }; - - /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.alloydb.v1beta.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instance = $root.google.cloud.alloydb.v1beta.Instance.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.alloydb.v1beta.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateInstanceRequest} UpdateInstanceRequest - */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.alloydb.v1beta.Instance.fromObject(object.instance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.UpdateInstanceRequest} message UpdateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.instance = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.alloydb.v1beta.Instance.toObject(message.instance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateInstanceRequest"; - }; - - return UpdateInstanceRequest; - })(); - - v1beta.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {string|null} [requestId] DeleteInstanceRequest requestId - * @property {string|null} [etag] DeleteInstanceRequest etag - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * DeleteInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.requestId = ""; - - /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.etag = ""; - - /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v1beta.FailoverInstanceRequest = (function() { - - /** - * Properties of a FailoverInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IFailoverInstanceRequest - * @property {string|null} [name] FailoverInstanceRequest name - * @property {string|null} [requestId] FailoverInstanceRequest requestId - * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly - */ - - /** - * Constructs a new FailoverInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set - */ - function FailoverInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FailoverInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.name = ""; - - /** - * FailoverInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.requestId = ""; - - /** - * FailoverInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @instance - */ - FailoverInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new FailoverInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest instance - */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); - }; - - /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FailoverInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.FailoverInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FailoverInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FailoverInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FailoverInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.FailoverInstanceRequest} FailoverInstanceRequest - */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.FailoverInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.FailoverInstanceRequest} message FailoverInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FailoverInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this FailoverInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FailoverInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.FailoverInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.FailoverInstanceRequest"; - }; - - return FailoverInstanceRequest; - })(); - - v1beta.InjectFaultRequest = (function() { - - /** - * Properties of an InjectFaultRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IInjectFaultRequest - * @property {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType|null} [faultType] InjectFaultRequest faultType - * @property {string|null} [name] InjectFaultRequest name - * @property {string|null} [requestId] InjectFaultRequest requestId - * @property {boolean|null} [validateOnly] InjectFaultRequest validateOnly - */ - - /** - * Constructs a new InjectFaultRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an InjectFaultRequest. - * @implements IInjectFaultRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest=} [properties] Properties to set - */ - function InjectFaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InjectFaultRequest faultType. - * @member {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} faultType - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.faultType = 0; - - /** - * InjectFaultRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.name = ""; - - /** - * InjectFaultRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.requestId = ""; - - /** - * InjectFaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @instance - */ - InjectFaultRequest.prototype.validateOnly = false; - - /** - * Creates a new InjectFaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest instance - */ - InjectFaultRequest.create = function create(properties) { - return new InjectFaultRequest(properties); - }; - - /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InjectFaultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.faultType != null && Object.hasOwnProperty.call(message, "faultType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.faultType); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.InjectFaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1beta.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InjectFaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.InjectFaultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.faultType = reader.int32(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InjectFaultRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InjectFaultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.faultType != null && message.hasOwnProperty("faultType")) - switch (message.faultType) { - default: - return "faultType: enum value expected"; - case 0: - case 1: - break; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.InjectFaultRequest} InjectFaultRequest - */ - InjectFaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.InjectFaultRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.InjectFaultRequest(); - switch (object.faultType) { - default: - if (typeof object.faultType === "number") { - message.faultType = object.faultType; - break; - } - break; - case "FAULT_TYPE_UNSPECIFIED": - case 0: - message.faultType = 0; - break; - case "STOP_VM": - case 1: - message.faultType = 1; - break; - } - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {google.cloud.alloydb.v1beta.InjectFaultRequest} message InjectFaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InjectFaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.faultType != null && message.hasOwnProperty("faultType")) - object.faultType = options.enums === String ? $root.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType[message.faultType] === undefined ? message.faultType : $root.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType[message.faultType] : message.faultType; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this InjectFaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @instance - * @returns {Object.} JSON object - */ - InjectFaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InjectFaultRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.InjectFaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.InjectFaultRequest"; - }; - - /** - * FaultType enum. - * @name google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType - * @enum {number} - * @property {number} FAULT_TYPE_UNSPECIFIED=0 FAULT_TYPE_UNSPECIFIED value - * @property {number} STOP_VM=1 STOP_VM value - */ - InjectFaultRequest.FaultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FAULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STOP_VM"] = 1; - return values; - })(); - - return InjectFaultRequest; - })(); - - v1beta.RestartInstanceRequest = (function() { - - /** - * Properties of a RestartInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IRestartInstanceRequest - * @property {string|null} [name] RestartInstanceRequest name - * @property {string|null} [requestId] RestartInstanceRequest requestId - * @property {boolean|null} [validateOnly] RestartInstanceRequest validateOnly - * @property {Array.|null} [nodeIds] RestartInstanceRequest nodeIds - */ - - /** - * Constructs a new RestartInstanceRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set - */ - function RestartInstanceRequest(properties) { - this.nodeIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.name = ""; - - /** - * RestartInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.requestId = ""; - - /** - * RestartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.validateOnly = false; - - /** - * RestartInstanceRequest nodeIds. - * @member {Array.} nodeIds - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @instance - */ - RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; - - /** - * Creates a new RestartInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest instance - */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); - }; - - /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.nodeIds != null && message.nodeIds.length) - for (var i = 0; i < message.nodeIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeIds[i]); - return writer; - }; - - /** - * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.RestartInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestartInstanceRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestartInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { - if (!Array.isArray(message.nodeIds)) - return "nodeIds: array expected"; - for (var i = 0; i < message.nodeIds.length; ++i) - if (!$util.isString(message.nodeIds[i])) - return "nodeIds: string[] expected"; - } - return null; - }; - - /** - * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.RestartInstanceRequest} RestartInstanceRequest - */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.RestartInstanceRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.RestartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.nodeIds) { - if (!Array.isArray(object.nodeIds)) - throw TypeError(".google.cloud.alloydb.v1beta.RestartInstanceRequest.nodeIds: array expected"); - message.nodeIds = []; - for (var i = 0; i < object.nodeIds.length; ++i) - message.nodeIds[i] = String(object.nodeIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {google.cloud.alloydb.v1beta.RestartInstanceRequest} message RestartInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestartInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodeIds = []; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.nodeIds && message.nodeIds.length) { - object.nodeIds = []; - for (var j = 0; j < message.nodeIds.length; ++j) - object.nodeIds[j] = message.nodeIds[j]; - } - return object; - }; - - /** - * Converts this RestartInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestartInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.RestartInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.RestartInstanceRequest"; - }; - - return RestartInstanceRequest; - })(); - - v1beta.ExecuteSqlRequest = (function() { - - /** - * Properties of an ExecuteSqlRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IExecuteSqlRequest - * @property {string|null} [password] ExecuteSqlRequest password - * @property {string|null} [instance] ExecuteSqlRequest instance - * @property {string|null} [database] ExecuteSqlRequest database - * @property {string|null} [user] ExecuteSqlRequest user - * @property {string|null} [sqlStatement] ExecuteSqlRequest sqlStatement - * @property {boolean|null} [validateOnly] ExecuteSqlRequest validateOnly - */ - - /** - * Constructs a new ExecuteSqlRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ExecuteSqlRequest. - * @implements IExecuteSqlRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest=} [properties] Properties to set - */ - function ExecuteSqlRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlRequest password. - * @member {string|null|undefined} password - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.password = null; - - /** - * ExecuteSqlRequest instance. - * @member {string} instance - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.instance = ""; - - /** - * ExecuteSqlRequest database. - * @member {string} database - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.database = ""; - - /** - * ExecuteSqlRequest user. - * @member {string} user - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.user = ""; - - /** - * ExecuteSqlRequest sqlStatement. - * @member {string} sqlStatement - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.sqlStatement = ""; - - /** - * ExecuteSqlRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - ExecuteSqlRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecuteSqlRequest userCredential. - * @member {"password"|undefined} userCredential - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - */ - Object.defineProperty(ExecuteSqlRequest.prototype, "userCredential", { - get: $util.oneOfGetter($oneOfFields = ["password"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecuteSqlRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest instance - */ - ExecuteSqlRequest.create = function create(properties) { - return new ExecuteSqlRequest(properties); - }; - - /** - * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.user); - if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlStatement); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.password); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlRequest} message ExecuteSqlRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.password = reader.string(); - break; - } - case 1: { - message.instance = reader.string(); - break; - } - case 2: { - message.database = reader.string(); - break; - } - case 3: { - message.user = reader.string(); - break; - } - case 4: { - message.sqlStatement = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.password != null && message.hasOwnProperty("password")) { - properties.userCredential = 1; - if (!$util.isString(message.password)) - return "password: string expected"; - } - if (message.instance != null && message.hasOwnProperty("instance")) - if (!$util.isString(message.instance)) - return "instance: string expected"; - if (message.database != null && message.hasOwnProperty("database")) - if (!$util.isString(message.database)) - return "database: string expected"; - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) - if (!$util.isString(message.sqlStatement)) - return "sqlStatement: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlRequest} ExecuteSqlRequest - */ - ExecuteSqlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlRequest(); - if (object.password != null) - message.password = String(object.password); - if (object.instance != null) - message.instance = String(object.instance); - if (object.database != null) - message.database = String(object.database); - if (object.user != null) - message.user = String(object.user); - if (object.sqlStatement != null) - message.sqlStatement = String(object.sqlStatement); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {google.cloud.alloydb.v1beta.ExecuteSqlRequest} message ExecuteSqlRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instance = ""; - object.database = ""; - object.user = ""; - object.sqlStatement = ""; - object.validateOnly = false; - } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = message.instance; - if (message.database != null && message.hasOwnProperty("database")) - object.database = message.database; - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) - object.sqlStatement = message.sqlStatement; - if (message.password != null && message.hasOwnProperty("password")) { - object.password = message.password; - if (options.oneofs) - object.userCredential = "password"; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this ExecuteSqlRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExecuteSqlRequest"; - }; - - return ExecuteSqlRequest; - })(); - - v1beta.ExecuteSqlResponse = (function() { - - /** - * Properties of an ExecuteSqlResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IExecuteSqlResponse - * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults - * @property {google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata - */ - - /** - * Constructs a new ExecuteSqlResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ExecuteSqlResponse. - * @implements IExecuteSqlResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse=} [properties] Properties to set - */ - function ExecuteSqlResponse(properties) { - this.sqlResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlResponse sqlResults. - * @member {Array.} sqlResults - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @instance - */ - ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; - - /** - * ExecuteSqlResponse metadata. - * @member {google.cloud.alloydb.v1beta.IExecuteSqlMetadata|null|undefined} metadata - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @instance - */ - ExecuteSqlResponse.prototype.metadata = null; - - /** - * Creates a new ExecuteSqlResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse instance - */ - ExecuteSqlResponse.create = function create(properties) { - return new ExecuteSqlResponse(properties); - }; - - /** - * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sqlResults != null && message.sqlResults.length) - for (var i = 0; i < message.sqlResults.length; ++i) - $root.google.cloud.alloydb.v1beta.SqlResult.encode(message.sqlResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlResponse} message ExecuteSqlResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sqlResults && message.sqlResults.length)) - message.sqlResults = []; - message.sqlResults.push($root.google.cloud.alloydb.v1beta.SqlResult.decode(reader, reader.uint32())); - break; - } - case 3: { - message.metadata = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sqlResults != null && message.hasOwnProperty("sqlResults")) { - if (!Array.isArray(message.sqlResults)) - return "sqlResults: array expected"; - for (var i = 0; i < message.sqlResults.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.SqlResult.verify(message.sqlResults[i]); - if (error) - return "sqlResults." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlResponse} ExecuteSqlResponse - */ - ExecuteSqlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlResponse(); - if (object.sqlResults) { - if (!Array.isArray(object.sqlResults)) - throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlResponse.sqlResults: array expected"); - message.sqlResults = []; - for (var i = 0; i < object.sqlResults.length; ++i) { - if (typeof object.sqlResults[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlResponse.sqlResults: object expected"); - message.sqlResults[i] = $root.google.cloud.alloydb.v1beta.SqlResult.fromObject(object.sqlResults[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlResponse.metadata: object expected"); - message.metadata = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {google.cloud.alloydb.v1beta.ExecuteSqlResponse} message ExecuteSqlResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sqlResults = []; - if (options.defaults) - object.metadata = null; - if (message.sqlResults && message.sqlResults.length) { - object.sqlResults = []; - for (var j = 0; j < message.sqlResults.length; ++j) - object.sqlResults[j] = $root.google.cloud.alloydb.v1beta.SqlResult.toObject(message.sqlResults[j], options); - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this ExecuteSqlResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExecuteSqlResponse"; - }; - - return ExecuteSqlResponse; - })(); - - v1beta.ExecuteSqlMetadata = (function() { - - /** - * Properties of an ExecuteSqlMetadata. - * @memberof google.cloud.alloydb.v1beta - * @interface IExecuteSqlMetadata - * @property {string|null} [message] ExecuteSqlMetadata message - * @property {boolean|null} [partialResult] ExecuteSqlMetadata partialResult - * @property {google.protobuf.IDuration|null} [sqlStatementExecutionDuration] ExecuteSqlMetadata sqlStatementExecutionDuration - * @property {google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status|null} [status] ExecuteSqlMetadata status - */ - - /** - * Constructs a new ExecuteSqlMetadata. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an ExecuteSqlMetadata. - * @implements IExecuteSqlMetadata - * @constructor - * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata=} [properties] Properties to set - */ - function ExecuteSqlMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecuteSqlMetadata message. - * @member {string} message - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.message = ""; - - /** - * ExecuteSqlMetadata partialResult. - * @member {boolean} partialResult - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.partialResult = false; - - /** - * ExecuteSqlMetadata sqlStatementExecutionDuration. - * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; - - /** - * ExecuteSqlMetadata status. - * @member {google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status} status - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @instance - */ - ExecuteSqlMetadata.prototype.status = 0; - - /** - * Creates a new ExecuteSqlMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata instance - */ - ExecuteSqlMetadata.create = function create(properties) { - return new ExecuteSqlMetadata(properties); - }; - - /** - * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.partialResult); - if (message.sqlStatementExecutionDuration != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionDuration")) - $root.google.protobuf.Duration.encode(message.sqlStatementExecutionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); - return writer; - }; - - /** - * Encodes the specified ExecuteSqlMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ExecuteSqlMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IExecuteSqlMetadata} message ExecuteSqlMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.message = reader.string(); - break; - } - case 2: { - message.partialResult = reader.bool(); - break; - } - case 3: { - message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.status = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecuteSqlMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecuteSqlMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) - if (typeof message.partialResult !== "boolean") - return "partialResult: boolean expected"; - if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionDuration); - if (error) - return "sqlStatementExecutionDuration." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} ExecuteSqlMetadata - */ - ExecuteSqlMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata(); - if (object.message != null) - message.message = String(object.message); - if (object.partialResult != null) - message.partialResult = Boolean(object.partialResult); - if (object.sqlStatementExecutionDuration != null) { - if (typeof object.sqlStatementExecutionDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ExecuteSqlMetadata.sqlStatementExecutionDuration: object expected"); - message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionDuration); - } - switch (object.status) { - default: - if (typeof object.status === "number") { - message.status = object.status; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "OK": - case 1: - message.status = 1; - break; - case "PARTIAL": - case 2: - message.status = 2; - break; - case "ERROR": - case 3: - message.status = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {google.cloud.alloydb.v1beta.ExecuteSqlMetadata} message ExecuteSqlMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecuteSqlMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.message = ""; - object.partialResult = false; - object.sqlStatementExecutionDuration = null; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - } - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) - object.partialResult = message.partialResult; - if (message.sqlStatementExecutionDuration != null && message.hasOwnProperty("sqlStatementExecutionDuration")) - object.sqlStatementExecutionDuration = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionDuration, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status[message.status] === undefined ? message.status : $root.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status[message.status] : message.status; - return object; - }; - - /** - * Converts this ExecuteSqlMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @instance - * @returns {Object.} JSON object - */ - ExecuteSqlMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecuteSqlMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ExecuteSqlMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ExecuteSqlMetadata"; - }; - - /** - * Status enum. - * @name google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status - * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value - * @property {number} OK=1 OK value - * @property {number} PARTIAL=2 PARTIAL value - * @property {number} ERROR=3 ERROR value - */ - ExecuteSqlMetadata.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "OK"] = 1; - values[valuesById[2] = "PARTIAL"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return ExecuteSqlMetadata; - })(); - - v1beta.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest instance - */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); - }; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListBackupsRequest} ListBackupsRequest - */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListBackupsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {google.cloud.alloydb.v1beta.ListBackupsRequest} message ListBackupsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListBackupsRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListBackupsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsRequest"; - }; - - return ListBackupsRequest; - })(); - - v1beta.ListBackupsResponse = (function() { - - /** - * Properties of a ListBackupsResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable - */ - - /** - * Constructs a new ListBackupsResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set - */ - function ListBackupsResponse(properties) { - this.backups = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse instance - */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); - }; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.alloydb.v1beta.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListBackupsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListBackupsResponse} ListBackupsResponse - */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListBackupsResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListBackupsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {google.cloud.alloydb.v1beta.ListBackupsResponse} message ListBackupsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListBackupsResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListBackupsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListBackupsResponse"; - }; - - return ListBackupsResponse; - })(); - - v1beta.GetBackupRequest = (function() { - - /** - * Properties of a GetBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name - */ - - /** - * Constructs a new GetBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set - */ - function GetBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.name = ""; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest instance - */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); - }; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetBackupRequest} GetBackupRequest - */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.GetBackupRequest} message GetBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetBackupRequest"; - }; - - return GetBackupRequest; - })(); - - v1beta.CreateBackupRequest = (function() { - - /** - * Properties of a CreateBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {string|null} [backupId] CreateBackupRequest backupId - * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [requestId] CreateBackupRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupRequest validateOnly - */ - - /** - * Constructs a new CreateBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set - */ - function CreateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.parent = ""; - - /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backupId = ""; - - /** - * CreateBackupRequest backup. - * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.backup = null; - - /** - * CreateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.requestId = ""; - - /** - * CreateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - */ - CreateBackupRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest instance - */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); - }; - - /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.backupId = reader.string(); - break; - } - case 3: { - message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateBackupRequest} CreateBackupRequest - */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateBackupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupId != null) - message.backupId = String(object.backupId); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateBackupRequest} message CreateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupId = ""; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateBackupRequest"; - }; - - return CreateBackupRequest; - })(); - - v1beta.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.alloydb.v1beta.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateBackupRequest allowMissing - */ - - /** - * Constructs a new UpdateBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * UpdateBackupRequest backup. - * @member {google.cloud.alloydb.v1beta.IBackup|null|undefined} backup - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.requestId = ""; - - /** - * UpdateBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.validateOnly = false; - - /** - * UpdateBackupRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest instance - */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.alloydb.v1beta.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.backup = $root.google.cloud.alloydb.v1beta.Backup.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.alloydb.v1beta.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateBackupRequest} UpdateBackupRequest - */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.alloydb.v1beta.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.UpdateBackupRequest} message UpdateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.backup = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.alloydb.v1beta.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateBackupRequest"; - }; - - return UpdateBackupRequest; - })(); - - v1beta.DeleteBackupRequest = (function() { - - /** - * Properties of a DeleteBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - * @property {boolean|null} [validateOnly] DeleteBackupRequest validateOnly - * @property {string|null} [etag] DeleteBackupRequest etag - */ - - /** - * Constructs a new DeleteBackupRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set - */ - function DeleteBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.requestId = ""; - - /** - * DeleteBackupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.validateOnly = false; - - /** - * DeleteBackupRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.etag = ""; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest instance - */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteBackupRequest} DeleteBackupRequest - */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteBackupRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {google.cloud.alloydb.v1beta.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteBackupRequest"; - }; - - return DeleteBackupRequest; - })(); - - v1beta.ListSupportedDatabaseFlagsRequest = (function() { - - /** - * Properties of a ListSupportedDatabaseFlagsRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IListSupportedDatabaseFlagsRequest - * @property {string|null} [parent] ListSupportedDatabaseFlagsRequest parent - * @property {number|null} [pageSize] ListSupportedDatabaseFlagsRequest pageSize - * @property {string|null} [pageToken] ListSupportedDatabaseFlagsRequest pageToken - * @property {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope|null} [scope] ListSupportedDatabaseFlagsRequest scope - */ - - /** - * Constructs a new ListSupportedDatabaseFlagsRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListSupportedDatabaseFlagsRequest. - * @implements IListSupportedDatabaseFlagsRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - */ - function ListSupportedDatabaseFlagsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSupportedDatabaseFlagsRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.parent = ""; - - /** - * ListSupportedDatabaseFlagsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.pageSize = 0; - - /** - * ListSupportedDatabaseFlagsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.pageToken = ""; - - /** - * ListSupportedDatabaseFlagsRequest scope. - * @member {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} scope - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @instance - */ - ListSupportedDatabaseFlagsRequest.prototype.scope = 0; - - /** - * Creates a new ListSupportedDatabaseFlagsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest instance - */ - ListSupportedDatabaseFlagsRequest.create = function create(properties) { - return new ListSupportedDatabaseFlagsRequest(properties); - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.scope); - return writer; - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 6: { - message.scope = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSupportedDatabaseFlagsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSupportedDatabaseFlagsRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSupportedDatabaseFlagsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ListSupportedDatabaseFlagsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} ListSupportedDatabaseFlagsRequest - */ - ListSupportedDatabaseFlagsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - switch (object.scope) { - default: - if (typeof object.scope === "number") { - message.scope = object.scope; - break; - } - break; - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "DATABASE": - case 1: - message.scope = 1; - break; - case "CONNECTION_POOL": - case 2: - message.scope = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest} message ListSupportedDatabaseFlagsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSupportedDatabaseFlagsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] === undefined ? message.scope : $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope[message.scope] : message.scope; - return object; - }; - - /** - * Converts this ListSupportedDatabaseFlagsRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSupportedDatabaseFlagsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSupportedDatabaseFlagsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest"; - }; - - return ListSupportedDatabaseFlagsRequest; - })(); - - v1beta.ListSupportedDatabaseFlagsResponse = (function() { - - /** - * Properties of a ListSupportedDatabaseFlagsResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IListSupportedDatabaseFlagsResponse - * @property {Array.|null} [supportedDatabaseFlags] ListSupportedDatabaseFlagsResponse supportedDatabaseFlags - * @property {string|null} [nextPageToken] ListSupportedDatabaseFlagsResponse nextPageToken - */ - - /** - * Constructs a new ListSupportedDatabaseFlagsResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListSupportedDatabaseFlagsResponse. - * @implements IListSupportedDatabaseFlagsResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - */ - function ListSupportedDatabaseFlagsResponse(properties) { - this.supportedDatabaseFlags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSupportedDatabaseFlagsResponse supportedDatabaseFlags. - * @member {Array.} supportedDatabaseFlags - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.supportedDatabaseFlags = $util.emptyArray; - - /** - * ListSupportedDatabaseFlagsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @instance - */ - ListSupportedDatabaseFlagsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSupportedDatabaseFlagsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse instance - */ - ListSupportedDatabaseFlagsResponse.create = function create(properties) { - return new ListSupportedDatabaseFlagsResponse(properties); - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.supportedDatabaseFlags != null && message.supportedDatabaseFlags.length) - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) - $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.encode(message.supportedDatabaseFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSupportedDatabaseFlagsResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSupportedDatabaseFlagsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.supportedDatabaseFlags && message.supportedDatabaseFlags.length)) - message.supportedDatabaseFlags = []; - message.supportedDatabaseFlags.push($root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSupportedDatabaseFlagsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSupportedDatabaseFlagsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSupportedDatabaseFlagsResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSupportedDatabaseFlagsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.supportedDatabaseFlags != null && message.hasOwnProperty("supportedDatabaseFlags")) { - if (!Array.isArray(message.supportedDatabaseFlags)) - return "supportedDatabaseFlags: array expected"; - for (var i = 0; i < message.supportedDatabaseFlags.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.verify(message.supportedDatabaseFlags[i]); - if (error) - return "supportedDatabaseFlags." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSupportedDatabaseFlagsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} ListSupportedDatabaseFlagsResponse - */ - ListSupportedDatabaseFlagsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse(); - if (object.supportedDatabaseFlags) { - if (!Array.isArray(object.supportedDatabaseFlags)) - throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: array expected"); - message.supportedDatabaseFlags = []; - for (var i = 0; i < object.supportedDatabaseFlags.length; ++i) { - if (typeof object.supportedDatabaseFlags[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse.supportedDatabaseFlags: object expected"); - message.supportedDatabaseFlags[i] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.fromObject(object.supportedDatabaseFlags[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSupportedDatabaseFlagsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse} message ListSupportedDatabaseFlagsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSupportedDatabaseFlagsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.supportedDatabaseFlags = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.supportedDatabaseFlags && message.supportedDatabaseFlags.length) { - object.supportedDatabaseFlags = []; - for (var j = 0; j < message.supportedDatabaseFlags.length; ++j) - object.supportedDatabaseFlags[j] = $root.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.toObject(message.supportedDatabaseFlags[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSupportedDatabaseFlagsResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSupportedDatabaseFlagsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSupportedDatabaseFlagsResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSupportedDatabaseFlagsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse"; - }; - - return ListSupportedDatabaseFlagsResponse; - })(); - - v1beta.GenerateClientCertificateRequest = (function() { - - /** - * Properties of a GenerateClientCertificateRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IGenerateClientCertificateRequest - * @property {string|null} [parent] GenerateClientCertificateRequest parent - * @property {string|null} [requestId] GenerateClientCertificateRequest requestId - * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr - * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration - * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey - * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange - */ - - /** - * Constructs a new GenerateClientCertificateRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GenerateClientCertificateRequest. - * @implements IGenerateClientCertificateRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set - */ - function GenerateClientCertificateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateClientCertificateRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.parent = ""; - - /** - * GenerateClientCertificateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.requestId = ""; - - /** - * GenerateClientCertificateRequest pemCsr. - * @member {string} pemCsr - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.pemCsr = ""; - - /** - * GenerateClientCertificateRequest certDuration. - * @member {google.protobuf.IDuration|null|undefined} certDuration - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.certDuration = null; - - /** - * GenerateClientCertificateRequest publicKey. - * @member {string} publicKey - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.publicKey = ""; - - /** - * GenerateClientCertificateRequest useMetadataExchange. - * @member {boolean} useMetadataExchange - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - */ - GenerateClientCertificateRequest.prototype.useMetadataExchange = false; - - /** - * Creates a new GenerateClientCertificateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest instance - */ - GenerateClientCertificateRequest.create = function create(properties) { - return new GenerateClientCertificateRequest(properties); - }; - - /** - * Encodes the specified GenerateClientCertificateRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.pemCsr != null && Object.hasOwnProperty.call(message, "pemCsr")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pemCsr); - if (message.certDuration != null && Object.hasOwnProperty.call(message, "certDuration")) - $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); - if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); - return writer; - }; - - /** - * Encodes the specified GenerateClientCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest} message GenerateClientCertificateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.pemCsr = reader.string(); - break; - } - case 4: { - message.certDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.publicKey = reader.string(); - break; - } - case 6: { - message.useMetadataExchange = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateClientCertificateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateClientCertificateRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateClientCertificateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - if (!$util.isString(message.pemCsr)) - return "pemCsr: string expected"; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) { - var error = $root.google.protobuf.Duration.verify(message.certDuration); - if (error) - return "certDuration." + error; - } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!$util.isString(message.publicKey)) - return "publicKey: string expected"; - if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) - if (typeof message.useMetadataExchange !== "boolean") - return "useMetadataExchange: boolean expected"; - return null; - }; - - /** - * Creates a GenerateClientCertificateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} GenerateClientCertificateRequest - */ - GenerateClientCertificateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.pemCsr != null) - message.pemCsr = String(object.pemCsr); - if (object.certDuration != null) { - if (typeof object.certDuration !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateRequest.certDuration: object expected"); - message.certDuration = $root.google.protobuf.Duration.fromObject(object.certDuration); - } - if (object.publicKey != null) - message.publicKey = String(object.publicKey); - if (object.useMetadataExchange != null) - message.useMetadataExchange = Boolean(object.useMetadataExchange); - return message; - }; - - /** - * Creates a plain object from a GenerateClientCertificateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateRequest} message GenerateClientCertificateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateClientCertificateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - object.pemCsr = ""; - object.certDuration = null; - object.publicKey = ""; - object.useMetadataExchange = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.pemCsr != null && message.hasOwnProperty("pemCsr")) - object.pemCsr = message.pemCsr; - if (message.certDuration != null && message.hasOwnProperty("certDuration")) - object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = message.publicKey; - if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) - object.useMetadataExchange = message.useMetadataExchange; - return object; - }; - - /** - * Converts this GenerateClientCertificateRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @instance - * @returns {Object.} JSON object - */ - GenerateClientCertificateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateClientCertificateRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateClientCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateRequest"; - }; - - return GenerateClientCertificateRequest; - })(); - - v1beta.GenerateClientCertificateResponse = (function() { - - /** - * Properties of a GenerateClientCertificateResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IGenerateClientCertificateResponse - * @property {string|null} [pemCertificate] GenerateClientCertificateResponse pemCertificate - * @property {Array.|null} [pemCertificateChain] GenerateClientCertificateResponse pemCertificateChain - * @property {string|null} [caCert] GenerateClientCertificateResponse caCert - */ - - /** - * Constructs a new GenerateClientCertificateResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GenerateClientCertificateResponse. - * @implements IGenerateClientCertificateResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set - */ - function GenerateClientCertificateResponse(properties) { - this.pemCertificateChain = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenerateClientCertificateResponse pemCertificate. - * @member {string} pemCertificate - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.pemCertificate = ""; - - /** - * GenerateClientCertificateResponse pemCertificateChain. - * @member {Array.} pemCertificateChain - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.pemCertificateChain = $util.emptyArray; - - /** - * GenerateClientCertificateResponse caCert. - * @member {string} caCert - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @instance - */ - GenerateClientCertificateResponse.prototype.caCert = ""; - - /** - * Creates a new GenerateClientCertificateResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse instance - */ - GenerateClientCertificateResponse.create = function create(properties) { - return new GenerateClientCertificateResponse(properties); - }; - - /** - * Encodes the specified GenerateClientCertificateResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); - if (message.pemCertificateChain != null && message.pemCertificateChain.length) - for (var i = 0; i < message.pemCertificateChain.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemCertificateChain[i]); - if (message.caCert != null && Object.hasOwnProperty.call(message, "caCert")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.caCert); - return writer; - }; - - /** - * Encodes the specified GenerateClientCertificateResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse} message GenerateClientCertificateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenerateClientCertificateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pemCertificate = reader.string(); - break; - } - case 2: { - if (!(message.pemCertificateChain && message.pemCertificateChain.length)) - message.pemCertificateChain = []; - message.pemCertificateChain.push(reader.string()); - break; - } - case 3: { - message.caCert = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenerateClientCertificateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenerateClientCertificateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenerateClientCertificateResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenerateClientCertificateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - if (!$util.isString(message.pemCertificate)) - return "pemCertificate: string expected"; - if (message.pemCertificateChain != null && message.hasOwnProperty("pemCertificateChain")) { - if (!Array.isArray(message.pemCertificateChain)) - return "pemCertificateChain: array expected"; - for (var i = 0; i < message.pemCertificateChain.length; ++i) - if (!$util.isString(message.pemCertificateChain[i])) - return "pemCertificateChain: string[] expected"; - } - if (message.caCert != null && message.hasOwnProperty("caCert")) - if (!$util.isString(message.caCert)) - return "caCert: string expected"; - return null; - }; - - /** - * Creates a GenerateClientCertificateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} GenerateClientCertificateResponse - */ - GenerateClientCertificateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse(); - if (object.pemCertificate != null) - message.pemCertificate = String(object.pemCertificate); - if (object.pemCertificateChain) { - if (!Array.isArray(object.pemCertificateChain)) - throw TypeError(".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse.pemCertificateChain: array expected"); - message.pemCertificateChain = []; - for (var i = 0; i < object.pemCertificateChain.length; ++i) - message.pemCertificateChain[i] = String(object.pemCertificateChain[i]); - } - if (object.caCert != null) - message.caCert = String(object.caCert); - return message; - }; - - /** - * Creates a plain object from a GenerateClientCertificateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {google.cloud.alloydb.v1beta.GenerateClientCertificateResponse} message GenerateClientCertificateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenerateClientCertificateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pemCertificateChain = []; - if (options.defaults) { - object.pemCertificate = ""; - object.caCert = ""; - } - if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) - object.pemCertificate = message.pemCertificate; - if (message.pemCertificateChain && message.pemCertificateChain.length) { - object.pemCertificateChain = []; - for (var j = 0; j < message.pemCertificateChain.length; ++j) - object.pemCertificateChain[j] = message.pemCertificateChain[j]; - } - if (message.caCert != null && message.hasOwnProperty("caCert")) - object.caCert = message.caCert; - return object; - }; - - /** - * Converts this GenerateClientCertificateResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @instance - * @returns {Object.} JSON object - */ - GenerateClientCertificateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenerateClientCertificateResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenerateClientCertificateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GenerateClientCertificateResponse"; - }; - - return GenerateClientCertificateResponse; - })(); - - v1beta.GetConnectionInfoRequest = (function() { - - /** - * Properties of a GetConnectionInfoRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IGetConnectionInfoRequest - * @property {string|null} [parent] GetConnectionInfoRequest parent - * @property {string|null} [requestId] GetConnectionInfoRequest requestId - */ - - /** - * Constructs a new GetConnectionInfoRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetConnectionInfoRequest. - * @implements IGetConnectionInfoRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set - */ - function GetConnectionInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetConnectionInfoRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @instance - */ - GetConnectionInfoRequest.prototype.parent = ""; - - /** - * GetConnectionInfoRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @instance - */ - GetConnectionInfoRequest.prototype.requestId = ""; - - /** - * Creates a new GetConnectionInfoRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest instance - */ - GetConnectionInfoRequest.create = function create(properties) { - return new GetConnectionInfoRequest(properties); - }; - - /** - * Encodes the specified GetConnectionInfoRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConnectionInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified GetConnectionInfoRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetConnectionInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetConnectionInfoRequest} message GetConnectionInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetConnectionInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConnectionInfoRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetConnectionInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetConnectionInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetConnectionInfoRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetConnectionInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a GetConnectionInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} GetConnectionInfoRequest - */ - GetConnectionInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GetConnectionInfoRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a GetConnectionInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {google.cloud.alloydb.v1beta.GetConnectionInfoRequest} message GetConnectionInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetConnectionInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this GetConnectionInfoRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetConnectionInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetConnectionInfoRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetConnectionInfoRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetConnectionInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetConnectionInfoRequest"; - }; - - return GetConnectionInfoRequest; - })(); - - v1beta.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.alloydb.v1beta - * @interface IOperationMetadata - * @property {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null} [batchCreateInstancesMetadata] OperationMetadata batchCreateInstancesMetadata - * @property {google.cloud.alloydb.v1beta.IPromoteClusterStatus|null} [promoteClusterStatus] OperationMetadata promoteClusterStatus - * @property {google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null} [upgradeClusterStatus] OperationMetadata upgradeClusterStatus - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata batchCreateInstancesMetadata. - * @member {google.cloud.alloydb.v1beta.IBatchCreateInstancesMetadata|null|undefined} batchCreateInstancesMetadata - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.batchCreateInstancesMetadata = null; - - /** - * OperationMetadata promoteClusterStatus. - * @member {google.cloud.alloydb.v1beta.IPromoteClusterStatus|null|undefined} promoteClusterStatus - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.promoteClusterStatus = null; - - /** - * OperationMetadata upgradeClusterStatus. - * @member {google.cloud.alloydb.v1beta.IUpgradeClusterStatus|null|undefined} upgradeClusterStatus - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.upgradeClusterStatus = null; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OperationMetadata requestSpecific. - * @member {"batchCreateInstancesMetadata"|"promoteClusterStatus"|"upgradeClusterStatus"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata", "promoteClusterStatus", "upgradeClusterStatus"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.batchCreateInstancesMetadata != null && Object.hasOwnProperty.call(message, "batchCreateInstancesMetadata")) - $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.encode(message.batchCreateInstancesMetadata, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.promoteClusterStatus != null && Object.hasOwnProperty.call(message, "promoteClusterStatus")) - $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.encode(message.promoteClusterStatus, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.upgradeClusterStatus != null && Object.hasOwnProperty.call(message, "upgradeClusterStatus")) - $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.encode(message.upgradeClusterStatus, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.decode(reader, reader.uint32()); - break; - } - case 9: { - message.promoteClusterStatus = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.decode(reader, reader.uint32()); - break; - } - case 10: { - message.upgradeClusterStatus = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.decode(reader, reader.uint32()); - break; - } - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.verify(message.batchCreateInstancesMetadata); - if (error) - return "batchCreateInstancesMetadata." + error; - } - } - if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { - if (properties.requestSpecific === 1) - return "requestSpecific: multiple values"; - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.verify(message.promoteClusterStatus); - if (error) - return "promoteClusterStatus." + error; - } - } - if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { - if (properties.requestSpecific === 1) - return "requestSpecific: multiple values"; - properties.requestSpecific = 1; - { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify(message.upgradeClusterStatus); - if (error) - return "upgradeClusterStatus." + error; - } - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.OperationMetadata) - return object; - var message = new $root.google.cloud.alloydb.v1beta.OperationMetadata(); - if (object.batchCreateInstancesMetadata != null) { - if (typeof object.batchCreateInstancesMetadata !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.batchCreateInstancesMetadata: object expected"); - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.fromObject(object.batchCreateInstancesMetadata); - } - if (object.promoteClusterStatus != null) { - if (typeof object.promoteClusterStatus !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.promoteClusterStatus: object expected"); - message.promoteClusterStatus = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.fromObject(object.promoteClusterStatus); - } - if (object.upgradeClusterStatus != null) { - if (typeof object.upgradeClusterStatus !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.upgradeClusterStatus: object expected"); - message.upgradeClusterStatus = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.fromObject(object.upgradeClusterStatus); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {google.cloud.alloydb.v1beta.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - if (message.batchCreateInstancesMetadata != null && message.hasOwnProperty("batchCreateInstancesMetadata")) { - object.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.toObject(message.batchCreateInstancesMetadata, options); - if (options.oneofs) - object.requestSpecific = "batchCreateInstancesMetadata"; - } - if (message.promoteClusterStatus != null && message.hasOwnProperty("promoteClusterStatus")) { - object.promoteClusterStatus = $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.toObject(message.promoteClusterStatus, options); - if (options.oneofs) - object.requestSpecific = "promoteClusterStatus"; - } - if (message.upgradeClusterStatus != null && message.hasOwnProperty("upgradeClusterStatus")) { - object.upgradeClusterStatus = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.toObject(message.upgradeClusterStatus, options); - if (options.oneofs) - object.requestSpecific = "upgradeClusterStatus"; - } - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1beta.PromoteClusterStatus = (function() { - - /** - * Properties of a PromoteClusterStatus. - * @memberof google.cloud.alloydb.v1beta - * @interface IPromoteClusterStatus - * @property {google.cloud.alloydb.v1beta.PromoteClusterStatus.State|null} [state] PromoteClusterStatus state - */ - - /** - * Constructs a new PromoteClusterStatus. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a PromoteClusterStatus. - * @implements IPromoteClusterStatus - * @constructor - * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus=} [properties] Properties to set - */ - function PromoteClusterStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PromoteClusterStatus state. - * @member {google.cloud.alloydb.v1beta.PromoteClusterStatus.State} state - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @instance - */ - PromoteClusterStatus.prototype.state = 0; - - /** - * Creates a new PromoteClusterStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus instance - */ - PromoteClusterStatus.create = function create(properties) { - return new PromoteClusterStatus(properties); - }; - - /** - * Encodes the specified PromoteClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - return writer; - }; - - /** - * Encodes the specified PromoteClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.PromoteClusterStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.IPromoteClusterStatus} message PromoteClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PromoteClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.PromoteClusterStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PromoteClusterStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PromoteClusterStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PromoteClusterStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PromoteClusterStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a PromoteClusterStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.PromoteClusterStatus} PromoteClusterStatus - */ - PromoteClusterStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.PromoteClusterStatus) - return object; - var message = new $root.google.cloud.alloydb.v1beta.PromoteClusterStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": - case 1: - message.state = 1; - break; - case "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": - case 2: - message.state = 2; - break; - case "PROMOTE_CLUSTER_COMPLETED": - case 3: - message.state = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a PromoteClusterStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.PromoteClusterStatus} message PromoteClusterStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PromoteClusterStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.State[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.PromoteClusterStatus.State[message.state] : message.state; - return object; - }; - - /** - * Converts this PromoteClusterStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @instance - * @returns {Object.} JSON object - */ - PromoteClusterStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PromoteClusterStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.PromoteClusterStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PromoteClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.PromoteClusterStatus"; - }; - - /** - * State enum. - * @name google.cloud.alloydb.v1beta.PromoteClusterStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_READ=1 PROMOTE_CLUSTER_AVAILABLE_FOR_READ value - * @property {number} PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE=2 PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE value - * @property {number} PROMOTE_CLUSTER_COMPLETED=3 PROMOTE_CLUSTER_COMPLETED value - */ - PromoteClusterStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROMOTE_CLUSTER_AVAILABLE_FOR_READ"] = 1; - values[valuesById[2] = "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE"] = 2; - values[valuesById[3] = "PROMOTE_CLUSTER_COMPLETED"] = 3; - return values; - })(); - - return PromoteClusterStatus; - })(); - - v1beta.UpgradeClusterStatus = (function() { - - /** - * Properties of an UpgradeClusterStatus. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpgradeClusterStatus - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [state] UpgradeClusterStatus state - * @property {boolean|null} [cancellable] UpgradeClusterStatus cancellable - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [sourceVersion] UpgradeClusterStatus sourceVersion - * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [targetVersion] UpgradeClusterStatus targetVersion - * @property {Array.|null} [stages] UpgradeClusterStatus stages - */ - - /** - * Constructs a new UpgradeClusterStatus. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpgradeClusterStatus. - * @implements IUpgradeClusterStatus - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus=} [properties] Properties to set - */ - function UpgradeClusterStatus(properties) { - this.stages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeClusterStatus state. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} state - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.state = 0; - - /** - * UpgradeClusterStatus cancellable. - * @member {boolean} cancellable - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.cancellable = false; - - /** - * UpgradeClusterStatus sourceVersion. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} sourceVersion - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.sourceVersion = 0; - - /** - * UpgradeClusterStatus targetVersion. - * @member {google.cloud.alloydb.v1beta.DatabaseVersion} targetVersion - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.targetVersion = 0; - - /** - * UpgradeClusterStatus stages. - * @member {Array.} stages - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @instance - */ - UpgradeClusterStatus.prototype.stages = $util.emptyArray; - - /** - * Creates a new UpgradeClusterStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus instance - */ - UpgradeClusterStatus.create = function create(properties) { - return new UpgradeClusterStatus(properties); - }; - - /** - * Encodes the specified UpgradeClusterStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.cancellable != null && Object.hasOwnProperty.call(message, "cancellable")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cancellable); - if (message.sourceVersion != null && Object.hasOwnProperty.call(message, "sourceVersion")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sourceVersion); - if (message.targetVersion != null && Object.hasOwnProperty.call(message, "targetVersion")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.targetVersion); - if (message.stages != null && message.stages.length) - for (var i = 0; i < message.stages.length; ++i) - $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.encode(message.stages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeClusterStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.IUpgradeClusterStatus} message UpgradeClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.cancellable = reader.bool(); - break; - } - case 3: { - message.sourceVersion = reader.int32(); - break; - } - case 4: { - message.targetVersion = reader.int32(); - break; - } - case 5: { - if (!(message.stages && message.stages.length)) - message.stages = []; - message.stages.push($root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeClusterStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeClusterStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeClusterStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeClusterStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.cancellable != null && message.hasOwnProperty("cancellable")) - if (typeof message.cancellable !== "boolean") - return "cancellable: boolean expected"; - if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) - switch (message.sourceVersion) { - default: - return "sourceVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) - switch (message.targetVersion) { - default: - return "targetVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stages != null && message.hasOwnProperty("stages")) { - if (!Array.isArray(message.stages)) - return "stages: array expected"; - for (var i = 0; i < message.stages.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify(message.stages[i]); - if (error) - return "stages." + error; - } - } - return null; - }; - - /** - * Creates an UpgradeClusterStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus} UpgradeClusterStatus - */ - UpgradeClusterStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "IN_PROGRESS": - case 5: - message.state = 5; - break; - case "SUCCESS": - case 1: - message.state = 1; - break; - case "FAILED": - case 2: - message.state = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.state = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.cancellable != null) - message.cancellable = Boolean(object.cancellable); - switch (object.sourceVersion) { - default: - if (typeof object.sourceVersion === "number") { - message.sourceVersion = object.sourceVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.sourceVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.sourceVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.sourceVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.sourceVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.sourceVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.sourceVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.sourceVersion = 6; - break; - } - switch (object.targetVersion) { - default: - if (typeof object.targetVersion === "number") { - message.targetVersion = object.targetVersion; - break; - } - break; - case "DATABASE_VERSION_UNSPECIFIED": - case 0: - message.targetVersion = 0; - break; - case "POSTGRES_13": - case 1: - message.targetVersion = 1; - break; - case "POSTGRES_14": - case 2: - message.targetVersion = 2; - break; - case "POSTGRES_15": - case 3: - message.targetVersion = 3; - break; - case "POSTGRES_16": - case 4: - message.targetVersion = 4; - break; - case "POSTGRES_17": - case 5: - message.targetVersion = 5; - break; - case "POSTGRES_18": - case 6: - message.targetVersion = 6; - break; - } - if (object.stages) { - if (!Array.isArray(object.stages)) - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.stages: array expected"); - message.stages = []; - for (var i = 0; i < object.stages.length; ++i) { - if (typeof object.stages[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.stages: object expected"); - message.stages[i] = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.fromObject(object.stages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an UpgradeClusterStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus} message UpgradeClusterStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeClusterStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.stages = []; - if (options.defaults) { - object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.cancellable = false; - object.sourceVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - object.targetVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] : message.state; - if (message.cancellable != null && message.hasOwnProperty("cancellable")) - object.cancellable = message.cancellable; - if (message.sourceVersion != null && message.hasOwnProperty("sourceVersion")) - object.sourceVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.sourceVersion] === undefined ? message.sourceVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.sourceVersion] : message.sourceVersion; - if (message.targetVersion != null && message.hasOwnProperty("targetVersion")) - object.targetVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.targetVersion] === undefined ? message.targetVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.targetVersion] : message.targetVersion; - if (message.stages && message.stages.length) { - object.stages = []; - for (var j = 0; j < message.stages.length; ++j) - object.stages[j] = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.toObject(message.stages[j], options); - } - return object; - }; - - /** - * Converts this UpgradeClusterStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @instance - * @returns {Object.} JSON object - */ - UpgradeClusterStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpgradeClusterStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpgradeClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus"; - }; - - UpgradeClusterStatus.StageStatus = (function() { - - /** - * Properties of a StageStatus. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @interface IStageStatus - * @property {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null} [readPoolInstancesUpgrade] StageStatus readPoolInstancesUpgrade - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage|null} [stage] StageStatus stage - * @property {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status|null} [state] StageStatus state - * @property {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null} [schedule] StageStatus schedule - */ - - /** - * Constructs a new StageStatus. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @classdesc Represents a StageStatus. - * @implements IStageStatus - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set - */ - function StageStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageStatus readPoolInstancesUpgrade. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus|null|undefined} readPoolInstancesUpgrade - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.readPoolInstancesUpgrade = null; - - /** - * StageStatus stage. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage} stage - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.stage = 0; - - /** - * StageStatus state. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status} state - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.state = 0; - - /** - * StageStatus schedule. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule|null|undefined} schedule - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @instance - */ - StageStatus.prototype.schedule = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * StageStatus stageSpecificStatus. - * @member {"readPoolInstancesUpgrade"|undefined} stageSpecificStatus - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @instance - */ - Object.defineProperty(StageStatus.prototype, "stageSpecificStatus", { - get: $util.oneOfGetter($oneOfFields = ["readPoolInstancesUpgrade"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StageStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus instance - */ - StageStatus.create = function create(properties) { - return new StageStatus(properties); - }; - - /** - * Encodes the specified StageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stage); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.encode(message.schedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readPoolInstancesUpgrade != null && Object.hasOwnProperty.call(message, "readPoolInstancesUpgrade")) - $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.encode(message.readPoolInstancesUpgrade, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IStageStatus} message StageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 11: { - message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.decode(reader, reader.uint32()); - break; - } - case 1: { - message.stage = reader.int32(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.schedule = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { - properties.stageSpecificStatus = 1; - { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify(message.readPoolInstancesUpgrade); - if (error) - return "readPoolInstancesUpgrade." + error; - } - } - if (message.stage != null && message.hasOwnProperty("stage")) - switch (message.stage) { - default: - return "stage: enum value expected"; - case 0: - case 1: - case 2: - case 5: - case 3: - case 4: - case 6: - case 7: - break; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 4: - case 5: - case 1: - case 2: - case 3: - case 6: - case 7: - break; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify(message.schedule); - if (error) - return "schedule." + error; - } - return null; - }; - - /** - * Creates a StageStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} StageStatus - */ - StageStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus(); - if (object.readPoolInstancesUpgrade != null) { - if (typeof object.readPoolInstancesUpgrade !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.readPoolInstancesUpgrade: object expected"); - message.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.fromObject(object.readPoolInstancesUpgrade); - } - switch (object.stage) { - default: - if (typeof object.stage === "number") { - message.stage = object.stage; - break; - } - break; - case "STAGE_UNSPECIFIED": - case 0: - message.stage = 0; - break; - case "ALLOYDB_PRECHECK": - case 1: - message.stage = 1; - break; - case "PG_UPGRADE_CHECK": - case 2: - message.stage = 2; - break; - case "PREPARE_FOR_UPGRADE": - case 5: - message.stage = 5; - break; - case "PRIMARY_INSTANCE_UPGRADE": - case 3: - message.stage = 3; - break; - case "READ_POOL_INSTANCES_UPGRADE": - case 4: - message.stage = 4; - break; - case "ROLLBACK": - case 6: - message.stage = 6; - break; - case "CLEANUP": - case 7: - message.stage = 7; - break; - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATUS_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "IN_PROGRESS": - case 5: - message.state = 5; - break; - case "SUCCESS": - case 1: - message.state = 1; - break; - case "FAILED": - case 2: - message.state = 2; - break; - case "PARTIAL_SUCCESS": - case 3: - message.state = 3; - break; - case "CANCEL_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.schedule: object expected"); - message.schedule = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.fromObject(object.schedule); - } - return message; - }; - - /** - * Creates a plain object from a StageStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus} message StageStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stage = options.enums === String ? "STAGE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATUS_UNSPECIFIED" : 0; - object.schedule = null; - } - if (message.stage != null && message.hasOwnProperty("stage")) - object.stage = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] === undefined ? message.stage : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage[message.stage] : message.stage; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] === undefined ? message.state : $root.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status[message.state] : message.state; - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.toObject(message.schedule, options); - if (message.readPoolInstancesUpgrade != null && message.hasOwnProperty("readPoolInstancesUpgrade")) { - object.readPoolInstancesUpgrade = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.toObject(message.readPoolInstancesUpgrade, options); - if (options.oneofs) - object.stageSpecificStatus = "readPoolInstancesUpgrade"; - } - return object; - }; - - /** - * Converts this StageStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @instance - * @returns {Object.} JSON object - */ - StageStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus"; - }; - - StageStatus.StageSchedule = (function() { - - /** - * Properties of a StageSchedule. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @interface IStageSchedule - * @property {google.protobuf.ITimestamp|null} [estimatedStartTime] StageSchedule estimatedStartTime - * @property {google.protobuf.ITimestamp|null} [actualStartTime] StageSchedule actualStartTime - * @property {google.protobuf.ITimestamp|null} [estimatedEndTime] StageSchedule estimatedEndTime - * @property {google.protobuf.ITimestamp|null} [actualEndTime] StageSchedule actualEndTime - */ - - /** - * Constructs a new StageSchedule. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus - * @classdesc Represents a StageSchedule. - * @implements IStageSchedule - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set - */ - function StageSchedule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StageSchedule estimatedStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} estimatedStartTime - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.estimatedStartTime = null; - - /** - * StageSchedule actualStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} actualStartTime - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.actualStartTime = null; - - /** - * StageSchedule estimatedEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} estimatedEndTime - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.estimatedEndTime = null; - - /** - * StageSchedule actualEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} actualEndTime - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - */ - StageSchedule.prototype.actualEndTime = null; - - /** - * Creates a new StageSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule instance - */ - StageSchedule.create = function create(properties) { - return new StageSchedule(properties); - }; - - /** - * Encodes the specified StageSchedule message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.estimatedStartTime != null && Object.hasOwnProperty.call(message, "estimatedStartTime")) - $root.google.protobuf.Timestamp.encode(message.estimatedStartTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.actualStartTime != null && Object.hasOwnProperty.call(message, "actualStartTime")) - $root.google.protobuf.Timestamp.encode(message.actualStartTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.estimatedEndTime != null && Object.hasOwnProperty.call(message, "estimatedEndTime")) - $root.google.protobuf.Timestamp.encode(message.estimatedEndTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.actualEndTime != null && Object.hasOwnProperty.call(message, "actualEndTime")) - $root.google.protobuf.Timestamp.encode(message.actualEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StageSchedule message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.IStageSchedule} message StageSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StageSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StageSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.estimatedStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.actualStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.estimatedEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.actualEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StageSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StageSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StageSchedule message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StageSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.estimatedStartTime); - if (error) - return "estimatedStartTime." + error; - } - if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.actualStartTime); - if (error) - return "actualStartTime." + error; - } - if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.estimatedEndTime); - if (error) - return "estimatedEndTime." + error; - } - if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.actualEndTime); - if (error) - return "actualEndTime." + error; - } - return null; - }; - - /** - * Creates a StageSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} StageSchedule - */ - StageSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule(); - if (object.estimatedStartTime != null) { - if (typeof object.estimatedStartTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedStartTime: object expected"); - message.estimatedStartTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedStartTime); - } - if (object.actualStartTime != null) { - if (typeof object.actualStartTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.actualStartTime: object expected"); - message.actualStartTime = $root.google.protobuf.Timestamp.fromObject(object.actualStartTime); - } - if (object.estimatedEndTime != null) { - if (typeof object.estimatedEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.estimatedEndTime: object expected"); - message.estimatedEndTime = $root.google.protobuf.Timestamp.fromObject(object.estimatedEndTime); - } - if (object.actualEndTime != null) { - if (typeof object.actualEndTime !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule.actualEndTime: object expected"); - message.actualEndTime = $root.google.protobuf.Timestamp.fromObject(object.actualEndTime); - } - return message; - }; - - /** - * Creates a plain object from a StageSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule} message StageSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StageSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.estimatedStartTime = null; - object.actualStartTime = null; - object.estimatedEndTime = null; - object.actualEndTime = null; - } - if (message.estimatedStartTime != null && message.hasOwnProperty("estimatedStartTime")) - object.estimatedStartTime = $root.google.protobuf.Timestamp.toObject(message.estimatedStartTime, options); - if (message.actualStartTime != null && message.hasOwnProperty("actualStartTime")) - object.actualStartTime = $root.google.protobuf.Timestamp.toObject(message.actualStartTime, options); - if (message.estimatedEndTime != null && message.hasOwnProperty("estimatedEndTime")) - object.estimatedEndTime = $root.google.protobuf.Timestamp.toObject(message.estimatedEndTime, options); - if (message.actualEndTime != null && message.hasOwnProperty("actualEndTime")) - object.actualEndTime = $root.google.protobuf.Timestamp.toObject(message.actualEndTime, options); - return object; - }; - - /** - * Converts this StageSchedule to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @instance - * @returns {Object.} JSON object - */ - StageSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StageSchedule - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StageSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageSchedule"; - }; - - return StageSchedule; - })(); - - return StageStatus; - })(); - - UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus = (function() { - - /** - * Properties of a ReadPoolInstancesUpgradeStageStatus. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @interface IReadPoolInstancesUpgradeStageStatus - * @property {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null} [upgradeStats] ReadPoolInstancesUpgradeStageStatus upgradeStats - */ - - /** - * Constructs a new ReadPoolInstancesUpgradeStageStatus. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus - * @classdesc Represents a ReadPoolInstancesUpgradeStageStatus. - * @implements IReadPoolInstancesUpgradeStageStatus - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set - */ - function ReadPoolInstancesUpgradeStageStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReadPoolInstancesUpgradeStageStatus upgradeStats. - * @member {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats|null|undefined} upgradeStats - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @instance - */ - ReadPoolInstancesUpgradeStageStatus.prototype.upgradeStats = null; - - /** - * Creates a new ReadPoolInstancesUpgradeStageStatus instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus instance - */ - ReadPoolInstancesUpgradeStageStatus.create = function create(properties) { - return new ReadPoolInstancesUpgradeStageStatus(properties); - }; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolInstancesUpgradeStageStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgradeStats != null && Object.hasOwnProperty.call(message, "upgradeStats")) - $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.encode(message.upgradeStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadPoolInstancesUpgradeStageStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.IReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadPoolInstancesUpgradeStageStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolInstancesUpgradeStageStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.upgradeStats = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReadPoolInstancesUpgradeStageStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadPoolInstancesUpgradeStageStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReadPoolInstancesUpgradeStageStatus message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadPoolInstancesUpgradeStageStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) { - var error = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify(message.upgradeStats); - if (error) - return "upgradeStats." + error; - } - return null; - }; - - /** - * Creates a ReadPoolInstancesUpgradeStageStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} ReadPoolInstancesUpgradeStageStatus - */ - ReadPoolInstancesUpgradeStageStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus(); - if (object.upgradeStats != null) { - if (typeof object.upgradeStats !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.upgradeStats: object expected"); - message.upgradeStats = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.fromObject(object.upgradeStats); - } - return message; - }; - - /** - * Creates a plain object from a ReadPoolInstancesUpgradeStageStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus} message ReadPoolInstancesUpgradeStageStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadPoolInstancesUpgradeStageStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.upgradeStats = null; - if (message.upgradeStats != null && message.hasOwnProperty("upgradeStats")) - object.upgradeStats = $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.toObject(message.upgradeStats, options); - return object; - }; - - /** - * Converts this ReadPoolInstancesUpgradeStageStatus to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @instance - * @returns {Object.} JSON object - */ - ReadPoolInstancesUpgradeStageStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadPoolInstancesUpgradeStageStatus - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadPoolInstancesUpgradeStageStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus"; - }; - - ReadPoolInstancesUpgradeStageStatus.Stats = (function() { - - /** - * Properties of a Stats. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @interface IStats - * @property {number|null} [notStarted] Stats notStarted - * @property {number|null} [ongoing] Stats ongoing - * @property {number|null} [success] Stats success - * @property {number|null} [failed] Stats failed - */ - - /** - * Constructs a new Stats. - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus - * @classdesc Represents a Stats. - * @implements IStats - * @constructor - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set - */ - function Stats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Stats notStarted. - * @member {number} notStarted - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.notStarted = 0; - - /** - * Stats ongoing. - * @member {number} ongoing - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.ongoing = 0; - - /** - * Stats success. - * @member {number} success - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.success = 0; - - /** - * Stats failed. - * @member {number} failed - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - */ - Stats.prototype.failed = 0; - - /** - * Creates a new Stats instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats instance - */ - Stats.create = function create(properties) { - return new Stats(properties); - }; - - /** - * Encodes the specified Stats message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.notStarted != null && Object.hasOwnProperty.call(message, "notStarted")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.notStarted); - if (message.ongoing != null && Object.hasOwnProperty.call(message, "ongoing")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ongoing); - if (message.success != null && Object.hasOwnProperty.call(message, "success")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.success); - if (message.failed != null && Object.hasOwnProperty.call(message, "failed")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failed); - return writer; - }; - - /** - * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.IStats} message Stats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Stats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Stats message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.notStarted = reader.int32(); - break; - } - case 2: { - message.ongoing = reader.int32(); - break; - } - case 3: { - message.success = reader.int32(); - break; - } - case 4: { - message.failed = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Stats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Stats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Stats message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Stats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.notStarted != null && message.hasOwnProperty("notStarted")) - if (!$util.isInteger(message.notStarted)) - return "notStarted: integer expected"; - if (message.ongoing != null && message.hasOwnProperty("ongoing")) - if (!$util.isInteger(message.ongoing)) - return "ongoing: integer expected"; - if (message.success != null && message.hasOwnProperty("success")) - if (!$util.isInteger(message.success)) - return "success: integer expected"; - if (message.failed != null && message.hasOwnProperty("failed")) - if (!$util.isInteger(message.failed)) - return "failed: integer expected"; - return null; - }; - - /** - * Creates a Stats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} Stats - */ - Stats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats(); - if (object.notStarted != null) - message.notStarted = object.notStarted | 0; - if (object.ongoing != null) - message.ongoing = object.ongoing | 0; - if (object.success != null) - message.success = object.success | 0; - if (object.failed != null) - message.failed = object.failed | 0; - return message; - }; - - /** - * Creates a plain object from a Stats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats} message Stats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Stats.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.notStarted = 0; - object.ongoing = 0; - object.success = 0; - object.failed = 0; - } - if (message.notStarted != null && message.hasOwnProperty("notStarted")) - object.notStarted = message.notStarted; - if (message.ongoing != null && message.hasOwnProperty("ongoing")) - object.ongoing = message.ongoing; - if (message.success != null && message.hasOwnProperty("success")) - object.success = message.success; - if (message.failed != null && message.hasOwnProperty("failed")) - object.failed = message.failed; - return object; - }; - - /** - * Converts this Stats to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @instance - * @returns {Object.} JSON object - */ - Stats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Stats - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats"; - }; - - return Stats; - })(); - - return ReadPoolInstancesUpgradeStageStatus; - })(); - - return UpgradeClusterStatus; - })(); - - v1beta.ListUsersRequest = (function() { - - /** - * Properties of a ListUsersRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IListUsersRequest - * @property {string|null} [parent] ListUsersRequest parent - * @property {number|null} [pageSize] ListUsersRequest pageSize - * @property {string|null} [pageToken] ListUsersRequest pageToken - * @property {string|null} [filter] ListUsersRequest filter - * @property {string|null} [orderBy] ListUsersRequest orderBy - */ - - /** - * Constructs a new ListUsersRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListUsersRequest. - * @implements IListUsersRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IListUsersRequest=} [properties] Properties to set - */ - function ListUsersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUsersRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.parent = ""; - - /** - * ListUsersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageSize = 0; - - /** - * ListUsersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageToken = ""; - - /** - * ListUsersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.filter = ""; - - /** - * ListUsersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.orderBy = ""; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListUsersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest instance - */ - ListUsersRequest.create = function create(properties) { - return new ListUsersRequest(properties); - }; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListUsersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListUsersRequest} ListUsersRequest - */ - ListUsersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListUsersRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListUsersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {google.cloud.alloydb.v1beta.ListUsersRequest} message ListUsersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListUsersRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @instance - * @returns {Object.} JSON object - */ - ListUsersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListUsersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListUsersRequest"; - }; - - return ListUsersRequest; - })(); - - v1beta.ListUsersResponse = (function() { - - /** - * Properties of a ListUsersResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IListUsersResponse - * @property {Array.|null} [users] ListUsersResponse users - * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken - * @property {Array.|null} [unreachable] ListUsersResponse unreachable - */ - - /** - * Constructs a new ListUsersResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListUsersResponse. - * @implements IListUsersResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IListUsersResponse=} [properties] Properties to set - */ - function ListUsersResponse(properties) { - this.users = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUsersResponse users. - * @member {Array.} users - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.users = $util.emptyArray; - - /** - * ListUsersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.nextPageToken = ""; - - /** - * ListUsersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListUsersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse instance - */ - ListUsersResponse.create = function create(properties) { - return new ListUsersResponse(properties); - }; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.users != null && message.users.length) - for (var i = 0; i < message.users.length; ++i) - $root.google.cloud.alloydb.v1beta.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListUsersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListUsersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.users && message.users.length)) - message.users = []; - message.users.push($root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.users != null && message.hasOwnProperty("users")) { - if (!Array.isArray(message.users)) - return "users: array expected"; - for (var i = 0; i < message.users.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.User.verify(message.users[i]); - if (error) - return "users." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListUsersResponse} ListUsersResponse - */ - ListUsersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListUsersResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListUsersResponse(); - if (object.users) { - if (!Array.isArray(object.users)) - throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.users: array expected"); - message.users = []; - for (var i = 0; i < object.users.length; ++i) { - if (typeof object.users[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.users: object expected"); - message.users[i] = $root.google.cloud.alloydb.v1beta.User.fromObject(object.users[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.alloydb.v1beta.ListUsersResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {google.cloud.alloydb.v1beta.ListUsersResponse} message ListUsersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.users = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.users && message.users.length) { - object.users = []; - for (var j = 0; j < message.users.length; ++j) - object.users[j] = $root.google.cloud.alloydb.v1beta.User.toObject(message.users[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListUsersResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @instance - * @returns {Object.} JSON object - */ - ListUsersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListUsersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListUsersResponse"; - }; - - return ListUsersResponse; - })(); - - v1beta.GetUserRequest = (function() { - - /** - * Properties of a GetUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IGetUserRequest - * @property {string|null} [name] GetUserRequest name - */ - - /** - * Constructs a new GetUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a GetUserRequest. - * @implements IGetUserRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IGetUserRequest=} [properties] Properties to set - */ - function GetUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetUserRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @instance - */ - GetUserRequest.prototype.name = ""; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest instance - */ - GetUserRequest.create = function create(properties) { - return new GetUserRequest(properties); - }; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.GetUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.GetUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.GetUserRequest} GetUserRequest - */ - GetUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.GetUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.GetUserRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.GetUserRequest} message GetUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @instance - * @returns {Object.} JSON object - */ - GetUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.GetUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.GetUserRequest"; - }; - - return GetUserRequest; - })(); - - v1beta.CreateUserRequest = (function() { - - /** - * Properties of a CreateUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateUserRequest - * @property {string|null} [parent] CreateUserRequest parent - * @property {string|null} [userId] CreateUserRequest userId - * @property {google.cloud.alloydb.v1beta.IUser|null} [user] CreateUserRequest user - * @property {string|null} [requestId] CreateUserRequest requestId - * @property {boolean|null} [validateOnly] CreateUserRequest validateOnly - */ - - /** - * Constructs a new CreateUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateUserRequest. - * @implements ICreateUserRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateUserRequest=} [properties] Properties to set - */ - function CreateUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateUserRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.parent = ""; - - /** - * CreateUserRequest userId. - * @member {string} userId - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.userId = ""; - - /** - * CreateUserRequest user. - * @member {google.cloud.alloydb.v1beta.IUser|null|undefined} user - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.user = null; - - /** - * CreateUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.requestId = ""; - - /** - * CreateUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest instance - */ - CreateUserRequest.create = function create(properties) { - return new CreateUserRequest(properties); - }; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.cloud.alloydb.v1beta.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.userId = reader.string(); - break; - } - case 3: { - message.user = $root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.cloud.alloydb.v1beta.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateUserRequest} CreateUserRequest - */ - CreateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateUserRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userId != null) - message.userId = String(object.userId); - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateUserRequest.user: object expected"); - message.user = $root.google.cloud.alloydb.v1beta.User.fromObject(object.user); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateUserRequest} message CreateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userId = ""; - object.user = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.cloud.alloydb.v1beta.User.toObject(message.user, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @instance - * @returns {Object.} JSON object - */ - CreateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateUserRequest"; - }; - - return CreateUserRequest; - })(); - - v1beta.UpdateUserRequest = (function() { - - /** - * Properties of an UpdateUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IUpdateUserRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask - * @property {google.cloud.alloydb.v1beta.IUser|null} [user] UpdateUserRequest user - * @property {string|null} [requestId] UpdateUserRequest requestId - * @property {boolean|null} [validateOnly] UpdateUserRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateUserRequest allowMissing - */ - - /** - * Constructs a new UpdateUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents an UpdateUserRequest. - * @implements IUpdateUserRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest=} [properties] Properties to set - */ - function UpdateUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateUserRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.updateMask = null; - - /** - * UpdateUserRequest user. - * @member {google.cloud.alloydb.v1beta.IUser|null|undefined} user - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.user = null; - - /** - * UpdateUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.requestId = ""; - - /** - * UpdateUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.validateOnly = false; - - /** - * UpdateUserRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest instance - */ - UpdateUserRequest.create = function create(properties) { - return new UpdateUserRequest(properties); - }; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.cloud.alloydb.v1beta.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.UpdateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.UpdateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.user = $root.google.cloud.alloydb.v1beta.User.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.cloud.alloydb.v1beta.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.UpdateUserRequest} UpdateUserRequest - */ - UpdateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.UpdateUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.UpdateUserRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateUserRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.UpdateUserRequest.user: object expected"); - message.user = $root.google.cloud.alloydb.v1beta.User.fromObject(object.user); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.UpdateUserRequest} message UpdateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.user = null; - object.requestId = ""; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.cloud.alloydb.v1beta.User.toObject(message.user, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.UpdateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.UpdateUserRequest"; - }; - - return UpdateUserRequest; - })(); - - v1beta.DeleteUserRequest = (function() { - - /** - * Properties of a DeleteUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IDeleteUserRequest - * @property {string|null} [name] DeleteUserRequest name - * @property {string|null} [requestId] DeleteUserRequest requestId - * @property {boolean|null} [validateOnly] DeleteUserRequest validateOnly - */ - - /** - * Constructs a new DeleteUserRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a DeleteUserRequest. - * @implements IDeleteUserRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest=} [properties] Properties to set - */ - function DeleteUserRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteUserRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.name = ""; - - /** - * DeleteUserRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.requestId = ""; - - /** - * DeleteUserRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.validateOnly = false; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest instance - */ - DeleteUserRequest.create = function create(properties) { - return new DeleteUserRequest(properties); - }; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.DeleteUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.DeleteUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteUserRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.DeleteUserRequest} DeleteUserRequest - */ - DeleteUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.DeleteUserRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.DeleteUserRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {google.cloud.alloydb.v1beta.DeleteUserRequest} message DeleteUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this DeleteUserRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteUserRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.DeleteUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.DeleteUserRequest"; - }; - - return DeleteUserRequest; - })(); - - v1beta.ListDatabasesRequest = (function() { - - /** - * Properties of a ListDatabasesRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface IListDatabasesRequest - * @property {string|null} [parent] ListDatabasesRequest parent - * @property {number|null} [pageSize] ListDatabasesRequest pageSize - * @property {string|null} [pageToken] ListDatabasesRequest pageToken - * @property {string|null} [filter] ListDatabasesRequest filter - */ - - /** - * Constructs a new ListDatabasesRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListDatabasesRequest. - * @implements IListDatabasesRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest=} [properties] Properties to set - */ - function ListDatabasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.parent = ""; - - /** - * ListDatabasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageSize = 0; - - /** - * ListDatabasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.pageToken = ""; - - /** - * ListDatabasesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @instance - */ - ListDatabasesRequest.prototype.filter = ""; - - /** - * Creates a new ListDatabasesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest instance - */ - ListDatabasesRequest.create = function create(properties) { - return new ListDatabasesRequest(properties); - }; - - /** - * Encodes the specified ListDatabasesRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListDatabasesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1beta.IListDatabasesRequest} message ListDatabasesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListDatabasesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListDatabasesRequest} ListDatabasesRequest - */ - ListDatabasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListDatabasesRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListDatabasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {google.cloud.alloydb.v1beta.ListDatabasesRequest} message ListDatabasesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListDatabasesRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListDatabasesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListDatabasesRequest"; - }; - - return ListDatabasesRequest; - })(); - - v1beta.ListDatabasesResponse = (function() { - - /** - * Properties of a ListDatabasesResponse. - * @memberof google.cloud.alloydb.v1beta - * @interface IListDatabasesResponse - * @property {Array.|null} [databases] ListDatabasesResponse databases - * @property {string|null} [nextPageToken] ListDatabasesResponse nextPageToken - */ - - /** - * Constructs a new ListDatabasesResponse. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a ListDatabasesResponse. - * @implements IListDatabasesResponse - * @constructor - * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse=} [properties] Properties to set - */ - function ListDatabasesResponse(properties) { - this.databases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDatabasesResponse databases. - * @member {Array.} databases - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.databases = $util.emptyArray; - - /** - * ListDatabasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @instance - */ - ListDatabasesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatabasesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse instance - */ - ListDatabasesResponse.create = function create(properties) { - return new ListDatabasesResponse(properties); - }; - - /** - * Encodes the specified ListDatabasesResponse message. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databases != null && message.databases.length) - for (var i = 0; i < message.databases.length; ++i) - $root.google.cloud.alloydb.v1beta.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListDatabasesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.ListDatabasesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1beta.IListDatabasesResponse} message ListDatabasesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.ListDatabasesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.databases && message.databases.length)) - message.databases = []; - message.databases.push($root.google.cloud.alloydb.v1beta.Database.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDatabasesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDatabasesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDatabasesResponse message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDatabasesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databases != null && message.hasOwnProperty("databases")) { - if (!Array.isArray(message.databases)) - return "databases: array expected"; - for (var i = 0; i < message.databases.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.Database.verify(message.databases[i]); - if (error) - return "databases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListDatabasesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.ListDatabasesResponse} ListDatabasesResponse - */ - ListDatabasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.ListDatabasesResponse) - return object; - var message = new $root.google.cloud.alloydb.v1beta.ListDatabasesResponse(); - if (object.databases) { - if (!Array.isArray(object.databases)) - throw TypeError(".google.cloud.alloydb.v1beta.ListDatabasesResponse.databases: array expected"); - message.databases = []; - for (var i = 0; i < object.databases.length; ++i) { - if (typeof object.databases[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.ListDatabasesResponse.databases: object expected"); - message.databases[i] = $root.google.cloud.alloydb.v1beta.Database.fromObject(object.databases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListDatabasesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {google.cloud.alloydb.v1beta.ListDatabasesResponse} message ListDatabasesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDatabasesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.databases = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.databases && message.databases.length) { - object.databases = []; - for (var j = 0; j < message.databases.length; ++j) - object.databases[j] = $root.google.cloud.alloydb.v1beta.Database.toObject(message.databases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListDatabasesResponse to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDatabasesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDatabasesResponse - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.ListDatabasesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDatabasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.ListDatabasesResponse"; - }; - - return ListDatabasesResponse; - })(); - - v1beta.CreateDatabaseRequest = (function() { - - /** - * Properties of a CreateDatabaseRequest. - * @memberof google.cloud.alloydb.v1beta - * @interface ICreateDatabaseRequest - * @property {string|null} [parent] CreateDatabaseRequest parent - * @property {string|null} [databaseId] CreateDatabaseRequest databaseId - * @property {google.cloud.alloydb.v1beta.IDatabase|null} [database] CreateDatabaseRequest database - */ - - /** - * Constructs a new CreateDatabaseRequest. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a CreateDatabaseRequest. - * @implements ICreateDatabaseRequest - * @constructor - * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest=} [properties] Properties to set - */ - function CreateDatabaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateDatabaseRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.parent = ""; - - /** - * CreateDatabaseRequest databaseId. - * @member {string} databaseId - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.databaseId = ""; - - /** - * CreateDatabaseRequest database. - * @member {google.cloud.alloydb.v1beta.IDatabase|null|undefined} database - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @instance - */ - CreateDatabaseRequest.prototype.database = null; - - /** - * Creates a new CreateDatabaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest instance - */ - CreateDatabaseRequest.create = function create(properties) { - return new CreateDatabaseRequest(properties); - }; - - /** - * Encodes the specified CreateDatabaseRequest message. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseId); - if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.cloud.alloydb.v1beta.Database.encode(message.database, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateDatabaseRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.CreateDatabaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1beta.ICreateDatabaseRequest} message CreateDatabaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.databaseId = reader.string(); - break; - } - case 3: { - message.database = $root.google.cloud.alloydb.v1beta.Database.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateDatabaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateDatabaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateDatabaseRequest message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateDatabaseRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.database != null && message.hasOwnProperty("database")) { - var error = $root.google.cloud.alloydb.v1beta.Database.verify(message.database); - if (error) - return "database." + error; - } - return null; - }; - - /** - * Creates a CreateDatabaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.CreateDatabaseRequest} CreateDatabaseRequest - */ - CreateDatabaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest) - return object; - var message = new $root.google.cloud.alloydb.v1beta.CreateDatabaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.database != null) { - if (typeof object.database !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.CreateDatabaseRequest.database: object expected"); - message.database = $root.google.cloud.alloydb.v1beta.Database.fromObject(object.database); - } - return message; - }; - - /** - * Creates a plain object from a CreateDatabaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {google.cloud.alloydb.v1beta.CreateDatabaseRequest} message CreateDatabaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateDatabaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.databaseId = ""; - object.database = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.cloud.alloydb.v1beta.Database.toObject(message.database, options); - return object; - }; - - /** - * Converts this CreateDatabaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @instance - * @returns {Object.} JSON object - */ - CreateDatabaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateDatabaseRequest - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.CreateDatabaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.CreateDatabaseRequest"; - }; - - return CreateDatabaseRequest; - })(); - - v1beta.SqlResult = (function() { - - /** - * Properties of a SqlResult. - * @memberof google.cloud.alloydb.v1beta - * @interface ISqlResult - * @property {Array.|null} [columns] SqlResult columns - * @property {Array.|null} [rows] SqlResult rows - */ - - /** - * Constructs a new SqlResult. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SqlResult. - * @implements ISqlResult - * @constructor - * @param {google.cloud.alloydb.v1beta.ISqlResult=} [properties] Properties to set - */ - function SqlResult(properties) { - this.columns = []; - this.rows = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResult columns. - * @member {Array.} columns - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @instance - */ - SqlResult.prototype.columns = $util.emptyArray; - - /** - * SqlResult rows. - * @member {Array.} rows - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @instance - */ - SqlResult.prototype.rows = $util.emptyArray; - - /** - * Creates a new SqlResult instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResult=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult instance - */ - SqlResult.create = function create(properties) { - return new SqlResult(properties); - }; - - /** - * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResult} message SqlResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columns != null && message.columns.length) - for (var i = 0; i < message.columns.length; ++i) - $root.google.cloud.alloydb.v1beta.SqlResultColumn.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.cloud.alloydb.v1beta.SqlResultRow.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SqlResult message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResult} message SqlResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.columns && message.columns.length)) - message.columns = []; - message.columns.push($root.google.cloud.alloydb.v1beta.SqlResultColumn.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.cloud.alloydb.v1beta.SqlResultRow.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResult message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { - if (!Array.isArray(message.columns)) - return "columns: array expected"; - for (var i = 0; i < message.columns.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.SqlResultColumn.verify(message.columns[i]); - if (error) - return "columns." + error; - } - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.SqlResultRow.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - return null; - }; - - /** - * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SqlResult} SqlResult - */ - SqlResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResult) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SqlResult(); - if (object.columns) { - if (!Array.isArray(object.columns)) - throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.columns: array expected"); - message.columns = []; - for (var i = 0; i < object.columns.length; ++i) { - if (typeof object.columns[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.columns: object expected"); - message.columns[i] = $root.google.cloud.alloydb.v1beta.SqlResultColumn.fromObject(object.columns[i]); - } - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SqlResult.rows: object expected"); - message.rows[i] = $root.google.cloud.alloydb.v1beta.SqlResultRow.fromObject(object.rows[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SqlResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {google.cloud.alloydb.v1beta.SqlResult} message SqlResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columns = []; - object.rows = []; - } - if (message.columns && message.columns.length) { - object.columns = []; - for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = $root.google.cloud.alloydb.v1beta.SqlResultColumn.toObject(message.columns[j], options); - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.cloud.alloydb.v1beta.SqlResultRow.toObject(message.rows[j], options); - } - return object; - }; - - /** - * Converts this SqlResult to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @instance - * @returns {Object.} JSON object - */ - SqlResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResult - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SqlResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResult"; - }; - - return SqlResult; - })(); - - v1beta.SqlResultColumn = (function() { - - /** - * Properties of a SqlResultColumn. - * @memberof google.cloud.alloydb.v1beta - * @interface ISqlResultColumn - * @property {string|null} [name] SqlResultColumn name - * @property {string|null} [type] SqlResultColumn type - */ - - /** - * Constructs a new SqlResultColumn. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SqlResultColumn. - * @implements ISqlResultColumn - * @constructor - * @param {google.cloud.alloydb.v1beta.ISqlResultColumn=} [properties] Properties to set - */ - function SqlResultColumn(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultColumn name. - * @member {string} name - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @instance - */ - SqlResultColumn.prototype.name = ""; - - /** - * SqlResultColumn type. - * @member {string} type - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @instance - */ - SqlResultColumn.prototype.type = ""; - - /** - * Creates a new SqlResultColumn instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultColumn=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn instance - */ - SqlResultColumn.create = function create(properties) { - return new SqlResultColumn(properties); - }; - - /** - * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultColumn} message SqlResultColumn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultColumn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - return writer; - }; - - /** - * Encodes the specified SqlResultColumn message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultColumn.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultColumn} message SqlResultColumn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultColumn.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResultColumn(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultColumn message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultColumn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SqlResultColumn} SqlResultColumn - */ - SqlResultColumn.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResultColumn) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SqlResultColumn(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {google.cloud.alloydb.v1beta.SqlResultColumn} message SqlResultColumn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultColumn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.type = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this SqlResultColumn to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @instance - * @returns {Object.} JSON object - */ - SqlResultColumn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultColumn - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SqlResultColumn - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResultColumn"; - }; - - return SqlResultColumn; - })(); - - v1beta.SqlResultRow = (function() { - - /** - * Properties of a SqlResultRow. - * @memberof google.cloud.alloydb.v1beta - * @interface ISqlResultRow - * @property {Array.|null} [values] SqlResultRow values - */ - - /** - * Constructs a new SqlResultRow. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SqlResultRow. - * @implements ISqlResultRow - * @constructor - * @param {google.cloud.alloydb.v1beta.ISqlResultRow=} [properties] Properties to set - */ - function SqlResultRow(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultRow values. - * @member {Array.} values - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @instance - */ - SqlResultRow.prototype.values = $util.emptyArray; - - /** - * Creates a new SqlResultRow instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultRow=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow instance - */ - SqlResultRow.create = function create(properties) { - return new SqlResultRow(properties); - }; - - /** - * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultRow} message SqlResultRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.alloydb.v1beta.SqlResultValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SqlResultRow message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultRow} message SqlResultRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultRow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResultRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.alloydb.v1beta.SqlResultValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultRow message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.alloydb.v1beta.SqlResultValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SqlResultRow} SqlResultRow - */ - SqlResultRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResultRow) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SqlResultRow(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.alloydb.v1beta.SqlResultRow.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.alloydb.v1beta.SqlResultRow.values: object expected"); - message.values[i] = $root.google.cloud.alloydb.v1beta.SqlResultValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {google.cloud.alloydb.v1beta.SqlResultRow} message SqlResultRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.alloydb.v1beta.SqlResultValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this SqlResultRow to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @instance - * @returns {Object.} JSON object - */ - SqlResultRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultRow - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SqlResultRow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResultRow"; - }; - - return SqlResultRow; - })(); - - v1beta.SqlResultValue = (function() { - - /** - * Properties of a SqlResultValue. - * @memberof google.cloud.alloydb.v1beta - * @interface ISqlResultValue - * @property {string|null} [value] SqlResultValue value - * @property {boolean|null} [nullValue] SqlResultValue nullValue - */ - - /** - * Constructs a new SqlResultValue. - * @memberof google.cloud.alloydb.v1beta - * @classdesc Represents a SqlResultValue. - * @implements ISqlResultValue - * @constructor - * @param {google.cloud.alloydb.v1beta.ISqlResultValue=} [properties] Properties to set - */ - function SqlResultValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SqlResultValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @instance - */ - SqlResultValue.prototype.value = null; - - /** - * SqlResultValue nullValue. - * @member {boolean|null|undefined} nullValue - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @instance - */ - SqlResultValue.prototype.nullValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlResultValue.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SqlResultValue.prototype, "_nullValue", { - get: $util.oneOfGetter($oneOfFields = ["nullValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SqlResultValue instance using the specified properties. - * @function create - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultValue=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue instance - */ - SqlResultValue.create = function create(properties) { - return new SqlResultValue(properties); - }; - - /** - * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultValue} message SqlResultValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.nullValue); - return writer; - }; - - /** - * Encodes the specified SqlResultValue message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.SqlResultValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1beta.ISqlResultValue} message SqlResultValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.SqlResultValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - case 2: { - message.nullValue = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SqlResultValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SqlResultValue message. - * @function verify - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SqlResultValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - properties._nullValue = 1; - if (typeof message.nullValue !== "boolean") - return "nullValue: boolean expected"; - } - return null; - }; - - /** - * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1beta.SqlResultValue} SqlResultValue - */ - SqlResultValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1beta.SqlResultValue) - return object; - var message = new $root.google.cloud.alloydb.v1beta.SqlResultValue(); - if (object.value != null) - message.value = String(object.value); - if (object.nullValue != null) - message.nullValue = Boolean(object.nullValue); - return message; - }; - - /** - * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {google.cloud.alloydb.v1beta.SqlResultValue} message SqlResultValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SqlResultValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object._value = "value"; - } - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = message.nullValue; - if (options.oneofs) - object._nullValue = "nullValue"; - } - return object; - }; - - /** - * Converts this SqlResultValue to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @instance - * @returns {Object.} JSON object - */ - SqlResultValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SqlResultValue - * @function getTypeUrl - * @memberof google.cloud.alloydb.v1beta.SqlResultValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.alloydb.v1beta.SqlResultValue"; - }; - - return SqlResultValue; - })(); - - return v1beta; - })(); - - return alloydb; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - return protobuf; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Date = (function() { - - /** - * Properties of a Date. - * @memberof google.type - * @interface IDate - * @property {number|null} [year] Date year - * @property {number|null} [month] Date month - * @property {number|null} [day] Date day - */ - - /** - * Constructs a new Date. - * @memberof google.type - * @classdesc Represents a Date. - * @implements IDate - * @constructor - * @param {google.type.IDate=} [properties] Properties to set - */ - function Date(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Date year. - * @member {number} year - * @memberof google.type.Date - * @instance - */ - Date.prototype.year = 0; - - /** - * Date month. - * @member {number} month - * @memberof google.type.Date - * @instance - */ - Date.prototype.month = 0; - - /** - * Date day. - * @member {number} day - * @memberof google.type.Date - * @instance - */ - Date.prototype.day = 0; - - /** - * Creates a new Date instance using the specified properties. - * @function create - * @memberof google.type.Date - * @static - * @param {google.type.IDate=} [properties] Properties to set - * @returns {google.type.Date} Date instance - */ - Date.create = function create(properties) { - return new Date(properties); - }; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encode - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.year != null && Object.hasOwnProperty.call(message, "year")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); - if (message.month != null && Object.hasOwnProperty.call(message, "month")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); - return writer; - }; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Date message from the specified reader or buffer. - * @function decode - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.year = reader.int32(); - break; - } - case 2: { - message.month = reader.int32(); - break; - } - case 3: { - message.day = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Date message. - * @function verify - * @memberof google.type.Date - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Date.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.year != null && message.hasOwnProperty("year")) - if (!$util.isInteger(message.year)) - return "year: integer expected"; - if (message.month != null && message.hasOwnProperty("month")) - if (!$util.isInteger(message.month)) - return "month: integer expected"; - if (message.day != null && message.hasOwnProperty("day")) - if (!$util.isInteger(message.day)) - return "day: integer expected"; - return null; - }; - - /** - * Creates a Date message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Date - * @static - * @param {Object.} object Plain object - * @returns {google.type.Date} Date - */ - Date.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Date) - return object; - var message = new $root.google.type.Date(); - if (object.year != null) - message.year = object.year | 0; - if (object.month != null) - message.month = object.month | 0; - if (object.day != null) - message.day = object.day | 0; - return message; - }; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Date - * @static - * @param {google.type.Date} message Date - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Date.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.year = 0; - object.month = 0; - object.day = 0; - } - if (message.year != null && message.hasOwnProperty("year")) - object.year = message.year; - if (message.month != null && message.hasOwnProperty("month")) - object.month = message.month; - if (message.day != null && message.hasOwnProperty("day")) - object.day = message.day; - return object; - }; - - /** - * Converts this Date to JSON. - * @function toJSON - * @memberof google.type.Date - * @instance - * @returns {Object.} JSON object - */ - Date.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Date - * @function getTypeUrl - * @memberof google.type.Date - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Date"; - }; - - return Date; - })(); - - /** - * DayOfWeek enum. - * @name google.type.DayOfWeek - * @enum {number} - * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value - * @property {number} MONDAY=1 MONDAY value - * @property {number} TUESDAY=2 TUESDAY value - * @property {number} WEDNESDAY=3 WEDNESDAY value - * @property {number} THURSDAY=4 THURSDAY value - * @property {number} FRIDAY=5 FRIDAY value - * @property {number} SATURDAY=6 SATURDAY value - * @property {number} SUNDAY=7 SUNDAY value - */ - type.DayOfWeek = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; - values[valuesById[1] = "MONDAY"] = 1; - values[valuesById[2] = "TUESDAY"] = 2; - values[valuesById[3] = "WEDNESDAY"] = 3; - values[valuesById[4] = "THURSDAY"] = 4; - values[valuesById[5] = "FRIDAY"] = 5; - values[valuesById[6] = "SATURDAY"] = 6; - values[valuesById[7] = "SUNDAY"] = 7; - return values; - })(); - - type.TimeOfDay = (function() { - - /** - * Properties of a TimeOfDay. - * @memberof google.type - * @interface ITimeOfDay - * @property {number|null} [hours] TimeOfDay hours - * @property {number|null} [minutes] TimeOfDay minutes - * @property {number|null} [seconds] TimeOfDay seconds - * @property {number|null} [nanos] TimeOfDay nanos - */ - - /** - * Constructs a new TimeOfDay. - * @memberof google.type - * @classdesc Represents a TimeOfDay. - * @implements ITimeOfDay - * @constructor - * @param {google.type.ITimeOfDay=} [properties] Properties to set - */ - function TimeOfDay(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimeOfDay hours. - * @member {number} hours - * @memberof google.type.TimeOfDay - * @instance - */ - TimeOfDay.prototype.hours = 0; - - /** - * TimeOfDay minutes. - * @member {number} minutes - * @memberof google.type.TimeOfDay - * @instance - */ - TimeOfDay.prototype.minutes = 0; - - /** - * TimeOfDay seconds. - * @member {number} seconds - * @memberof google.type.TimeOfDay - * @instance - */ - TimeOfDay.prototype.seconds = 0; - - /** - * TimeOfDay nanos. - * @member {number} nanos - * @memberof google.type.TimeOfDay - * @instance - */ - TimeOfDay.prototype.nanos = 0; - - /** - * Creates a new TimeOfDay instance using the specified properties. - * @function create - * @memberof google.type.TimeOfDay - * @static - * @param {google.type.ITimeOfDay=} [properties] Properties to set - * @returns {google.type.TimeOfDay} TimeOfDay instance - */ - TimeOfDay.create = function create(properties) { - return new TimeOfDay(properties); - }; - - /** - * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. - * @function encode - * @memberof google.type.TimeOfDay - * @static - * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeOfDay.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); - if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.TimeOfDay - * @static - * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeOfDay message from the specified reader or buffer. - * @function decode - * @memberof google.type.TimeOfDay - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.TimeOfDay} TimeOfDay - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeOfDay.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.hours = reader.int32(); - break; - } - case 2: { - message.minutes = reader.int32(); - break; - } - case 3: { - message.seconds = reader.int32(); - break; - } - case 4: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.TimeOfDay - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.TimeOfDay} TimeOfDay - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeOfDay.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeOfDay message. - * @function verify - * @memberof google.type.TimeOfDay - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeOfDay.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hours != null && message.hasOwnProperty("hours")) - if (!$util.isInteger(message.hours)) - return "hours: integer expected"; - if (message.minutes != null && message.hasOwnProperty("minutes")) - if (!$util.isInteger(message.minutes)) - return "minutes: integer expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds)) - return "seconds: integer expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.TimeOfDay - * @static - * @param {Object.} object Plain object - * @returns {google.type.TimeOfDay} TimeOfDay - */ - TimeOfDay.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.TimeOfDay) - return object; - var message = new $root.google.type.TimeOfDay(); - if (object.hours != null) - message.hours = object.hours | 0; - if (object.minutes != null) - message.minutes = object.minutes | 0; - if (object.seconds != null) - message.seconds = object.seconds | 0; - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.TimeOfDay - * @static - * @param {google.type.TimeOfDay} message TimeOfDay - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeOfDay.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.hours = 0; - object.minutes = 0; - object.seconds = 0; - object.nanos = 0; - } - if (message.hours != null && message.hasOwnProperty("hours")) - object.hours = message.hours; - if (message.minutes != null && message.hasOwnProperty("minutes")) - object.minutes = message.minutes; - if (message.seconds != null && message.hasOwnProperty("seconds")) - object.seconds = message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this TimeOfDay to JSON. - * @function toJSON - * @memberof google.type.TimeOfDay - * @instance - * @returns {Object.} JSON object - */ - TimeOfDay.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeOfDay - * @function getTypeUrl - * @memberof google.type.TimeOfDay - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.TimeOfDay"; - }; - - return TimeOfDay; - })(); - - return type; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-alloydb/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/protos/protos.json deleted file mode 100644 index 7cbde53da89..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/protos/protos.json +++ /dev/null @@ -1,17399 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "alloydb": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.AlloyDb.V1", - "go_package": "cloud.google.com/go/alloydb/apiv1/alloydbpb;alloydbpb", - "java_multiple_files": true, - "java_outer_classname": "DataModelProto", - "java_package": "com.google.cloud.alloydb.v1", - "php_namespace": "Google\\Cloud\\AlloyDb\\V1", - "ruby_package": "Google::Cloud::AlloyDB::V1", - "(google.api.resource_definition).type": "compute.googleapis.com/ServiceAttachment", - "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" - }, - "nested": { - "CloudSQLBackupRunSource": { - "fields": { - "project": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupRunId": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AlloyDBCSQLAdmin": { - "options": { - "(google.api.default_host)": "alloydb.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RestoreFromCloudSQL": { - "requestType": "RestoreFromCloudSQLRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - } - } - }, - "RestoreFromCloudSQLRequest": { - "oneofs": { - "source": { - "oneof": [ - "cloudsqlBackupRunSource" - ] - } - }, - "fields": { - "cloudsqlBackupRunSource": { - "type": "CloudSQLBackupRunSource", - "id": 101 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "InstanceView": { - "values": { - "INSTANCE_VIEW_UNSPECIFIED": 0, - "INSTANCE_VIEW_BASIC": 1, - "INSTANCE_VIEW_FULL": 2 - } - }, - "ClusterView": { - "values": { - "CLUSTER_VIEW_UNSPECIFIED": 0, - "CLUSTER_VIEW_BASIC": 1, - "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 - } - }, - "DatabaseVersion": { - "valuesOptions": { - "POSTGRES_13": { - "deprecated": true - } - }, - "values": { - "DATABASE_VERSION_UNSPECIFIED": 0, - "POSTGRES_13": 1, - "POSTGRES_14": 2, - "POSTGRES_15": 3, - "POSTGRES_16": 4, - "POSTGRES_17": 5 - } - }, - "SubscriptionType": { - "values": { - "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, - "STANDARD": 1, - "TRIAL": 2 - } - }, - "UserPassword": { - "fields": { - "user": { - "type": "string", - "id": 1 - }, - "password": { - "type": "string", - "id": 2 - } - } - }, - "MigrationSource": { - "fields": { - "hostPort": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referenceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceType": { - "type": "MigrationSourceType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "MigrationSourceType": { - "values": { - "MIGRATION_SOURCE_TYPE_UNSPECIFIED": 0, - "DMS": 1 - } - } - } - }, - "EncryptionConfig": { - "fields": { - "kmsKeyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "EncryptionInfo": { - "fields": { - "encryptionType": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_DEFAULT_ENCRYPTION": 1, - "CUSTOMER_MANAGED_ENCRYPTION": 2 - } - } - } - }, - "SslConfig": { - "fields": { - "sslMode": { - "type": "SslMode", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "caSource": { - "type": "CaSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SslMode": { - "valuesOptions": { - "SSL_MODE_ALLOW": { - "deprecated": true - }, - "SSL_MODE_REQUIRE": { - "deprecated": true - }, - "SSL_MODE_VERIFY_CA": { - "deprecated": true - } - }, - "values": { - "SSL_MODE_UNSPECIFIED": 0, - "SSL_MODE_ALLOW": 1, - "SSL_MODE_REQUIRE": 2, - "SSL_MODE_VERIFY_CA": 3, - "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, - "ENCRYPTED_ONLY": 5 - } - }, - "CaSource": { - "values": { - "CA_SOURCE_UNSPECIFIED": 0, - "CA_SOURCE_MANAGED": 1 - } - } - } - }, - "AutomatedBackupPolicy": { - "oneofs": { - "schedule": { - "oneof": [ - "weeklySchedule" - ] - }, - "retention": { - "oneof": [ - "timeBasedRetention", - "quantityBasedRetention" - ] - }, - "_enabled": { - "oneof": [ - "enabled" - ] - } - }, - "fields": { - "weeklySchedule": { - "type": "WeeklySchedule", - "id": 2 - }, - "timeBasedRetention": { - "type": "TimeBasedRetention", - "id": 4 - }, - "quantityBasedRetention": { - "type": "QuantityBasedRetention", - "id": 5 - }, - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "backupWindow": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "location": { - "type": "string", - "id": 6 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - } - }, - "nested": { - "WeeklySchedule": { - "fields": { - "startTimes": { - "rule": "repeated", - "type": "google.type.TimeOfDay", - "id": 1 - }, - "daysOfWeek": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 2 - } - } - }, - "TimeBasedRetention": { - "fields": { - "retentionPeriod": { - "type": "google.protobuf.Duration", - "id": 1 - } - } - }, - "QuantityBasedRetention": { - "fields": { - "count": { - "type": "int32", - "id": 1 - } - } - } - } - }, - "ContinuousBackupConfig": { - "oneofs": { - "_enabled": { - "oneof": [ - "enabled" - ] - } - }, - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "recoveryWindowDays": { - "type": "int32", - "id": 4 - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 3 - } - } - }, - "ContinuousBackupInfo": { - "fields": { - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enabledTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "schedule": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "earliestRestorableTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupSource": { - "fields": { - "backupUid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - } - } - }, - "ContinuousBackupSource": { - "fields": { - "cluster": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pointInTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "MaintenanceUpdatePolicy": { - "fields": { - "maintenanceWindows": { - "rule": "repeated", - "type": "MaintenanceWindow", - "id": 1 - }, - "denyMaintenancePeriods": { - "rule": "repeated", - "type": "DenyMaintenancePeriod", - "id": 2 - } - }, - "nested": { - "MaintenanceWindow": { - "fields": { - "day": { - "type": "google.type.DayOfWeek", - "id": 1 - }, - "startTime": { - "type": "google.type.TimeOfDay", - "id": 2 - } - } - }, - "DenyMaintenancePeriod": { - "fields": { - "startDate": { - "type": "google.type.Date", - "id": 1 - }, - "endDate": { - "type": "google.type.Date", - "id": 2 - }, - "time": { - "type": "google.type.TimeOfDay", - "id": 3 - } - } - } - } - }, - "MaintenanceSchedule": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Cluster": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Cluster", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", - "(google.api.resource).plural": "clusters", - "(google.api.resource).singular": "cluster", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "migrationSource", - "cloudsqlBackupRunSource" - ] - } - }, - "fields": { - "backupSource": { - "type": "BackupSource", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "migrationSource": { - "type": "MigrationSource", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudsqlBackupRunSource": { - "type": "CloudSQLBackupRunSource", - "id": 42, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterType": { - "type": "ClusterType", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkConfig": { - "type": "NetworkConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "network": { - "type": "string", - "id": 10, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "etag": { - "type": "string", - "id": 11 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 12 - }, - "reconciling": { - "type": "bool", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "initialUser": { - "type": "UserPassword", - "id": 14, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "automatedBackupPolicy": { - "type": "AutomatedBackupPolicy", - "id": 17 - }, - "sslConfig": { - "type": "SslConfig", - "id": 18, - "options": { - "deprecated": true - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "continuousBackupConfig": { - "type": "ContinuousBackupConfig", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "continuousBackupInfo": { - "type": "ContinuousBackupInfo", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "secondaryConfig": { - "type": "SecondaryConfig", - "id": 22 - }, - "primaryConfig": { - "type": "PrimaryConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscConfig": { - "type": "PscConfig", - "id": 31, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceUpdatePolicy": { - "type": "MaintenanceUpdatePolicy", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceSchedule": { - "type": "MaintenanceSchedule", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "subscriptionType": { - "type": "SubscriptionType", - "id": 38, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trialMetadata": { - "type": "TrialMetadata", - "id": 39, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "tags": { - "keyType": "string", - "type": "string", - "id": 41, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataplexConfig": { - "type": "DataplexConfig", - "id": 47, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "NetworkConfig": { - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "allocatedIpRange": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SecondaryConfig": { - "fields": { - "primaryClusterName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - } - } - }, - "PrimaryConfig": { - "fields": { - "secondaryClusterNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - } - } - }, - "PscConfig": { - "fields": { - "pscEnabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceOwnedProjectNumber": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TrialMetadata": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "upgradeTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "graceEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "DataplexConfig": { - "fields": { - "enabled": { - "type": "bool", - "id": 1 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "STOPPED": 2, - "EMPTY": 3, - "CREATING": 4, - "DELETING": 5, - "FAILED": 6, - "BOOTSTRAPPING": 7, - "MAINTENANCE": 8, - "PROMOTING": 9 - } - }, - "ClusterType": { - "values": { - "CLUSTER_TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "SECONDARY": 2 - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceType": { - "type": "InstanceType", - "id": 9, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "machineConfig": { - "type": "MachineConfig", - "id": 10 - }, - "availabilityType": { - "type": "AvailabilityType", - "id": 11 - }, - "gceZone": { - "type": "string", - "id": 12 - }, - "databaseFlags": { - "keyType": "string", - "type": "string", - "id": 13 - }, - "writableNode": { - "type": "Node", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodes": { - "rule": "repeated", - "type": "Node", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "queryInsightsConfig": { - "type": "QueryInsightsInstanceConfig", - "id": 21 - }, - "observabilityConfig": { - "type": "ObservabilityInstanceConfig", - "id": 26 - }, - "readPoolConfig": { - "type": "ReadPoolConfig", - "id": 14 - }, - "ipAddress": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicIpAddress": { - "type": "string", - "id": 27, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 17 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 18 - }, - "clientConnectionConfig": { - "type": "ClientConnectionConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscInstanceConfig": { - "type": "PscInstanceConfig", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkConfig": { - "type": "InstanceNetworkConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outboundPublicIpAddresses": { - "rule": "repeated", - "type": "string", - "id": 34, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "activationPolicy": { - "type": "ActivationPolicy", - "id": 35, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectionPoolConfig": { - "type": "ConnectionPoolConfig", - "id": 37, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MachineConfig": { - "fields": { - "cpuCount": { - "type": "int32", - "id": 1 - }, - "machineType": { - "type": "string", - "id": 4 - } - } - }, - "Node": { - "fields": { - "zoneId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "id": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ip": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "QueryInsightsInstanceConfig": { - "oneofs": { - "_recordApplicationTags": { - "oneof": [ - "recordApplicationTags" - ] - }, - "_recordClientAddress": { - "oneof": [ - "recordClientAddress" - ] - }, - "_queryPlansPerMinute": { - "oneof": [ - "queryPlansPerMinute" - ] - } - }, - "fields": { - "recordApplicationTags": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "recordClientAddress": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "queryStringLength": { - "type": "uint32", - "id": 4 - }, - "queryPlansPerMinute": { - "type": "uint32", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "ObservabilityInstanceConfig": { - "oneofs": { - "_enabled": { - "oneof": [ - "enabled" - ] - }, - "_preserveComments": { - "oneof": [ - "preserveComments" - ] - }, - "_trackWaitEvents": { - "oneof": [ - "trackWaitEvents" - ] - }, - "_trackWaitEventTypes": { - "oneof": [ - "trackWaitEventTypes" - ] - }, - "_maxQueryStringLength": { - "oneof": [ - "maxQueryStringLength" - ] - }, - "_recordApplicationTags": { - "oneof": [ - "recordApplicationTags" - ] - }, - "_queryPlansPerMinute": { - "oneof": [ - "queryPlansPerMinute" - ] - }, - "_trackActiveQueries": { - "oneof": [ - "trackActiveQueries" - ] - } - }, - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "preserveComments": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "trackWaitEvents": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "trackWaitEventTypes": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "maxQueryStringLength": { - "type": "int32", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "recordApplicationTags": { - "type": "bool", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "queryPlansPerMinute": { - "type": "int32", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "trackActiveQueries": { - "type": "bool", - "id": 8, - "options": { - "proto3_optional": true - } - } - } - }, - "ReadPoolConfig": { - "fields": { - "nodeCount": { - "type": "int32", - "id": 1 - } - } - }, - "ClientConnectionConfig": { - "fields": { - "requireConnectors": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sslConfig": { - "type": "SslConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PscInterfaceConfig": { - "fields": { - "networkAttachmentResource": { - "type": "string", - "id": 1 - } - } - }, - "PscAutoConnectionConfig": { - "fields": { - "consumerProject": { - "type": "string", - "id": 1 - }, - "consumerNetwork": { - "type": "string", - "id": 2 - }, - "ipAddress": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "consumerNetworkStatus": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PscInstanceConfig": { - "fields": { - "serviceAttachmentLink": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/ServiceAttachment" - } - }, - "allowedConsumerProjects": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscDnsName": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscInterfaceConfigs": { - "rule": "repeated", - "type": "PscInterfaceConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscAutoConnections": { - "rule": "repeated", - "type": "PscAutoConnectionConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceNetworkConfig": { - "fields": { - "authorizedExternalNetworks": { - "rule": "repeated", - "type": "AuthorizedNetwork", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enablePublicIp": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableOutboundPublicIp": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "network": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "allocatedIpRangeOverride": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AuthorizedNetwork": { - "fields": { - "cidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4" - } - } - } - } - } - }, - "ConnectionPoolConfig": { - "fields": { - "enabled": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "flags": { - "keyType": "string", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "poolerCount": { - "type": "int32", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "STOPPED": 2, - "CREATING": 3, - "DELETING": 4, - "MAINTENANCE": 5, - "FAILED": 6, - "BOOTSTRAPPING": 8, - "PROMOTING": 9 - } - }, - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "READ_POOL": 2, - "SECONDARY": 3 - } - }, - "AvailabilityType": { - "values": { - "AVAILABILITY_TYPE_UNSPECIFIED": 0, - "ZONAL": 1, - "REGIONAL": 2 - } - }, - "ActivationPolicy": { - "values": { - "ACTIVATION_POLICY_UNSPECIFIED": 0, - "ALWAYS": 1, - "NEVER": 2 - } - } - } - }, - "ConnectionInfo": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", - "(google.api.resource).plural": "connectionInfos", - "(google.api.resource).singular": "connectionInfo" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "ipAddress": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicIpAddress": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceUid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Backup": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Backup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}", - "(google.api.resource).plural": "backups", - "(google.api.resource).singular": "backup", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createCompletionTime": { - "type": "google.protobuf.Timestamp", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "Type", - "id": 8 - }, - "description": { - "type": "string", - "id": 9 - }, - "clusterUid": { - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "reconciling": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 14 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 16 - }, - "sizeBytes": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expiryTime": { - "type": "google.protobuf.Timestamp", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expiryQuantity": { - "type": "QuantityBasedExpiry", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "tags": { - "keyType": "string", - "type": "string", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "QuantityBasedExpiry": { - "fields": { - "retentionCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "totalRetentionCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "CREATING": 2, - "FAILED": 3, - "DELETING": 4 - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ON_DEMAND": 1, - "AUTOMATED": 2, - "CONTINUOUS": 3 - } - } - } - }, - "SupportedDatabaseFlag": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", - "(google.api.resource).plural": "supportedDatabaseFlags", - "(google.api.resource).singular": "supportedDatabaseFlag" - }, - "oneofs": { - "restrictions": { - "oneof": [ - "stringRestrictions", - "integerRestrictions" - ] - }, - "recommendedValue": { - "oneof": [ - "recommendedStringValue", - "recommendedIntegerValue" - ] - } - }, - "fields": { - "stringRestrictions": { - "type": "StringRestrictions", - "id": 7 - }, - "integerRestrictions": { - "type": "IntegerRestrictions", - "id": 8 - }, - "recommendedStringValue": { - "type": "string", - "id": 10 - }, - "recommendedIntegerValue": { - "type": "google.protobuf.Int64Value", - "id": 11 - }, - "name": { - "type": "string", - "id": 1 - }, - "flagName": { - "type": "string", - "id": 2 - }, - "valueType": { - "type": "ValueType", - "id": 3 - }, - "acceptsMultipleValues": { - "type": "bool", - "id": 4 - }, - "supportedDbVersions": { - "rule": "repeated", - "type": "DatabaseVersion", - "id": 5 - }, - "requiresDbRestart": { - "type": "bool", - "id": 6 - }, - "scope": { - "type": "Scope", - "id": 9 - } - }, - "nested": { - "StringRestrictions": { - "fields": { - "allowedValues": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "IntegerRestrictions": { - "fields": { - "minValue": { - "type": "google.protobuf.Int64Value", - "id": 1 - }, - "maxValue": { - "type": "google.protobuf.Int64Value", - "id": 2 - } - } - }, - "ValueType": { - "values": { - "VALUE_TYPE_UNSPECIFIED": 0, - "STRING": 1, - "INTEGER": 2, - "FLOAT": 3, - "NONE": 4 - } - }, - "Scope": { - "values": { - "SCOPE_UNSPECIFIED": 0, - "DATABASE": 1, - "CONNECTION_POOL": 2 - } - } - } - }, - "User": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/User", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", - "(google.api.resource).plural": "users", - "(google.api.resource).singular": "user", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "password": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "databaseRoles": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "userType": { - "type": "UserType", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "keepExtraRoles": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - } - }, - "nested": { - "UserType": { - "values": { - "USER_TYPE_UNSPECIFIED": 0, - "ALLOYDB_BUILT_IN": 1, - "ALLOYDB_IAM_USER": 2 - } - } - } - }, - "Database": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Database", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}", - "(google.api.resource).plural": "databases", - "(google.api.resource).singular": "database", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_isTemplateDatabase": { - "oneof": [ - "isTemplateDatabase" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "charset": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "collation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "characterType": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "databaseTemplate": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "isTemplateDatabase": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "AlloyDBAdmin": { - "options": { - "(google.api.default_host)": "alloydb.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListClusters": { - "requestType": "ListClustersRequest", - "responseType": "ListClustersResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/clusters", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/clusters" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetCluster": { - "requestType": "GetClusterRequest", - "responseType": "Cluster", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/clusters/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateCluster": { - "requestType": "CreateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "parent,cluster,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/clusters", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "parent,cluster,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateCluster": { - "requestType": "UpdateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{cluster.name=projects/*/locations/*/clusters/*}", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "cluster,update_mask", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{cluster.name=projects/*/locations/*/clusters/*}", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "cluster,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExportCluster": { - "requestType": "ExportClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:export", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options", - "(google.longrunning.operation_info).response_type": "ExportClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*}:export", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ExportClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ImportCluster": { - "requestType": "ImportClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:import", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,gcs_uri,database,user", - "(google.longrunning.operation_info).response_type": "ImportClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*}:import", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,gcs_uri,database,user" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpgradeCluster": { - "requestType": "UpgradeClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{name=projects/*/locations/*/clusters/*}:upgrade", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,version", - "(google.longrunning.operation_info).response_type": "UpgradeClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{name=projects/*/locations/*/clusters/*}:upgrade", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "UpgradeClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteCluster": { - "requestType": "DeleteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/clusters/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "PromoteCluster": { - "requestType": "PromoteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:promote", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*}:promote", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "SwitchoverCluster": { - "requestType": "SwitchoverClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*}:switchover", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*}:switchover", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestoreCluster": { - "requestType": "RestoreClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:restore", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/clusters:restore", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateSecondaryCluster": { - "requestType": "CreateSecondaryClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "parent,cluster,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/clusters:createsecondary", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "parent,cluster,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/instances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/clusters/*}/instances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "parent,instance,instance_id", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "parent,instance,instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateSecondaryInstance": { - "requestType": "CreateSecondaryInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "parent,instance,instance_id", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "parent,instance,instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "BatchCreateInstances": { - "requestType": "BatchCreateInstancesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", - "(google.api.http).body": "requests", - "(google.longrunning.operation_info).response_type": "BatchCreateInstancesResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", - "body": "requests" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchCreateInstancesResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateInstance": { - "requestType": "UpdateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "instance,update_mask", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{instance.name=projects/*/locations/*/clusters/*/instances/*}", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "instance,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "FailoverInstance": { - "requestType": "FailoverInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:failover", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "InjectFault": { - "requestType": "InjectFaultRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", - "(google.api.http).body": "*", - "(google.api.method_signature)": "fault_type,name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", - "body": "*" - } - }, - { - "(google.api.method_signature)": "fault_type,name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestartInstance": { - "requestType": "RestartInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/clusters/*/instances/*}:restart", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExecuteSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "ExecuteSqlResponse", - "options": { - "(google.api.http).post": "/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance,database,user,sql_statement,password" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance,database,user,sql_statement,password" - } - ] - }, - "ListBackups": { - "requestType": "ListBackupsRequest", - "responseType": "ListBackupsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backups", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/backups" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetBackup": { - "requestType": "GetBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateBackup": { - "requestType": "CreateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backups", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "parent,backup,backup_id", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/backups", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "parent,backup,backup_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateBackup": { - "requestType": "UpdateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backups/*}", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "backup,update_mask", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup.name=projects/*/locations/*/backups/*}", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "backup,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListSupportedDatabaseFlags": { - "requestType": "ListSupportedDatabaseFlagsRequest", - "responseType": "ListSupportedDatabaseFlagsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/supportedDatabaseFlags" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GenerateClientCertificate": { - "requestType": "GenerateClientCertificateRequest", - "responseType": "GenerateClientCertificateResponse", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetConnectionInfo": { - "requestType": "GetConnectionInfoRequest", - "responseType": "ConnectionInfo", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListUsers": { - "requestType": "ListUsersRequest", - "responseType": "ListUsersResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/users", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/clusters/*}/users" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetUser": { - "requestType": "GetUserRequest", - "responseType": "User", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/clusters/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateUser": { - "requestType": "CreateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/users", - "(google.api.http).body": "user", - "(google.api.method_signature)": "parent,user,user_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/clusters/*}/users", - "body": "user" - } - }, - { - "(google.api.method_signature)": "parent,user,user_id" - } - ] - }, - "UpdateUser": { - "requestType": "UpdateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).patch": "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.http).body": "user", - "(google.api.method_signature)": "user,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{user.name=projects/*/locations/*/clusters/*/users/*}", - "body": "user" - } - }, - { - "(google.api.method_signature)": "user,update_mask" - } - ] - }, - "DeleteUser": { - "requestType": "DeleteUserRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/clusters/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDatabases": { - "requestType": "ListDatabasesRequest", - "responseType": "ListDatabasesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/databases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/clusters/*}/databases" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "ListClustersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListClustersResponse": { - "fields": { - "clusters": { - "rule": "repeated", - "type": "Cluster", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "view": { - "type": "ClusterView", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateSecondaryClusterRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateClusterRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateClusterRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cluster": { - "type": "Cluster", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GcsDestination": { - "fields": { - "uri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportClusterRequest": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - }, - "exportOptions": { - "oneof": [ - "csvExportOptions", - "sqlExportOptions" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "csvExportOptions": { - "type": "CsvExportOptions", - "id": 4 - }, - "sqlExportOptions": { - "type": "SqlExportOptions", - "id": 5 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "database": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "CsvExportOptions": { - "fields": { - "selectQuery": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldDelimiter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quoteCharacter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "escapeCharacter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SqlExportOptions": { - "oneofs": { - "_schemaOnly": { - "oneof": [ - "schemaOnly" - ] - }, - "_cleanTargetObjects": { - "oneof": [ - "cleanTargetObjects" - ] - }, - "_ifExistTargetObjects": { - "oneof": [ - "ifExistTargetObjects" - ] - } - }, - "fields": { - "tables": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schemaOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "cleanTargetObjects": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ifExistTargetObjects": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - }, - "ExportClusterResponse": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ImportClusterRequest": { - "oneofs": { - "importOptions": { - "oneof": [ - "sqlImportOptions", - "csvImportOptions" - ] - } - }, - "fields": { - "sqlImportOptions": { - "type": "SqlImportOptions", - "id": 4 - }, - "csvImportOptions": { - "type": "CsvImportOptions", - "id": 7 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "gcsUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "database": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SqlImportOptions": { - "fields": {} - }, - "CsvImportOptions": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fieldDelimiter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quoteCharacter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "escapeCharacter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ImportClusterResponse": { - "fields": { - "bytesDownloaded": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpgradeClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "version": { - "type": "DatabaseVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpgradeClusterResponse": { - "fields": { - "status": { - "type": "Status", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "clusterUpgradeDetails": { - "rule": "repeated", - "type": "ClusterUpgradeDetails", - "id": 3 - } - }, - "nested": { - "StageInfo": { - "fields": { - "stage": { - "type": "Stage", - "id": 1 - }, - "status": { - "type": "Status", - "id": 2 - }, - "logsUrl": { - "type": "string", - "id": 3 - } - } - }, - "InstanceUpgradeDetails": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "upgradeStatus": { - "type": "Status", - "id": 2 - }, - "instanceType": { - "type": "Instance.InstanceType", - "id": 3 - } - } - }, - "ClusterUpgradeDetails": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "upgradeStatus": { - "type": "Status", - "id": 2 - }, - "clusterType": { - "type": "Cluster.ClusterType", - "id": 3 - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 4 - }, - "stageInfo": { - "rule": "repeated", - "type": "StageInfo", - "id": 5 - }, - "instanceUpgradeDetails": { - "rule": "repeated", - "type": "InstanceUpgradeDetails", - "id": 6 - } - } - }, - "Status": { - "values": { - "STATUS_UNSPECIFIED": 0, - "NOT_STARTED": 4, - "IN_PROGRESS": 5, - "SUCCESS": 1, - "FAILED": 2, - "PARTIAL_SUCCESS": 3, - "CANCEL_IN_PROGRESS": 6, - "CANCELLED": 7 - } - }, - "Stage": { - "values": { - "STAGE_UNSPECIFIED": 0, - "ALLOYDB_PRECHECK": 1, - "PG_UPGRADE_CHECK": 2, - "PREPARE_FOR_UPGRADE": 5, - "PRIMARY_INSTANCE_UPGRADE": 3, - "READ_POOL_INSTANCES_UPGRADE": 4, - "ROLLBACK": 6, - "CLEANUP": 7 - } - } - } - }, - "DeleteClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "force": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SwitchoverClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PromoteClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RestoreClusterRequest": { - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "continuousBackupSource" - ] - } - }, - "fields": { - "backupSource": { - "type": "BackupSource", - "id": 4 - }, - "continuousBackupSource": { - "type": "ContinuousBackupSource", - "id": 8 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "view": { - "type": "InstanceView", - "id": 2 - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateSecondaryInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateInstanceRequests": { - "fields": { - "createInstanceRequests": { - "rule": "repeated", - "type": "CreateInstanceRequest", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "requests": { - "type": "CreateInstanceRequests", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchCreateInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - } - } - }, - "BatchCreateInstancesMetadata": { - "fields": { - "instanceTargets": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "instanceStatuses": { - "keyType": "string", - "type": "BatchCreateInstanceStatus", - "id": 2 - } - } - }, - "BatchCreateInstanceStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "errorMsg": { - "type": "string", - "id": 2 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "type": { - "type": "Instance.InstanceType", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING_CREATE": 1, - "READY": 2, - "CREATING": 3, - "DELETING": 4, - "FAILED": 5, - "ROLLED_BACK": 6 - } - } - } - }, - "UpdateInstanceRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instance": { - "type": "Instance", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FailoverInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InjectFaultRequest": { - "fields": { - "faultType": { - "type": "FaultType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "FaultType": { - "values": { - "FAULT_TYPE_UNSPECIFIED": 0, - "STOP_VM": 1 - } - } - } - }, - "RestartInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteSqlRequest": { - "oneofs": { - "userCredential": { - "oneof": [ - "password" - ] - } - }, - "fields": { - "password": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instance": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sqlStatement": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteSqlResponse": { - "fields": { - "sqlResults": { - "rule": "repeated", - "type": "SqlResult", - "id": 1 - }, - "metadata": { - "type": "ExecuteSqlMetadata", - "id": 3 - } - } - }, - "ExecuteSqlMetadata": { - "fields": { - "message": { - "type": "string", - "id": 1 - }, - "partialResult": { - "type": "bool", - "id": 2 - }, - "sqlStatementExecutionDuration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "status": { - "type": "Status", - "id": 4 - } - }, - "nested": { - "Status": { - "values": { - "STATUS_UNSPECIFIED": 0, - "OK": 1, - "PARTIAL": 2, - "ERROR": 3 - } - } - } - }, - "ListBackupsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5 - } - } - }, - "ListBackupsResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - } - } - }, - "CreateBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "Backup", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "backup": { - "type": "Backup", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSupportedDatabaseFlagsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/SupportedDatabaseFlag" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "scope": { - "type": "SupportedDatabaseFlag.Scope", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSupportedDatabaseFlagsResponse": { - "fields": { - "supportedDatabaseFlags": { - "rule": "repeated", - "type": "SupportedDatabaseFlag", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GenerateClientCertificateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "certDuration": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "publicKey": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "useMetadataExchange": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GenerateClientCertificateResponse": { - "fields": { - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "caCert": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetConnectionInfoRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "oneofs": { - "requestSpecific": { - "oneof": [ - "batchCreateInstancesMetadata", - "upgradeClusterStatus" - ] - } - }, - "fields": { - "batchCreateInstancesMetadata": { - "type": "BatchCreateInstancesMetadata", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "upgradeClusterStatus": { - "type": "UpgradeClusterStatus", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "UpgradeClusterStatus": { - "fields": { - "state": { - "type": "UpgradeClusterResponse.Status", - "id": 1 - }, - "cancellable": { - "type": "bool", - "id": 2 - }, - "sourceVersion": { - "type": "DatabaseVersion", - "id": 3 - }, - "targetVersion": { - "type": "DatabaseVersion", - "id": 4 - }, - "stages": { - "rule": "repeated", - "type": "StageStatus", - "id": 5 - } - }, - "nested": { - "StageStatus": { - "oneofs": { - "stageSpecificStatus": { - "oneof": [ - "readPoolInstancesUpgrade" - ] - } - }, - "fields": { - "readPoolInstancesUpgrade": { - "type": "ReadPoolInstancesUpgradeStageStatus", - "id": 11 - }, - "stage": { - "type": "UpgradeClusterResponse.Stage", - "id": 1 - }, - "state": { - "type": "UpgradeClusterResponse.Status", - "id": 2 - }, - "schedule": { - "type": "StageSchedule", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "StageSchedule": { - "fields": { - "estimatedStartTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "actualStartTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "estimatedEndTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "actualEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - } - } - }, - "ReadPoolInstancesUpgradeStageStatus": { - "fields": { - "upgradeStats": { - "type": "Stats", - "id": 1 - } - }, - "nested": { - "Stats": { - "fields": { - "notStarted": { - "type": "int32", - "id": 1 - }, - "ongoing": { - "type": "int32", - "id": 2 - }, - "success": { - "type": "int32", - "id": 3 - }, - "failed": { - "type": "int32", - "id": 4 - } - } - } - } - } - } - }, - "ListUsersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListUsersResponse": { - "fields": { - "users": { - "rule": "repeated", - "type": "User", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/User" - } - } - } - }, - "CreateUserRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" - } - }, - "userId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "User", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateUserRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "User", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/User" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDatabasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDatabasesResponse": { - "fields": { - "databases": { - "rule": "repeated", - "type": "Database", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SqlResult": { - "fields": { - "columns": { - "rule": "repeated", - "type": "SqlResultColumn", - "id": 1 - }, - "rows": { - "rule": "repeated", - "type": "SqlResultRow", - "id": 2 - } - } - }, - "SqlResultColumn": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - } - } - }, - "SqlResultRow": { - "fields": { - "values": { - "rule": "repeated", - "type": "SqlResultValue", - "id": 1 - } - } - }, - "SqlResultValue": { - "oneofs": { - "_value": { - "oneof": [ - "value" - ] - }, - "_nullValue": { - "oneof": [ - "nullValue" - ] - } - }, - "fields": { - "value": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "nullValue": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - }, - "v1alpha": { - "options": { - "csharp_namespace": "Google.Cloud.AlloyDb.V1Alpha", - "go_package": "cloud.google.com/go/alloydb/apiv1alpha/alloydbpb;alloydbpb", - "java_multiple_files": true, - "java_outer_classname": "DataModelProto", - "java_package": "com.google.cloud.alloydb.v1alpha", - "php_namespace": "Google\\Cloud\\AlloyDb\\V1alpha", - "ruby_package": "Google::Cloud::AlloyDB::V1alpha", - "(google.api.resource_definition).type": "compute.googleapis.com/ServiceAttachment", - "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" - }, - "nested": { - "CloudSQLBackupRunSource": { - "fields": { - "project": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupRunId": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AlloyDBCSQLAdmin": { - "options": { - "(google.api.default_host)": "alloydb.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RestoreFromCloudSQL": { - "requestType": "RestoreFromCloudSQLRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - } - } - }, - "RestoreFromCloudSQLRequest": { - "oneofs": { - "source": { - "oneof": [ - "cloudsqlBackupRunSource" - ] - } - }, - "fields": { - "cloudsqlBackupRunSource": { - "type": "CloudSQLBackupRunSource", - "id": 101 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "InstanceView": { - "values": { - "INSTANCE_VIEW_UNSPECIFIED": 0, - "INSTANCE_VIEW_BASIC": 1, - "INSTANCE_VIEW_FULL": 2 - } - }, - "ClusterView": { - "values": { - "CLUSTER_VIEW_UNSPECIFIED": 0, - "CLUSTER_VIEW_BASIC": 1, - "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 - } - }, - "DatabaseVersion": { - "valuesOptions": { - "POSTGRES_13": { - "deprecated": true - } - }, - "values": { - "DATABASE_VERSION_UNSPECIFIED": 0, - "POSTGRES_13": 1, - "POSTGRES_14": 2, - "POSTGRES_15": 3, - "POSTGRES_16": 4, - "POSTGRES_17": 5, - "POSTGRES_18": 6 - } - }, - "SubscriptionType": { - "values": { - "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, - "STANDARD": 1, - "TRIAL": 2 - } - }, - "UserPassword": { - "fields": { - "user": { - "type": "string", - "id": 1 - }, - "password": { - "type": "string", - "id": 2 - } - } - }, - "MigrationSource": { - "fields": { - "hostPort": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referenceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceType": { - "type": "MigrationSourceType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "MigrationSourceType": { - "values": { - "MIGRATION_SOURCE_TYPE_UNSPECIFIED": 0, - "DMS": 1 - } - } - } - }, - "EncryptionConfig": { - "fields": { - "kmsKeyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "EncryptionInfo": { - "fields": { - "encryptionType": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_DEFAULT_ENCRYPTION": 1, - "CUSTOMER_MANAGED_ENCRYPTION": 2 - } - } - } - }, - "SslConfig": { - "fields": { - "sslMode": { - "type": "SslMode", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "caSource": { - "type": "CaSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SslMode": { - "valuesOptions": { - "SSL_MODE_ALLOW": { - "deprecated": true - }, - "SSL_MODE_REQUIRE": { - "deprecated": true - }, - "SSL_MODE_VERIFY_CA": { - "deprecated": true - } - }, - "values": { - "SSL_MODE_UNSPECIFIED": 0, - "SSL_MODE_ALLOW": 1, - "SSL_MODE_REQUIRE": 2, - "SSL_MODE_VERIFY_CA": 3, - "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, - "ENCRYPTED_ONLY": 5 - } - }, - "CaSource": { - "values": { - "CA_SOURCE_UNSPECIFIED": 0, - "CA_SOURCE_MANAGED": 1 - } - } - } - }, - "AutomatedBackupPolicy": { - "oneofs": { - "schedule": { - "oneof": [ - "weeklySchedule" - ] - }, - "retention": { - "oneof": [ - "timeBasedRetention", - "quantityBasedRetention" - ] - }, - "_enabled": { - "oneof": [ - "enabled" - ] - } - }, - "fields": { - "weeklySchedule": { - "type": "WeeklySchedule", - "id": 2 - }, - "timeBasedRetention": { - "type": "TimeBasedRetention", - "id": 4 - }, - "quantityBasedRetention": { - "type": "QuantityBasedRetention", - "id": 5 - }, - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "backupWindow": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "location": { - "type": "string", - "id": 6 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - } - }, - "nested": { - "WeeklySchedule": { - "fields": { - "startTimes": { - "rule": "repeated", - "type": "google.type.TimeOfDay", - "id": 1 - }, - "daysOfWeek": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 2 - } - } - }, - "TimeBasedRetention": { - "fields": { - "retentionPeriod": { - "type": "google.protobuf.Duration", - "id": 1 - } - } - }, - "QuantityBasedRetention": { - "fields": { - "count": { - "type": "int32", - "id": 1 - } - } - } - } - }, - "ContinuousBackupConfig": { - "oneofs": { - "_enabled": { - "oneof": [ - "enabled" - ] - } - }, - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "recoveryWindowDays": { - "type": "int32", - "id": 4 - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 3 - } - } - }, - "ContinuousBackupInfo": { - "fields": { - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enabledTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "schedule": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "earliestRestorableTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupSource": { - "fields": { - "backupUid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - } - } - }, - "ContinuousBackupSource": { - "fields": { - "cluster": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pointInTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "MaintenanceUpdatePolicy": { - "fields": { - "maintenanceWindows": { - "rule": "repeated", - "type": "MaintenanceWindow", - "id": 1 - }, - "denyMaintenancePeriods": { - "rule": "repeated", - "type": "DenyMaintenancePeriod", - "id": 2 - } - }, - "nested": { - "MaintenanceWindow": { - "fields": { - "day": { - "type": "google.type.DayOfWeek", - "id": 1 - }, - "startTime": { - "type": "google.type.TimeOfDay", - "id": 2 - } - } - }, - "DenyMaintenancePeriod": { - "fields": { - "startDate": { - "type": "google.type.Date", - "id": 1 - }, - "endDate": { - "type": "google.type.Date", - "id": 2 - }, - "time": { - "type": "google.type.TimeOfDay", - "id": 3 - } - } - } - } - }, - "MaintenanceSchedule": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Cluster": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Cluster", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", - "(google.api.resource).plural": "clusters", - "(google.api.resource).singular": "cluster", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "migrationSource", - "cloudsqlBackupRunSource" - ] - } - }, - "fields": { - "backupSource": { - "type": "BackupSource", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "migrationSource": { - "type": "MigrationSource", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudsqlBackupRunSource": { - "type": "CloudSQLBackupRunSource", - "id": 42, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterType": { - "type": "ClusterType", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkConfig": { - "type": "NetworkConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "network": { - "type": "string", - "id": 10, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "etag": { - "type": "string", - "id": 11 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 12 - }, - "reconciling": { - "type": "bool", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "initialUser": { - "type": "UserPassword", - "id": 14, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "automatedBackupPolicy": { - "type": "AutomatedBackupPolicy", - "id": 17 - }, - "sslConfig": { - "type": "SslConfig", - "id": 18, - "options": { - "deprecated": true - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "continuousBackupConfig": { - "type": "ContinuousBackupConfig", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "continuousBackupInfo": { - "type": "ContinuousBackupInfo", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "secondaryConfig": { - "type": "SecondaryConfig", - "id": 22 - }, - "primaryConfig": { - "type": "PrimaryConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscConfig": { - "type": "PscConfig", - "id": 31, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceUpdatePolicy": { - "type": "MaintenanceUpdatePolicy", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceSchedule": { - "type": "MaintenanceSchedule", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "geminiConfig": { - "type": "GeminiClusterConfig", - "id": 36, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subscriptionType": { - "type": "SubscriptionType", - "id": 38, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trialMetadata": { - "type": "TrialMetadata", - "id": 39, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "tags": { - "keyType": "string", - "type": "string", - "id": 41, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccountEmail": { - "type": "string", - "id": 46, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataplexConfig": { - "type": "DataplexConfig", - "id": 47, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "NetworkConfig": { - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "allocatedIpRange": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SecondaryConfig": { - "fields": { - "primaryClusterName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - } - } - }, - "PrimaryConfig": { - "fields": { - "secondaryClusterNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - } - } - }, - "PscConfig": { - "fields": { - "pscEnabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceOwnedProjectNumber": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TrialMetadata": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "upgradeTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "graceEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "DataplexConfig": { - "fields": { - "enabled": { - "type": "bool", - "id": 1 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "STOPPED": 2, - "EMPTY": 3, - "CREATING": 4, - "DELETING": 5, - "FAILED": 6, - "BOOTSTRAPPING": 7, - "MAINTENANCE": 8, - "PROMOTING": 9 - } - }, - "ClusterType": { - "values": { - "CLUSTER_TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "SECONDARY": 2 - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceType": { - "type": "InstanceType", - "id": 9, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "machineConfig": { - "type": "MachineConfig", - "id": 10 - }, - "availabilityType": { - "type": "AvailabilityType", - "id": 11 - }, - "gceZone": { - "type": "string", - "id": 12 - }, - "databaseFlags": { - "keyType": "string", - "type": "string", - "id": 13 - }, - "writableNode": { - "type": "Node", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodes": { - "rule": "repeated", - "type": "Node", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "queryInsightsConfig": { - "type": "QueryInsightsInstanceConfig", - "id": 21 - }, - "observabilityConfig": { - "type": "ObservabilityInstanceConfig", - "id": 26 - }, - "readPoolConfig": { - "type": "ReadPoolConfig", - "id": 14 - }, - "ipAddress": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicIpAddress": { - "type": "string", - "id": 27, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 17 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 18 - }, - "updatePolicy": { - "type": "UpdatePolicy", - "id": 22 - }, - "clientConnectionConfig": { - "type": "ClientConnectionConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscInstanceConfig": { - "type": "PscInstanceConfig", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkConfig": { - "type": "InstanceNetworkConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "geminiConfig": { - "type": "GeminiInstanceConfig", - "id": 33, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outboundPublicIpAddresses": { - "rule": "repeated", - "type": "string", - "id": 34, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "activationPolicy": { - "type": "ActivationPolicy", - "id": 35, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectionPoolConfig": { - "type": "ConnectionPoolConfig", - "id": 37, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcaConfig": { - "type": "GCAInstanceConfig", - "id": 38, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "MachineConfig": { - "fields": { - "cpuCount": { - "type": "int32", - "id": 1 - }, - "machineType": { - "type": "string", - "id": 4 - } - } - }, - "Node": { - "fields": { - "zoneId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "id": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ip": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "QueryInsightsInstanceConfig": { - "oneofs": { - "_recordApplicationTags": { - "oneof": [ - "recordApplicationTags" - ] - }, - "_recordClientAddress": { - "oneof": [ - "recordClientAddress" - ] - }, - "_queryPlansPerMinute": { - "oneof": [ - "queryPlansPerMinute" - ] - } - }, - "fields": { - "recordApplicationTags": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "recordClientAddress": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "queryStringLength": { - "type": "uint32", - "id": 4 - }, - "queryPlansPerMinute": { - "type": "uint32", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "ObservabilityInstanceConfig": { - "oneofs": { - "_enabled": { - "oneof": [ - "enabled" - ] - }, - "_preserveComments": { - "oneof": [ - "preserveComments" - ] - }, - "_trackWaitEvents": { - "oneof": [ - "trackWaitEvents" - ] - }, - "_trackWaitEventTypes": { - "oneof": [ - "trackWaitEventTypes" - ] - }, - "_maxQueryStringLength": { - "oneof": [ - "maxQueryStringLength" - ] - }, - "_recordApplicationTags": { - "oneof": [ - "recordApplicationTags" - ] - }, - "_queryPlansPerMinute": { - "oneof": [ - "queryPlansPerMinute" - ] - }, - "_trackActiveQueries": { - "oneof": [ - "trackActiveQueries" - ] - }, - "_trackClientAddress": { - "oneof": [ - "trackClientAddress" - ] - }, - "_assistiveExperiencesEnabled": { - "oneof": [ - "assistiveExperiencesEnabled" - ] - } - }, - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "preserveComments": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "trackWaitEvents": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "trackWaitEventTypes": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "maxQueryStringLength": { - "type": "int32", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "recordApplicationTags": { - "type": "bool", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "queryPlansPerMinute": { - "type": "int32", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "trackActiveQueries": { - "type": "bool", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "trackClientAddress": { - "type": "bool", - "id": 9, - "options": { - "proto3_optional": true - } - }, - "assistiveExperiencesEnabled": { - "type": "bool", - "id": 10, - "options": { - "proto3_optional": true - } - } - } - }, - "ReadPoolConfig": { - "fields": { - "nodeCount": { - "type": "int32", - "id": 1 - } - } - }, - "UpdatePolicy": { - "fields": { - "mode": { - "type": "Mode", - "id": 1 - } - }, - "nested": { - "Mode": { - "values": { - "MODE_UNSPECIFIED": 0, - "DEFAULT": 1, - "FORCE_APPLY": 2 - } - } - } - }, - "ClientConnectionConfig": { - "fields": { - "requireConnectors": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sslConfig": { - "type": "SslConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PscInterfaceConfig": { - "fields": { - "networkAttachmentResource": { - "type": "string", - "id": 1 - } - } - }, - "PscAutoConnectionConfig": { - "fields": { - "consumerProject": { - "type": "string", - "id": 1 - }, - "consumerNetwork": { - "type": "string", - "id": 2 - }, - "ipAddress": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "consumerNetworkStatus": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PscInstanceConfig": { - "fields": { - "serviceAttachmentLink": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/ServiceAttachment" - } - }, - "allowedConsumerProjects": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscDnsName": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscInterfaceConfigs": { - "rule": "repeated", - "type": "PscInterfaceConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscAutoConnections": { - "rule": "repeated", - "type": "PscAutoConnectionConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceNetworkConfig": { - "fields": { - "authorizedExternalNetworks": { - "rule": "repeated", - "type": "AuthorizedNetwork", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enablePublicIp": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableOutboundPublicIp": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "network": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "allocatedIpRangeOverride": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AuthorizedNetwork": { - "fields": { - "cidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4" - } - } - } - } - } - }, - "ConnectionPoolConfig": { - "fields": { - "enabled": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "flags": { - "keyType": "string", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "poolerCount": { - "type": "int32", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "STOPPED": 2, - "CREATING": 3, - "DELETING": 4, - "MAINTENANCE": 5, - "FAILED": 6, - "BOOTSTRAPPING": 8, - "PROMOTING": 9 - } - }, - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "READ_POOL": 2, - "SECONDARY": 3 - } - }, - "AvailabilityType": { - "values": { - "AVAILABILITY_TYPE_UNSPECIFIED": 0, - "ZONAL": 1, - "REGIONAL": 2 - } - }, - "ActivationPolicy": { - "values": { - "ACTIVATION_POLICY_UNSPECIFIED": 0, - "ALWAYS": 1, - "NEVER": 2 - } - } - } - }, - "ConnectionInfo": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", - "(google.api.resource).plural": "connectionInfos", - "(google.api.resource).singular": "connectionInfo" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "ipAddress": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicIpAddress": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceUid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscDnsName": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Backup": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Backup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}", - "(google.api.resource).plural": "backups", - "(google.api.resource).singular": "backup", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createCompletionTime": { - "type": "google.protobuf.Timestamp", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "Type", - "id": 8 - }, - "description": { - "type": "string", - "id": 9 - }, - "clusterUid": { - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "reconciling": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 14 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 16 - }, - "sizeBytes": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expiryTime": { - "type": "google.protobuf.Timestamp", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expiryQuantity": { - "type": "QuantityBasedExpiry", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "tags": { - "keyType": "string", - "type": "string", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "QuantityBasedExpiry": { - "fields": { - "retentionCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "totalRetentionCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "CREATING": 2, - "FAILED": 3, - "DELETING": 4 - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ON_DEMAND": 1, - "AUTOMATED": 2, - "CONTINUOUS": 3 - } - } - } - }, - "SupportedDatabaseFlag": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", - "(google.api.resource).plural": "supportedDatabaseFlags", - "(google.api.resource).singular": "supportedDatabaseFlag" - }, - "oneofs": { - "restrictions": { - "oneof": [ - "stringRestrictions", - "integerRestrictions" - ] - }, - "recommendedValue": { - "oneof": [ - "recommendedStringValue", - "recommendedIntegerValue" - ] - } - }, - "fields": { - "stringRestrictions": { - "type": "StringRestrictions", - "id": 7 - }, - "integerRestrictions": { - "type": "IntegerRestrictions", - "id": 8 - }, - "recommendedStringValue": { - "type": "string", - "id": 10 - }, - "recommendedIntegerValue": { - "type": "google.protobuf.Int64Value", - "id": 11 - }, - "name": { - "type": "string", - "id": 1 - }, - "flagName": { - "type": "string", - "id": 2 - }, - "valueType": { - "type": "ValueType", - "id": 3 - }, - "acceptsMultipleValues": { - "type": "bool", - "id": 4 - }, - "supportedDbVersions": { - "rule": "repeated", - "type": "DatabaseVersion", - "id": 5 - }, - "requiresDbRestart": { - "type": "bool", - "id": 6 - }, - "scope": { - "type": "Scope", - "id": 9 - } - }, - "nested": { - "StringRestrictions": { - "fields": { - "allowedValues": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "IntegerRestrictions": { - "fields": { - "minValue": { - "type": "google.protobuf.Int64Value", - "id": 1 - }, - "maxValue": { - "type": "google.protobuf.Int64Value", - "id": 2 - } - } - }, - "ValueType": { - "values": { - "VALUE_TYPE_UNSPECIFIED": 0, - "STRING": 1, - "INTEGER": 2, - "FLOAT": 3, - "NONE": 4 - } - }, - "Scope": { - "values": { - "SCOPE_UNSPECIFIED": 0, - "DATABASE": 1, - "CONNECTION_POOL": 2 - } - } - } - }, - "User": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/User", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", - "(google.api.resource).plural": "users", - "(google.api.resource).singular": "user", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "password": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "databaseRoles": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "userType": { - "type": "UserType", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "keepExtraRoles": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - } - }, - "nested": { - "UserType": { - "values": { - "USER_TYPE_UNSPECIFIED": 0, - "ALLOYDB_BUILT_IN": 1, - "ALLOYDB_IAM_USER": 2 - } - } - } - }, - "Database": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Database", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}", - "(google.api.resource).plural": "databases", - "(google.api.resource).singular": "database", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_isTemplateDatabase": { - "oneof": [ - "isTemplateDatabase" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "charset": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "collation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "characterType": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "isTemplate": { - "type": "bool", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "databaseTemplate": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "isTemplateDatabase": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "GCAEntitlementType": { - "values": { - "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": 0, - "GCA_STANDARD": 1 - } - }, - "GeminiClusterConfig": { - "fields": { - "entitled": { - "type": "bool", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GeminiInstanceConfig": { - "fields": { - "entitled": { - "type": "bool", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GCAInstanceConfig": { - "fields": { - "gcaEntitlement": { - "type": "GCAEntitlementType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "AlloyDBAdmin": { - "options": { - "(google.api.default_host)": "alloydb.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListClusters": { - "requestType": "ListClustersRequest", - "responseType": "ListClustersResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/clusters", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/clusters" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetCluster": { - "requestType": "GetClusterRequest", - "responseType": "Cluster", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/clusters/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateCluster": { - "requestType": "CreateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "parent,cluster,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/clusters", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "parent,cluster,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateCluster": { - "requestType": "UpdateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "cluster,update_mask", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{cluster.name=projects/*/locations/*/clusters/*}", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "cluster,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExportCluster": { - "requestType": "ExportClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:export", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options", - "(google.longrunning.operation_info).response_type": "ExportClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:export", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ExportClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ImportCluster": { - "requestType": "ImportClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:import", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,gcs_uri,database,user", - "(google.longrunning.operation_info).response_type": "ImportClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:import", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,gcs_uri,database,user" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpgradeCluster": { - "requestType": "UpgradeClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1alpha/{name=projects/*/locations/*/clusters/*}:upgrade", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,version", - "(google.longrunning.operation_info).response_type": "UpgradeClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{name=projects/*/locations/*/clusters/*}:upgrade", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "UpgradeClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteCluster": { - "requestType": "DeleteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "PromoteCluster": { - "requestType": "PromoteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:promote", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "SwitchoverCluster": { - "requestType": "SwitchoverClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:switchover", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*}:switchover", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestoreCluster": { - "requestType": "RestoreClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restore", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/clusters:restore", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateSecondaryCluster": { - "requestType": "CreateSecondaryClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "parent,cluster,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/clusters:createsecondary", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "parent,cluster,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "parent,instance,instance_id", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "parent,instance,instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateSecondaryInstance": { - "requestType": "CreateSecondaryInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "parent,instance,instance_id", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "parent,instance,instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "BatchCreateInstances": { - "requestType": "BatchCreateInstancesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", - "(google.api.http).body": "requests", - "(google.longrunning.operation_info).response_type": "BatchCreateInstancesResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", - "body": "requests" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchCreateInstancesResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateInstance": { - "requestType": "UpdateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "instance,update_mask", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{instance.name=projects/*/locations/*/clusters/*/instances/*}", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "instance,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "FailoverInstance": { - "requestType": "FailoverInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:failover", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "InjectFault": { - "requestType": "InjectFaultRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", - "(google.api.http).body": "*", - "(google.api.method_signature)": "fault_type,name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", - "body": "*" - } - }, - { - "(google.api.method_signature)": "fault_type,name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestartInstance": { - "requestType": "RestartInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/clusters/*/instances/*}:restart", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExecuteSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "ExecuteSqlResponse", - "options": { - "(google.api.http).post": "/v1alpha/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance,database,user,sql_statement,password" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance,database,user,sql_statement,password" - } - ] - }, - "ListBackups": { - "requestType": "ListBackupsRequest", - "responseType": "ListBackupsResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/backups", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/backups" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetBackup": { - "requestType": "GetBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateBackup": { - "requestType": "CreateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/backups", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "parent,backup,backup_id", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/backups", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "parent,backup,backup_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateBackup": { - "requestType": "UpdateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "backup,update_mask", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{backup.name=projects/*/locations/*/backups/*}", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "backup,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListSupportedDatabaseFlags": { - "requestType": "ListSupportedDatabaseFlagsRequest", - "responseType": "ListSupportedDatabaseFlagsResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/supportedDatabaseFlags" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GenerateClientCertificate": { - "requestType": "GenerateClientCertificateRequest", - "responseType": "GenerateClientCertificateResponse", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetConnectionInfo": { - "requestType": "GetConnectionInfoRequest", - "responseType": "ConnectionInfo", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListUsers": { - "requestType": "ListUsersRequest", - "responseType": "ListUsersResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetUser": { - "requestType": "GetUserRequest", - "responseType": "User", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateUser": { - "requestType": "CreateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", - "(google.api.http).body": "user", - "(google.api.method_signature)": "parent,user,user_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/users", - "body": "user" - } - }, - { - "(google.api.method_signature)": "parent,user,user_id" - } - ] - }, - "UpdateUser": { - "requestType": "UpdateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).patch": "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.http).body": "user", - "(google.api.method_signature)": "user,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{user.name=projects/*/locations/*/clusters/*/users/*}", - "body": "user" - } - }, - { - "(google.api.method_signature)": "user,update_mask" - } - ] - }, - "DeleteUser": { - "requestType": "DeleteUserRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/clusters/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDatabases": { - "requestType": "ListDatabasesRequest", - "responseType": "ListDatabasesResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateDatabase": { - "requestType": "CreateDatabaseRequest", - "responseType": "Database", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases", - "(google.api.http).body": "database", - "(google.api.method_signature)": "parent,database,database_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*/clusters/*}/databases", - "body": "database" - } - }, - { - "(google.api.method_signature)": "parent,database,database_id" - } - ] - } - } - }, - "ListClustersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListClustersResponse": { - "fields": { - "clusters": { - "rule": "repeated", - "type": "Cluster", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "view": { - "type": "ClusterView", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateSecondaryClusterRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateClusterRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateClusterRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cluster": { - "type": "Cluster", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GcsDestination": { - "fields": { - "uri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportClusterRequest": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - }, - "exportOptions": { - "oneof": [ - "csvExportOptions", - "sqlExportOptions" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "csvExportOptions": { - "type": "CsvExportOptions", - "id": 4 - }, - "sqlExportOptions": { - "type": "SqlExportOptions", - "id": 5 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "database": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "CsvExportOptions": { - "fields": { - "selectQuery": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldDelimiter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quoteCharacter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "escapeCharacter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SqlExportOptions": { - "oneofs": { - "_schemaOnly": { - "oneof": [ - "schemaOnly" - ] - }, - "_cleanTargetObjects": { - "oneof": [ - "cleanTargetObjects" - ] - }, - "_ifExistTargetObjects": { - "oneof": [ - "ifExistTargetObjects" - ] - } - }, - "fields": { - "tables": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schemaOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "cleanTargetObjects": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ifExistTargetObjects": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - }, - "ExportClusterResponse": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ImportClusterRequest": { - "oneofs": { - "importOptions": { - "oneof": [ - "sqlImportOptions", - "csvImportOptions" - ] - } - }, - "fields": { - "sqlImportOptions": { - "type": "SqlImportOptions", - "id": 4 - }, - "csvImportOptions": { - "type": "CsvImportOptions", - "id": 7 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "gcsUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "database": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SqlImportOptions": { - "fields": {} - }, - "CsvImportOptions": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fieldDelimiter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quoteCharacter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "escapeCharacter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ImportClusterResponse": { - "fields": { - "bytesDownloaded": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpgradeClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "version": { - "type": "DatabaseVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpgradeClusterResponse": { - "fields": { - "status": { - "type": "Status", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "clusterUpgradeDetails": { - "rule": "repeated", - "type": "ClusterUpgradeDetails", - "id": 3 - } - }, - "nested": { - "StageInfo": { - "fields": { - "stage": { - "type": "Stage", - "id": 1 - }, - "status": { - "type": "Status", - "id": 2 - }, - "logsUrl": { - "type": "string", - "id": 3 - } - } - }, - "InstanceUpgradeDetails": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "upgradeStatus": { - "type": "Status", - "id": 2 - }, - "instanceType": { - "type": "Instance.InstanceType", - "id": 3 - } - } - }, - "ClusterUpgradeDetails": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "upgradeStatus": { - "type": "Status", - "id": 2 - }, - "clusterType": { - "type": "Cluster.ClusterType", - "id": 3 - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 4 - }, - "stageInfo": { - "rule": "repeated", - "type": "StageInfo", - "id": 5 - }, - "instanceUpgradeDetails": { - "rule": "repeated", - "type": "InstanceUpgradeDetails", - "id": 6 - } - } - }, - "Status": { - "values": { - "STATUS_UNSPECIFIED": 0, - "NOT_STARTED": 4, - "IN_PROGRESS": 5, - "SUCCESS": 1, - "FAILED": 2, - "PARTIAL_SUCCESS": 3, - "CANCEL_IN_PROGRESS": 6, - "CANCELLED": 7 - } - }, - "Stage": { - "values": { - "STAGE_UNSPECIFIED": 0, - "ALLOYDB_PRECHECK": 1, - "PG_UPGRADE_CHECK": 2, - "PREPARE_FOR_UPGRADE": 5, - "PRIMARY_INSTANCE_UPGRADE": 3, - "READ_POOL_INSTANCES_UPGRADE": 4, - "ROLLBACK": 6, - "CLEANUP": 7 - } - } - } - }, - "DeleteClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "force": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SwitchoverClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PromoteClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RestoreClusterRequest": { - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "continuousBackupSource" - ] - } - }, - "fields": { - "backupSource": { - "type": "BackupSource", - "id": 4 - }, - "continuousBackupSource": { - "type": "ContinuousBackupSource", - "id": 8 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "view": { - "type": "InstanceView", - "id": 2 - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateSecondaryInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateInstanceRequests": { - "fields": { - "createInstanceRequests": { - "rule": "repeated", - "type": "CreateInstanceRequest", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "requests": { - "type": "CreateInstanceRequests", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchCreateInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - } - } - }, - "BatchCreateInstancesMetadata": { - "fields": { - "instanceTargets": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "instanceStatuses": { - "keyType": "string", - "type": "BatchCreateInstanceStatus", - "id": 2 - } - } - }, - "BatchCreateInstanceStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "errorMsg": { - "type": "string", - "id": 2 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "type": { - "type": "Instance.InstanceType", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING_CREATE": 1, - "READY": 2, - "CREATING": 3, - "DELETING": 4, - "FAILED": 5, - "ROLLED_BACK": 6 - } - } - } - }, - "UpdateInstanceRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instance": { - "type": "Instance", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FailoverInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InjectFaultRequest": { - "fields": { - "faultType": { - "type": "FaultType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "FaultType": { - "values": { - "FAULT_TYPE_UNSPECIFIED": 0, - "STOP_VM": 1 - } - } - } - }, - "RestartInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteSqlRequest": { - "oneofs": { - "userCredential": { - "oneof": [ - "password" - ] - } - }, - "fields": { - "password": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instance": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sqlStatement": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteSqlResponse": { - "fields": { - "sqlResults": { - "rule": "repeated", - "type": "SqlResult", - "id": 1 - }, - "metadata": { - "type": "ExecuteSqlMetadata", - "id": 3 - } - } - }, - "ExecuteSqlMetadata": { - "fields": { - "message": { - "type": "string", - "id": 1 - }, - "partialResult": { - "type": "bool", - "id": 2 - }, - "sqlStatementExecutionDuration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "status": { - "type": "Status", - "id": 4 - } - }, - "nested": { - "Status": { - "values": { - "STATUS_UNSPECIFIED": 0, - "OK": 1, - "PARTIAL": 2, - "ERROR": 3 - } - } - } - }, - "ListBackupsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5 - } - } - }, - "ListBackupsResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - } - } - }, - "CreateBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "Backup", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "backup": { - "type": "Backup", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSupportedDatabaseFlagsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/SupportedDatabaseFlag" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "scope": { - "type": "SupportedDatabaseFlag.Scope", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSupportedDatabaseFlagsResponse": { - "fields": { - "supportedDatabaseFlags": { - "rule": "repeated", - "type": "SupportedDatabaseFlag", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GenerateClientCertificateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pemCsr": { - "type": "string", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "certDuration": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "publicKey": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "useMetadataExchange": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GenerateClientCertificateResponse": { - "fields": { - "pemCertificate": { - "type": "string", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "caCert": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetConnectionInfoRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "oneofs": { - "requestSpecific": { - "oneof": [ - "batchCreateInstancesMetadata", - "promoteClusterStatus", - "upgradeClusterStatus" - ] - } - }, - "fields": { - "batchCreateInstancesMetadata": { - "type": "BatchCreateInstancesMetadata", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "promoteClusterStatus": { - "type": "PromoteClusterStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "upgradeClusterStatus": { - "type": "UpgradeClusterStatus", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PromoteClusterStatus": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": 1, - "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": 2, - "PROMOTE_CLUSTER_COMPLETED": 3 - } - } - } - }, - "UpgradeClusterStatus": { - "fields": { - "state": { - "type": "UpgradeClusterResponse.Status", - "id": 1 - }, - "cancellable": { - "type": "bool", - "id": 2 - }, - "sourceVersion": { - "type": "DatabaseVersion", - "id": 3 - }, - "targetVersion": { - "type": "DatabaseVersion", - "id": 4 - }, - "stages": { - "rule": "repeated", - "type": "StageStatus", - "id": 5 - } - }, - "nested": { - "StageStatus": { - "oneofs": { - "stageSpecificStatus": { - "oneof": [ - "readPoolInstancesUpgrade" - ] - } - }, - "fields": { - "readPoolInstancesUpgrade": { - "type": "ReadPoolInstancesUpgradeStageStatus", - "id": 11 - }, - "stage": { - "type": "UpgradeClusterResponse.Stage", - "id": 1 - }, - "state": { - "type": "UpgradeClusterResponse.Status", - "id": 2 - }, - "schedule": { - "type": "StageSchedule", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "StageSchedule": { - "fields": { - "estimatedStartTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "actualStartTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "estimatedEndTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "actualEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - } - } - }, - "ReadPoolInstancesUpgradeStageStatus": { - "fields": { - "upgradeStats": { - "type": "Stats", - "id": 1 - } - }, - "nested": { - "Stats": { - "fields": { - "notStarted": { - "type": "int32", - "id": 1 - }, - "ongoing": { - "type": "int32", - "id": 2 - }, - "success": { - "type": "int32", - "id": 3 - }, - "failed": { - "type": "int32", - "id": 4 - } - } - } - } - } - } - }, - "ListUsersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListUsersResponse": { - "fields": { - "users": { - "rule": "repeated", - "type": "User", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/User" - } - } - } - }, - "CreateUserRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" - } - }, - "userId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "User", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateUserRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "User", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/User" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDatabasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDatabasesResponse": { - "fields": { - "databases": { - "rule": "repeated", - "type": "Database", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateDatabaseRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" - } - }, - "databaseId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "database": { - "type": "Database", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SqlResult": { - "fields": { - "columns": { - "rule": "repeated", - "type": "SqlResultColumn", - "id": 1 - }, - "rows": { - "rule": "repeated", - "type": "SqlResultRow", - "id": 2 - } - } - }, - "SqlResultColumn": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - } - } - }, - "SqlResultRow": { - "fields": { - "values": { - "rule": "repeated", - "type": "SqlResultValue", - "id": 1 - } - } - }, - "SqlResultValue": { - "oneofs": { - "_value": { - "oneof": [ - "value" - ] - }, - "_nullValue": { - "oneof": [ - "nullValue" - ] - } - }, - "fields": { - "value": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "nullValue": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - }, - "v1beta": { - "options": { - "csharp_namespace": "Google.Cloud.AlloyDb.V1Beta", - "go_package": "cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb", - "java_multiple_files": true, - "java_outer_classname": "DataModelProto", - "java_package": "com.google.cloud.alloydb.v1beta", - "php_namespace": "Google\\Cloud\\AlloyDb\\V1beta", - "ruby_package": "Google::Cloud::AlloyDB::V1beta", - "(google.api.resource_definition).type": "compute.googleapis.com/ServiceAttachment", - "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" - }, - "nested": { - "CloudSQLBackupRunSource": { - "fields": { - "project": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupRunId": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AlloyDBCSQLAdmin": { - "options": { - "(google.api.default_host)": "alloydb.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "RestoreFromCloudSQL": { - "requestType": "RestoreFromCloudSQLRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - } - } - }, - "RestoreFromCloudSQLRequest": { - "oneofs": { - "source": { - "oneof": [ - "cloudsqlBackupRunSource" - ] - } - }, - "fields": { - "cloudsqlBackupRunSource": { - "type": "CloudSQLBackupRunSource", - "id": 101 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "InstanceView": { - "values": { - "INSTANCE_VIEW_UNSPECIFIED": 0, - "INSTANCE_VIEW_BASIC": 1, - "INSTANCE_VIEW_FULL": 2 - } - }, - "ClusterView": { - "values": { - "CLUSTER_VIEW_UNSPECIFIED": 0, - "CLUSTER_VIEW_BASIC": 1, - "CLUSTER_VIEW_CONTINUOUS_BACKUP": 2 - } - }, - "DatabaseVersion": { - "valuesOptions": { - "POSTGRES_13": { - "deprecated": true - } - }, - "values": { - "DATABASE_VERSION_UNSPECIFIED": 0, - "POSTGRES_13": 1, - "POSTGRES_14": 2, - "POSTGRES_15": 3, - "POSTGRES_16": 4, - "POSTGRES_17": 5, - "POSTGRES_18": 6 - } - }, - "SubscriptionType": { - "values": { - "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, - "STANDARD": 1, - "TRIAL": 2 - } - }, - "UserPassword": { - "fields": { - "user": { - "type": "string", - "id": 1 - }, - "password": { - "type": "string", - "id": 2 - } - } - }, - "MigrationSource": { - "fields": { - "hostPort": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "referenceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceType": { - "type": "MigrationSourceType", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "MigrationSourceType": { - "values": { - "MIGRATION_SOURCE_TYPE_UNSPECIFIED": 0, - "DMS": 1 - } - } - } - }, - "EncryptionConfig": { - "fields": { - "kmsKeyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "EncryptionInfo": { - "fields": { - "encryptionType": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "GOOGLE_DEFAULT_ENCRYPTION": 1, - "CUSTOMER_MANAGED_ENCRYPTION": 2 - } - } - } - }, - "SslConfig": { - "fields": { - "sslMode": { - "type": "SslMode", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "caSource": { - "type": "CaSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SslMode": { - "valuesOptions": { - "SSL_MODE_ALLOW": { - "deprecated": true - }, - "SSL_MODE_REQUIRE": { - "deprecated": true - }, - "SSL_MODE_VERIFY_CA": { - "deprecated": true - } - }, - "values": { - "SSL_MODE_UNSPECIFIED": 0, - "SSL_MODE_ALLOW": 1, - "SSL_MODE_REQUIRE": 2, - "SSL_MODE_VERIFY_CA": 3, - "ALLOW_UNENCRYPTED_AND_ENCRYPTED": 4, - "ENCRYPTED_ONLY": 5 - } - }, - "CaSource": { - "values": { - "CA_SOURCE_UNSPECIFIED": 0, - "CA_SOURCE_MANAGED": 1 - } - } - } - }, - "AutomatedBackupPolicy": { - "oneofs": { - "schedule": { - "oneof": [ - "weeklySchedule" - ] - }, - "retention": { - "oneof": [ - "timeBasedRetention", - "quantityBasedRetention" - ] - }, - "_enabled": { - "oneof": [ - "enabled" - ] - } - }, - "fields": { - "weeklySchedule": { - "type": "WeeklySchedule", - "id": 2 - }, - "timeBasedRetention": { - "type": "TimeBasedRetention", - "id": 4 - }, - "quantityBasedRetention": { - "type": "QuantityBasedRetention", - "id": 5 - }, - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "backupWindow": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "location": { - "type": "string", - "id": 6 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - } - }, - "nested": { - "WeeklySchedule": { - "fields": { - "startTimes": { - "rule": "repeated", - "type": "google.type.TimeOfDay", - "id": 1 - }, - "daysOfWeek": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 2 - } - } - }, - "TimeBasedRetention": { - "fields": { - "retentionPeriod": { - "type": "google.protobuf.Duration", - "id": 1 - } - } - }, - "QuantityBasedRetention": { - "fields": { - "count": { - "type": "int32", - "id": 1 - } - } - } - } - }, - "ContinuousBackupConfig": { - "oneofs": { - "_enabled": { - "oneof": [ - "enabled" - ] - } - }, - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "recoveryWindowDays": { - "type": "int32", - "id": 4 - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 3 - } - } - }, - "ContinuousBackupInfo": { - "fields": { - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enabledTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "schedule": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "earliestRestorableTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupSource": { - "fields": { - "backupUid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - } - } - }, - "ContinuousBackupSource": { - "fields": { - "cluster": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pointInTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "MaintenanceUpdatePolicy": { - "fields": { - "maintenanceWindows": { - "rule": "repeated", - "type": "MaintenanceWindow", - "id": 1 - }, - "denyMaintenancePeriods": { - "rule": "repeated", - "type": "DenyMaintenancePeriod", - "id": 2 - } - }, - "nested": { - "MaintenanceWindow": { - "fields": { - "day": { - "type": "google.type.DayOfWeek", - "id": 1 - }, - "startTime": { - "type": "google.type.TimeOfDay", - "id": 2 - } - } - }, - "DenyMaintenancePeriod": { - "fields": { - "startDate": { - "type": "google.type.Date", - "id": 1 - }, - "endDate": { - "type": "google.type.Date", - "id": 2 - }, - "time": { - "type": "google.type.TimeOfDay", - "id": 3 - } - } - } - } - }, - "MaintenanceSchedule": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Cluster": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Cluster", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", - "(google.api.resource).plural": "clusters", - "(google.api.resource).singular": "cluster", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "migrationSource", - "cloudsqlBackupRunSource" - ] - } - }, - "fields": { - "backupSource": { - "type": "BackupSource", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "migrationSource": { - "type": "MigrationSource", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudsqlBackupRunSource": { - "type": "CloudSQLBackupRunSource", - "id": 42, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterType": { - "type": "ClusterType", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkConfig": { - "type": "NetworkConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "network": { - "type": "string", - "id": 10, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "etag": { - "type": "string", - "id": 11 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 12 - }, - "reconciling": { - "type": "bool", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "initialUser": { - "type": "UserPassword", - "id": 14, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "automatedBackupPolicy": { - "type": "AutomatedBackupPolicy", - "id": 17 - }, - "sslConfig": { - "type": "SslConfig", - "id": 18, - "options": { - "deprecated": true - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "continuousBackupConfig": { - "type": "ContinuousBackupConfig", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "continuousBackupInfo": { - "type": "ContinuousBackupInfo", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "secondaryConfig": { - "type": "SecondaryConfig", - "id": 22 - }, - "primaryConfig": { - "type": "PrimaryConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscConfig": { - "type": "PscConfig", - "id": 31, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceUpdatePolicy": { - "type": "MaintenanceUpdatePolicy", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceSchedule": { - "type": "MaintenanceSchedule", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "geminiConfig": { - "type": "GeminiClusterConfig", - "id": 36, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subscriptionType": { - "type": "SubscriptionType", - "id": 38, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trialMetadata": { - "type": "TrialMetadata", - "id": 39, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "tags": { - "keyType": "string", - "type": "string", - "id": 41, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccountEmail": { - "type": "string", - "id": 46, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataplexConfig": { - "type": "DataplexConfig", - "id": 47, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "NetworkConfig": { - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "allocatedIpRange": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SecondaryConfig": { - "fields": { - "primaryClusterName": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - } - } - }, - "PrimaryConfig": { - "fields": { - "secondaryClusterNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - } - } - }, - "PscConfig": { - "fields": { - "pscEnabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceOwnedProjectNumber": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TrialMetadata": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "upgradeTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "graceEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - }, - "DataplexConfig": { - "fields": { - "enabled": { - "type": "bool", - "id": 1 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "STOPPED": 2, - "EMPTY": 3, - "CREATING": 4, - "DELETING": 5, - "FAILED": 6, - "BOOTSTRAPPING": 7, - "MAINTENANCE": 8, - "PROMOTING": 9 - } - }, - "ClusterType": { - "values": { - "CLUSTER_TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "SECONDARY": 2 - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "state": { - "type": "State", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceType": { - "type": "InstanceType", - "id": 9, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "machineConfig": { - "type": "MachineConfig", - "id": 10 - }, - "availabilityType": { - "type": "AvailabilityType", - "id": 11 - }, - "gceZone": { - "type": "string", - "id": 12 - }, - "databaseFlags": { - "keyType": "string", - "type": "string", - "id": 13 - }, - "writableNode": { - "type": "Node", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodes": { - "rule": "repeated", - "type": "Node", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "queryInsightsConfig": { - "type": "QueryInsightsInstanceConfig", - "id": 21 - }, - "observabilityConfig": { - "type": "ObservabilityInstanceConfig", - "id": 26 - }, - "readPoolConfig": { - "type": "ReadPoolConfig", - "id": 14 - }, - "ipAddress": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicIpAddress": { - "type": "string", - "id": 27, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 17 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 18 - }, - "updatePolicy": { - "type": "UpdatePolicy", - "id": 22 - }, - "clientConnectionConfig": { - "type": "ClientConnectionConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscInstanceConfig": { - "type": "PscInstanceConfig", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkConfig": { - "type": "InstanceNetworkConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "geminiConfig": { - "type": "GeminiInstanceConfig", - "id": 33, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outboundPublicIpAddresses": { - "rule": "repeated", - "type": "string", - "id": 34, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "activationPolicy": { - "type": "ActivationPolicy", - "id": 35, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "connectionPoolConfig": { - "type": "ConnectionPoolConfig", - "id": 37, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcaConfig": { - "type": "GCAInstanceConfig", - "id": 38, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "MachineConfig": { - "fields": { - "cpuCount": { - "type": "int32", - "id": 1 - }, - "machineType": { - "type": "string", - "id": 4 - } - } - }, - "Node": { - "fields": { - "zoneId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "id": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ip": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "QueryInsightsInstanceConfig": { - "oneofs": { - "_recordApplicationTags": { - "oneof": [ - "recordApplicationTags" - ] - }, - "_recordClientAddress": { - "oneof": [ - "recordClientAddress" - ] - }, - "_queryPlansPerMinute": { - "oneof": [ - "queryPlansPerMinute" - ] - } - }, - "fields": { - "recordApplicationTags": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "recordClientAddress": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "queryStringLength": { - "type": "uint32", - "id": 4 - }, - "queryPlansPerMinute": { - "type": "uint32", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "ObservabilityInstanceConfig": { - "oneofs": { - "_enabled": { - "oneof": [ - "enabled" - ] - }, - "_preserveComments": { - "oneof": [ - "preserveComments" - ] - }, - "_trackWaitEvents": { - "oneof": [ - "trackWaitEvents" - ] - }, - "_trackWaitEventTypes": { - "oneof": [ - "trackWaitEventTypes" - ] - }, - "_maxQueryStringLength": { - "oneof": [ - "maxQueryStringLength" - ] - }, - "_recordApplicationTags": { - "oneof": [ - "recordApplicationTags" - ] - }, - "_queryPlansPerMinute": { - "oneof": [ - "queryPlansPerMinute" - ] - }, - "_trackActiveQueries": { - "oneof": [ - "trackActiveQueries" - ] - }, - "_trackClientAddress": { - "oneof": [ - "trackClientAddress" - ] - }, - "_assistiveExperiencesEnabled": { - "oneof": [ - "assistiveExperiencesEnabled" - ] - } - }, - "fields": { - "enabled": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "preserveComments": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "trackWaitEvents": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "trackWaitEventTypes": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "maxQueryStringLength": { - "type": "int32", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "recordApplicationTags": { - "type": "bool", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "queryPlansPerMinute": { - "type": "int32", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "trackActiveQueries": { - "type": "bool", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "trackClientAddress": { - "type": "bool", - "id": 9, - "options": { - "proto3_optional": true - } - }, - "assistiveExperiencesEnabled": { - "type": "bool", - "id": 10, - "options": { - "proto3_optional": true - } - } - } - }, - "ReadPoolConfig": { - "fields": { - "nodeCount": { - "type": "int32", - "id": 1 - } - } - }, - "UpdatePolicy": { - "fields": { - "mode": { - "type": "Mode", - "id": 1 - } - }, - "nested": { - "Mode": { - "values": { - "MODE_UNSPECIFIED": 0, - "DEFAULT": 1, - "FORCE_APPLY": 2 - } - } - } - }, - "ClientConnectionConfig": { - "fields": { - "requireConnectors": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sslConfig": { - "type": "SslConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PscInterfaceConfig": { - "fields": { - "networkAttachmentResource": { - "type": "string", - "id": 1 - } - } - }, - "PscAutoConnectionConfig": { - "fields": { - "consumerProject": { - "type": "string", - "id": 1 - }, - "consumerNetwork": { - "type": "string", - "id": 2 - }, - "ipAddress": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "consumerNetworkStatus": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PscInstanceConfig": { - "fields": { - "serviceAttachmentLink": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/ServiceAttachment" - } - }, - "allowedConsumerProjects": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscDnsName": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscInterfaceConfigs": { - "rule": "repeated", - "type": "PscInterfaceConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscAutoConnections": { - "rule": "repeated", - "type": "PscAutoConnectionConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceNetworkConfig": { - "fields": { - "authorizedExternalNetworks": { - "rule": "repeated", - "type": "AuthorizedNetwork", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enablePublicIp": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableOutboundPublicIp": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "network": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } - }, - "allocatedIpRangeOverride": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AuthorizedNetwork": { - "fields": { - "cidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4" - } - } - } - } - } - }, - "ConnectionPoolConfig": { - "fields": { - "enabled": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "flags": { - "keyType": "string", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "poolerCount": { - "type": "int32", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "STOPPED": 2, - "CREATING": 3, - "DELETING": 4, - "MAINTENANCE": 5, - "FAILED": 6, - "BOOTSTRAPPING": 8, - "PROMOTING": 9 - } - }, - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "READ_POOL": 2, - "SECONDARY": 3 - } - }, - "AvailabilityType": { - "values": { - "AVAILABILITY_TYPE_UNSPECIFIED": 0, - "ZONAL": 1, - "REGIONAL": 2 - } - }, - "ActivationPolicy": { - "values": { - "ACTIVATION_POLICY_UNSPECIFIED": 0, - "ALWAYS": 1, - "NEVER": 2 - } - } - } - }, - "ConnectionInfo": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", - "(google.api.resource).plural": "connectionInfos", - "(google.api.resource).singular": "connectionInfo" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "ipAddress": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "publicIpAddress": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceUid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pscDnsName": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Backup": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Backup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}", - "(google.api.resource).plural": "backups", - "(google.api.resource).singular": "backup", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createCompletionTime": { - "type": "google.protobuf.Timestamp", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "Type", - "id": 8 - }, - "description": { - "type": "string", - "id": 9 - }, - "clusterUid": { - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "reconciling": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionInfo": { - "type": "EncryptionInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 14 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 16 - }, - "sizeBytes": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expiryTime": { - "type": "google.protobuf.Timestamp", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expiryQuantity": { - "type": "QuantityBasedExpiry", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "tags": { - "keyType": "string", - "type": "string", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "QuantityBasedExpiry": { - "fields": { - "retentionCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "totalRetentionCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "READY": 1, - "CREATING": 2, - "FAILED": 3, - "DELETING": 4 - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ON_DEMAND": 1, - "AUTOMATED": 2, - "CONTINUOUS": 3 - } - } - } - }, - "SupportedDatabaseFlag": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", - "(google.api.resource).plural": "supportedDatabaseFlags", - "(google.api.resource).singular": "supportedDatabaseFlag" - }, - "oneofs": { - "restrictions": { - "oneof": [ - "stringRestrictions", - "integerRestrictions" - ] - }, - "recommendedValue": { - "oneof": [ - "recommendedStringValue", - "recommendedIntegerValue" - ] - } - }, - "fields": { - "stringRestrictions": { - "type": "StringRestrictions", - "id": 7 - }, - "integerRestrictions": { - "type": "IntegerRestrictions", - "id": 8 - }, - "recommendedStringValue": { - "type": "string", - "id": 10 - }, - "recommendedIntegerValue": { - "type": "google.protobuf.Int64Value", - "id": 11 - }, - "name": { - "type": "string", - "id": 1 - }, - "flagName": { - "type": "string", - "id": 2 - }, - "valueType": { - "type": "ValueType", - "id": 3 - }, - "acceptsMultipleValues": { - "type": "bool", - "id": 4 - }, - "supportedDbVersions": { - "rule": "repeated", - "type": "DatabaseVersion", - "id": 5 - }, - "requiresDbRestart": { - "type": "bool", - "id": 6 - }, - "scope": { - "type": "Scope", - "id": 9 - } - }, - "nested": { - "StringRestrictions": { - "fields": { - "allowedValues": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "IntegerRestrictions": { - "fields": { - "minValue": { - "type": "google.protobuf.Int64Value", - "id": 1 - }, - "maxValue": { - "type": "google.protobuf.Int64Value", - "id": 2 - } - } - }, - "ValueType": { - "values": { - "VALUE_TYPE_UNSPECIFIED": 0, - "STRING": 1, - "INTEGER": 2, - "FLOAT": 3, - "NONE": 4 - } - }, - "Scope": { - "values": { - "SCOPE_UNSPECIFIED": 0, - "DATABASE": 1, - "CONNECTION_POOL": 2 - } - } - } - }, - "User": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/User", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/users/{user}", - "(google.api.resource).plural": "users", - "(google.api.resource).singular": "user", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "password": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "databaseRoles": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "userType": { - "type": "UserType", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "keepExtraRoles": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - } - }, - "nested": { - "UserType": { - "values": { - "USER_TYPE_UNSPECIFIED": 0, - "ALLOYDB_BUILT_IN": 1, - "ALLOYDB_IAM_USER": 2 - } - } - } - }, - "Database": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Database", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}", - "(google.api.resource).plural": "databases", - "(google.api.resource).singular": "database", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_isTemplateDatabase": { - "oneof": [ - "isTemplateDatabase" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "charset": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "collation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "characterType": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "isTemplate": { - "type": "bool", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "databaseTemplate": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "isTemplateDatabase": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "GCAEntitlementType": { - "values": { - "GCA_ENTITLEMENT_TYPE_UNSPECIFIED": 0, - "GCA_STANDARD": 1 - } - }, - "GeminiClusterConfig": { - "fields": { - "entitled": { - "type": "bool", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GeminiInstanceConfig": { - "fields": { - "entitled": { - "type": "bool", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GCAInstanceConfig": { - "fields": { - "gcaEntitlement": { - "type": "GCAEntitlementType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "AlloyDBAdmin": { - "options": { - "(google.api.default_host)": "alloydb.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListClusters": { - "requestType": "ListClustersRequest", - "responseType": "ListClustersResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/clusters", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*}/clusters" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetCluster": { - "requestType": "GetClusterRequest", - "responseType": "Cluster", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/clusters/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateCluster": { - "requestType": "CreateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "parent,cluster,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/clusters", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "parent,cluster,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateCluster": { - "requestType": "UpdateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "cluster,update_mask", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{cluster.name=projects/*/locations/*/clusters/*}", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "cluster,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExportCluster": { - "requestType": "ExportClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:export", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options", - "(google.longrunning.operation_info).response_type": "ExportClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:export", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,gcs_destination,database,csv_export_options,sql_export_options" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ExportClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ImportCluster": { - "requestType": "ImportClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:import", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,gcs_uri,database,user", - "(google.longrunning.operation_info).response_type": "ImportClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:import", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,gcs_uri,database,user" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpgradeCluster": { - "requestType": "UpgradeClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,version", - "(google.longrunning.operation_info).response_type": "UpgradeClusterResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "UpgradeClusterResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteCluster": { - "requestType": "DeleteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/clusters/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "PromoteCluster": { - "requestType": "PromoteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:promote", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:promote", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "SwitchoverCluster": { - "requestType": "SwitchoverClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*}:switchover", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*}:switchover", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestoreCluster": { - "requestType": "RestoreClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters:restore", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/clusters:restore", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateSecondaryCluster": { - "requestType": "CreateSecondaryClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "parent,cluster,cluster_id", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "parent,cluster,cluster_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "parent,instance,instance_id", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "parent,instance,instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateSecondaryInstance": { - "requestType": "CreateSecondaryInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "parent,instance,instance_id", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:createsecondary", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "parent,instance,instance_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "BatchCreateInstances": { - "requestType": "BatchCreateInstancesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", - "(google.api.http).body": "requests", - "(google.longrunning.operation_info).response_type": "BatchCreateInstancesResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/instances:batchCreate", - "body": "requests" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchCreateInstancesResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateInstance": { - "requestType": "UpdateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.http).body": "instance", - "(google.api.method_signature)": "instance,update_mask", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{instance.name=projects/*/locations/*/clusters/*/instances/*}", - "body": "instance" - } - }, - { - "(google.api.method_signature)": "instance,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "FailoverInstance": { - "requestType": "FailoverInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:failover", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "InjectFault": { - "requestType": "InjectFaultRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", - "(google.api.http).body": "*", - "(google.api.method_signature)": "fault_type,name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:injectFault", - "body": "*" - } - }, - { - "(google.api.method_signature)": "fault_type,name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestartInstance": { - "requestType": "RestartInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{name=projects/*/locations/*/clusters/*/instances/*}:restart", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ExecuteSql": { - "requestType": "ExecuteSqlRequest", - "responseType": "ExecuteSqlResponse", - "options": { - "(google.api.http).post": "/v1beta/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", - "(google.api.http).body": "*", - "(google.api.method_signature)": "instance,database,user,sql_statement,password" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{instance=projects/*/locations/*/clusters/*/instances/*}:executeSql", - "body": "*" - } - }, - { - "(google.api.method_signature)": "instance,database,user,sql_statement,password" - } - ] - }, - "ListBackups": { - "requestType": "ListBackupsRequest", - "responseType": "ListBackupsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/backups", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*}/backups" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetBackup": { - "requestType": "GetBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateBackup": { - "requestType": "CreateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/backups", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "parent,backup,backup_id", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*}/backups", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "parent,backup,backup_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateBackup": { - "requestType": "UpdateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta/{backup.name=projects/*/locations/*/backups/*}", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "backup,update_mask", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{backup.name=projects/*/locations/*/backups/*}", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "backup,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/backups/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListSupportedDatabaseFlags": { - "requestType": "ListSupportedDatabaseFlagsRequest", - "responseType": "ListSupportedDatabaseFlagsResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GenerateClientCertificate": { - "requestType": "GenerateClientCertificateRequest", - "responseType": "GenerateClientCertificateResponse", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetConnectionInfo": { - "requestType": "GetConnectionInfoRequest", - "responseType": "ConnectionInfo", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListUsers": { - "requestType": "ListUsersRequest", - "responseType": "ListUsersResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetUser": { - "requestType": "GetUserRequest", - "responseType": "User", - "options": { - "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateUser": { - "requestType": "CreateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", - "(google.api.http).body": "user", - "(google.api.method_signature)": "parent,user,user_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/users", - "body": "user" - } - }, - { - "(google.api.method_signature)": "parent,user,user_id" - } - ] - }, - "UpdateUser": { - "requestType": "UpdateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).patch": "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.http).body": "user", - "(google.api.method_signature)": "user,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}", - "body": "user" - } - }, - { - "(google.api.method_signature)": "user,update_mask" - } - ] - }, - "DeleteUser": { - "requestType": "DeleteUserRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta/{name=projects/*/locations/*/clusters/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDatabases": { - "requestType": "ListDatabasesRequest", - "responseType": "ListDatabasesResponse", - "options": { - "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateDatabase": { - "requestType": "CreateDatabaseRequest", - "responseType": "Database", - "options": { - "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases", - "(google.api.http).body": "database", - "(google.api.method_signature)": "parent,database,database_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta/{parent=projects/*/locations/*/clusters/*}/databases", - "body": "database" - } - }, - { - "(google.api.method_signature)": "parent,database,database_id" - } - ] - } - } - }, - "ListClustersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListClustersResponse": { - "fields": { - "clusters": { - "rule": "repeated", - "type": "Cluster", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "view": { - "type": "ClusterView", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateSecondaryClusterRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateClusterRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateClusterRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cluster": { - "type": "Cluster", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GcsDestination": { - "fields": { - "uri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ExportClusterRequest": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - }, - "exportOptions": { - "oneof": [ - "csvExportOptions", - "sqlExportOptions" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "csvExportOptions": { - "type": "CsvExportOptions", - "id": 4 - }, - "sqlExportOptions": { - "type": "SqlExportOptions", - "id": 5 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "database": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "CsvExportOptions": { - "fields": { - "selectQuery": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fieldDelimiter": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quoteCharacter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "escapeCharacter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SqlExportOptions": { - "oneofs": { - "_schemaOnly": { - "oneof": [ - "schemaOnly" - ] - }, - "_cleanTargetObjects": { - "oneof": [ - "cleanTargetObjects" - ] - }, - "_ifExistTargetObjects": { - "oneof": [ - "ifExistTargetObjects" - ] - } - }, - "fields": { - "tables": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schemaOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "cleanTargetObjects": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ifExistTargetObjects": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - }, - "ExportClusterResponse": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ImportClusterRequest": { - "oneofs": { - "importOptions": { - "oneof": [ - "sqlImportOptions", - "csvImportOptions" - ] - } - }, - "fields": { - "sqlImportOptions": { - "type": "SqlImportOptions", - "id": 4 - }, - "csvImportOptions": { - "type": "CsvImportOptions", - "id": 7 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "gcsUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "database": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SqlImportOptions": { - "fields": {} - }, - "CsvImportOptions": { - "fields": { - "table": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "columns": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fieldDelimiter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quoteCharacter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "escapeCharacter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ImportClusterResponse": { - "fields": { - "bytesDownloaded": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpgradeClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "version": { - "type": "DatabaseVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpgradeClusterResponse": { - "fields": { - "status": { - "type": "Status", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "clusterUpgradeDetails": { - "rule": "repeated", - "type": "ClusterUpgradeDetails", - "id": 3 - } - }, - "nested": { - "StageInfo": { - "fields": { - "stage": { - "type": "Stage", - "id": 1 - }, - "status": { - "type": "Status", - "id": 2 - }, - "logsUrl": { - "type": "string", - "id": 3 - } - } - }, - "InstanceUpgradeDetails": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "upgradeStatus": { - "type": "Status", - "id": 2 - }, - "instanceType": { - "type": "Instance.InstanceType", - "id": 3 - } - } - }, - "ClusterUpgradeDetails": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "upgradeStatus": { - "type": "Status", - "id": 2 - }, - "clusterType": { - "type": "Cluster.ClusterType", - "id": 3 - }, - "databaseVersion": { - "type": "DatabaseVersion", - "id": 4 - }, - "stageInfo": { - "rule": "repeated", - "type": "StageInfo", - "id": 5 - }, - "instanceUpgradeDetails": { - "rule": "repeated", - "type": "InstanceUpgradeDetails", - "id": 6 - } - } - }, - "Status": { - "values": { - "STATUS_UNSPECIFIED": 0, - "NOT_STARTED": 4, - "IN_PROGRESS": 5, - "SUCCESS": 1, - "FAILED": 2, - "PARTIAL_SUCCESS": 3, - "CANCEL_IN_PROGRESS": 6, - "CANCELLED": 7 - } - }, - "Stage": { - "values": { - "STAGE_UNSPECIFIED": 0, - "ALLOYDB_PRECHECK": 1, - "PG_UPGRADE_CHECK": 2, - "PREPARE_FOR_UPGRADE": 5, - "PRIMARY_INSTANCE_UPGRADE": 3, - "READ_POOL_INSTANCES_UPGRADE": 4, - "ROLLBACK": 6, - "CLEANUP": 7 - } - } - } - }, - "DeleteClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "force": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SwitchoverClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PromoteClusterRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RestoreClusterRequest": { - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "continuousBackupSource" - ] - } - }, - "fields": { - "backupSource": { - "type": "BackupSource", - "id": 4 - }, - "continuousBackupSource": { - "type": "ContinuousBackupSource", - "id": 8 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Cluster" - } - }, - "clusterId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "view": { - "type": "InstanceView", - "id": 2 - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateSecondaryInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "instanceId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instance": { - "type": "Instance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateInstanceRequests": { - "fields": { - "createInstanceRequests": { - "rule": "repeated", - "type": "CreateInstanceRequest", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchCreateInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Instance" - } - }, - "requests": { - "type": "CreateInstanceRequests", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchCreateInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - } - } - }, - "BatchCreateInstancesMetadata": { - "fields": { - "instanceTargets": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "instanceStatuses": { - "keyType": "string", - "type": "BatchCreateInstanceStatus", - "id": 2 - } - } - }, - "BatchCreateInstanceStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "errorMsg": { - "type": "string", - "id": 2 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "type": { - "type": "Instance.InstanceType", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING_CREATE": 1, - "READY": 2, - "CREATING": 3, - "DELETING": 4, - "FAILED": 5, - "ROLLED_BACK": 6 - } - } - } - }, - "UpdateInstanceRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instance": { - "type": "Instance", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FailoverInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InjectFaultRequest": { - "fields": { - "faultType": { - "type": "FaultType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "FaultType": { - "values": { - "FAULT_TYPE_UNSPECIFIED": 0, - "STOP_VM": 1 - } - } - } - }, - "RestartInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeIds": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteSqlRequest": { - "oneofs": { - "userCredential": { - "oneof": [ - "password" - ] - } - }, - "fields": { - "password": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instance": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "database": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sqlStatement": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecuteSqlResponse": { - "fields": { - "sqlResults": { - "rule": "repeated", - "type": "SqlResult", - "id": 1 - }, - "metadata": { - "type": "ExecuteSqlMetadata", - "id": 3 - } - } - }, - "ExecuteSqlMetadata": { - "fields": { - "message": { - "type": "string", - "id": 1 - }, - "partialResult": { - "type": "bool", - "id": 2 - }, - "sqlStatementExecutionDuration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "status": { - "type": "Status", - "id": 4 - } - }, - "nested": { - "Status": { - "values": { - "STATUS_UNSPECIFIED": 0, - "OK": 1, - "PARTIAL": 2, - "ERROR": 3 - } - } - } - }, - "ListBackupsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5 - } - } - }, - "ListBackupsResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - } - } - }, - "CreateBackupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Backup" - } - }, - "backupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "Backup", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "backup": { - "type": "Backup", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Backup" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSupportedDatabaseFlagsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/SupportedDatabaseFlag" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "scope": { - "type": "SupportedDatabaseFlag.Scope", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSupportedDatabaseFlagsResponse": { - "fields": { - "supportedDatabaseFlags": { - "rule": "repeated", - "type": "SupportedDatabaseFlag", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GenerateClientCertificateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Cluster" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pemCsr": { - "type": "string", - "id": 3, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "certDuration": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "publicKey": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "useMetadataExchange": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GenerateClientCertificateResponse": { - "fields": { - "pemCertificate": { - "type": "string", - "id": 1, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pemCertificateChain": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "caCert": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetConnectionInfoRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/Instance" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "oneofs": { - "requestSpecific": { - "oneof": [ - "batchCreateInstancesMetadata", - "promoteClusterStatus", - "upgradeClusterStatus" - ] - } - }, - "fields": { - "batchCreateInstancesMetadata": { - "type": "BatchCreateInstancesMetadata", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "promoteClusterStatus": { - "type": "PromoteClusterStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "upgradeClusterStatus": { - "type": "UpgradeClusterStatus", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PromoteClusterStatus": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PROMOTE_CLUSTER_AVAILABLE_FOR_READ": 1, - "PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE": 2, - "PROMOTE_CLUSTER_COMPLETED": 3 - } - } - } - }, - "UpgradeClusterStatus": { - "fields": { - "state": { - "type": "UpgradeClusterResponse.Status", - "id": 1 - }, - "cancellable": { - "type": "bool", - "id": 2 - }, - "sourceVersion": { - "type": "DatabaseVersion", - "id": 3 - }, - "targetVersion": { - "type": "DatabaseVersion", - "id": 4 - }, - "stages": { - "rule": "repeated", - "type": "StageStatus", - "id": 5 - } - }, - "nested": { - "StageStatus": { - "oneofs": { - "stageSpecificStatus": { - "oneof": [ - "readPoolInstancesUpgrade" - ] - } - }, - "fields": { - "readPoolInstancesUpgrade": { - "type": "ReadPoolInstancesUpgradeStageStatus", - "id": 11 - }, - "stage": { - "type": "UpgradeClusterResponse.Stage", - "id": 1 - }, - "state": { - "type": "UpgradeClusterResponse.Status", - "id": 2 - }, - "schedule": { - "type": "StageSchedule", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "StageSchedule": { - "fields": { - "estimatedStartTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "actualStartTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "estimatedEndTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "actualEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - } - } - } - }, - "ReadPoolInstancesUpgradeStageStatus": { - "fields": { - "upgradeStats": { - "type": "Stats", - "id": 1 - } - }, - "nested": { - "Stats": { - "fields": { - "notStarted": { - "type": "int32", - "id": 1 - }, - "ongoing": { - "type": "int32", - "id": 2 - }, - "success": { - "type": "int32", - "id": 3 - }, - "failed": { - "type": "int32", - "id": 4 - } - } - } - } - } - } - }, - "ListUsersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListUsersResponse": { - "fields": { - "users": { - "rule": "repeated", - "type": "User", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/User" - } - } - } - }, - "CreateUserRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/User" - } - }, - "userId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "User", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateUserRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "User", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "alloydb.googleapis.com/User" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDatabasesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDatabasesResponse": { - "fields": { - "databases": { - "rule": "repeated", - "type": "Database", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CreateDatabaseRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "alloydb.googleapis.com/Database" - } - }, - "databaseId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "database": { - "type": "Database", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SqlResult": { - "fields": { - "columns": { - "rule": "repeated", - "type": "SqlResultColumn", - "id": 1 - }, - "rows": { - "rule": "repeated", - "type": "SqlResultRow", - "id": 2 - } - } - }, - "SqlResultColumn": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - } - } - }, - "SqlResultRow": { - "fields": { - "values": { - "rule": "repeated", - "type": "SqlResultValue", - "id": 1 - } - } - }, - "SqlResultValue": { - "oneofs": { - "_value": { - "oneof": [ - "value" - ] - }, - "_nullValue": { - "oneof": [ - "nullValue" - ] - } - }, - "fields": { - "value": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "nullValue": { - "type": "bool", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "FieldInfoProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", - "java_multiple_files": true, - "java_outer_classname": "TimeOfDayProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Date": { - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - } - } - }, - "DayOfWeek": { - "values": { - "DAY_OF_WEEK_UNSPECIFIED": 0, - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7 - } - }, - "TimeOfDay": { - "fields": { - "hours": { - "type": "int32", - "id": 1 - }, - "minutes": { - "type": "int32", - "id": 2 - }, - "seconds": { - "type": "int32", - "id": 3 - }, - "nanos": { - "type": "int32", - "id": 4 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js deleted file mode 100644 index 14fdd2d6902..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, requests) { - // [START alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. - */ - // const parent = 'abc123' - /** - * Required. Resources being created. - */ - // const requests = {} - /** - * 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). - */ - // const requestId = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callBatchCreateInstances() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const [operation] = await alloydbClient.batchCreateInstances(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchCreateInstances(); - // [END alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js deleted file mode 100644 index 760fff95db8..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, backupId, backup) { - // [START alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const backupId = 'abc123' - /** - * Required. The resource being created - */ - // const backup = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateBackup() { - // Construct request - const request = { - parent, - backupId, - backup, - }; - - // Run request - const [operation] = await alloydbClient.createBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackup(); - // [END alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js deleted file mode 100644 index b37cc9228a6..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.createCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js deleted file mode 100644 index e419bd6866e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, instanceId, instance) { - // [START alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const instanceId = 'abc123' - /** - * Required. The resource being created - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await alloydbClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js deleted file mode 100644 index a946db743aa..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object (the secondary cluster). - */ - // const clusterId = 'abc123' - /** - * Required. Configuration of the requesting object (the secondary cluster). - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateSecondaryCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.createSecondaryCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSecondaryCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js deleted file mode 100644 index 315c5e55034..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, instanceId, instance) { - // [START alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const instanceId = 'abc123' - /** - * Required. The resource being created - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateSecondaryInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await alloydbClient.createSecondaryInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSecondaryInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js deleted file mode 100644 index 838734b1305..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, userId, user) { - // [START alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const userId = 'abc123' - /** - * Required. The resource being created - */ - // const user = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateUser() { - // Construct request - const request = { - parent, - userId, - user, - }; - - // Run request - const response = await alloydbClient.createUser(request); - console.log(response); - } - - callCreateUser(); - // [END alloydb_v1_generated_AlloyDBAdmin_CreateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js deleted file mode 100644 index b26f0b653e6..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * 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. - */ - // const etag = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackup(); - // [END alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js deleted file mode 100644 index 61e770ea52d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * Optional. Whether to cascade delete child instances for given cluster. - */ - // const force = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js deleted file mode 100644 index eb1ecd7b41d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js deleted file mode 100644 index ec9646cf6d4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.deleteUser(request); - console.log(response); - } - - callDeleteUser(); - // [END alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js deleted file mode 100644 index 47dd7e0edce..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance, database, sqlStatement) { - // [START alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Optional. The database native user’s password. - */ - // const password = 'abc123' - /** - * Required. The instance where the SQL will be executed. For the required - * format, see the comment on the Instance.name field. - */ - // const instance = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - /** - * 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. - */ - // const user = 'abc123' - /** - * Required. SQL statement to execute on database. Any valid statement is - * permitted, including DDL, DML, DQL statements. - */ - // const sqlStatement = 'abc123' - /** - * Optional. If set, validates the sql statement by performing - * syntax and semantic validation and doesn't execute the query. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callExecuteSql() { - // Construct request - const request = { - instance, - database, - sqlStatement, - }; - - // Run request - const response = await alloydbClient.executeSql(request); - console.log(response); - } - - callExecuteSql(); - // [END alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js deleted file mode 100644 index 165c351dfd3..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.export_cluster.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(gcsDestination, name, database) { - // [START alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Option to export data to cloud storage. - */ - // const gcsDestination = {} - /** - * Options for exporting data in CSV format. Required field to be set for - * CSV file type. - */ - // const csvExportOptions = {} - /** - * Options for exporting data in SQL format. Required field to be set for - * SQL file type. - */ - // const sqlExportOptions = {} - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callExportCluster() { - // Construct request - const request = { - gcsDestination, - name, - database, - }; - - // Run request - const [operation] = await alloydbClient.exportCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callExportCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js deleted file mode 100644 index 8d94a7766b2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callFailoverInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.failoverInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callFailoverInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js deleted file mode 100644 index 5cd83fcbc1d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - */ - // const parent = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const certDuration = {} - /** - * Optional. The public key from the client. - */ - // const publicKey = 'abc123' - /** - * 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. - */ - // const useMetadataExchange = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGenerateClientCertificate() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await alloydbClient.generateClientCertificate(request); - console.log(response); - } - - callGenerateClientCertificate(); - // [END alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js deleted file mode 100644 index 1cadee19727..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_GetBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource - */ - // const name = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getBackup(request); - console.log(response); - } - - callGetBackup(); - // [END alloydb_v1_generated_AlloyDBAdmin_GetBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js deleted file mode 100644 index 27ebde91520..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const name = 'abc123' - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - */ - // const view = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js deleted file mode 100644 index 743cbd01f40..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - */ - // const parent = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetConnectionInfo() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await alloydbClient.getConnectionInfo(request); - console.log(response); - } - - callGetConnectionInfo(); - // [END alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js deleted file mode 100644 index 2efa79cc9e1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_GetInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * The view of the instance to return. - */ - // const view = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getInstance(request); - console.log(response); - } - - callGetInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js deleted file mode 100644 index 1e0af5a26ce..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_GetUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - */ - // const name = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getUser(request); - console.log(response); - } - - callGetUser(); - // [END alloydb_v1_generated_AlloyDBAdmin_GetUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js deleted file mode 100644 index a76cf483a6e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.import_cluster.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, gcsUri) { - // [START alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Options for importing data in SQL format. - */ - // const sqlImportOptions = {} - /** - * Options for importing data in CSV format. - */ - // const csvImportOptions = {} - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * 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`. - */ - // const gcsUri = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - /** - * 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. - */ - // const user = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callImportCluster() { - // Construct request - const request = { - name, - gcsUri, - }; - - // Run request - const [operation] = await alloydbClient.importCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callImportCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js deleted file mode 100644 index 70d6a910b25..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(faultType, name) { - // [START alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The type of fault to be injected in an instance. - */ - // const faultType = {} - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callInjectFault() { - // Construct request - const request = { - faultType, - name, - }; - - // Run request - const [operation] = await alloydbClient.injectFault(request); - const [response] = await operation.promise(); - console.log(response); - } - - callInjectFault(); - // [END alloydb_v1_generated_AlloyDBAdmin_InjectFault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js deleted file mode 100644 index 0a74f79be3a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_ListBackups_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListBackupsRequest - */ - // const parent = 'abc123' - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Filtering results - */ - // const filter = 'abc123' - /** - * Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListBackups() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listBackupsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackups(); - // [END alloydb_v1_generated_AlloyDBAdmin_ListBackups_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js deleted file mode 100644 index 449cf63db89..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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/- - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListClusters() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listClustersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListClusters(); - // [END alloydb_v1_generated_AlloyDBAdmin_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js deleted file mode 100644 index 0a8fc4e361d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListDatabasesRequest. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - */ - // const filter = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListDatabases() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listDatabasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDatabases(); - // [END alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js deleted file mode 100644 index 35533876ba2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_ListInstances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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/- - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListInstances() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listInstancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListInstances(); - // [END alloydb_v1_generated_AlloyDBAdmin_ListInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js deleted file mode 100644 index b84a98bd60c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const parent = 'abc123' - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - */ - // const scope = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListSupportedDatabaseFlags() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listSupportedDatabaseFlagsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSupportedDatabaseFlags(); - // [END alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js deleted file mode 100644 index 0ace79a7e47..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListUsersRequest - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListUsers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listUsersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsers(); - // [END alloydb_v1_generated_AlloyDBAdmin_ListUsers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js deleted file mode 100644 index b56f720c5ae..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callPromoteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.promoteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callPromoteCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js deleted file mode 100644 index ddcde70c47e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - * restart upon. Applicable only to read instances. - */ - // const nodeIds = ['abc','def'] - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callRestartInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.restartInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestartInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js deleted file mode 100644 index 92518a1665d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Backup source. - */ - // const backupSource = {} - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - */ - // const continuousBackupSource = {} - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callRestoreCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.restoreCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js deleted file mode 100644 index 2ea9bbf3f2a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callSwitchoverCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.switchoverCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSwitchoverCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js deleted file mode 100644 index a5e6fc1a857..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(backup) { - // [START alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const backup = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateBackup() { - // Construct request - const request = { - backup, - }; - - // Run request - const [operation] = await alloydbClient.updateBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackup(); - // [END alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js deleted file mode 100644 index 858582c25be..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(cluster) { - // [START alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - cluster, - }; - - // Run request - const [operation] = await alloydbClient.updateCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js deleted file mode 100644 index 66841c2650b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance) { - // [START alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateInstance() { - // Construct request - const request = { - instance, - }; - - // Run request - const [operation] = await alloydbClient.updateInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateInstance(); - // [END alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js deleted file mode 100644 index 1d85b36b1fc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(user) { - // [START alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const user = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * Optional. Allow missing fields in the update mask. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateUser() { - // Construct request - const request = { - user, - }; - - // Run request - const response = await alloydbClient.updateUser(request); - console.log(response); - } - - callUpdateUser(); - // [END alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js deleted file mode 100644 index 8c296fb49c9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, version) { - // [START alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * Required. The version the cluster is going to be upgraded to. - */ - // const version = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const etag = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpgradeCluster() { - // Construct request - const request = { - name, - version, - }; - - // Run request - const [operation] = await alloydbClient.upgradeCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpgradeCluster(); - // [END alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js deleted file mode 100644 index adf96182a3c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Cluster created from CloudSQL backup run. - */ - // const cloudsqlBackupRunSource = {} - /** - * Required. The location of the new cluster. For the required format, see the - * comment on Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - - // Imports the Alloydb library - const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1; - - // Instantiates a client - const alloydbClient = new AlloyDBCSQLAdminClient(); - - async function callRestoreFromCloudSQL() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.restoreFromCloudSQL(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreFromCloudSQL(); - // [END alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json deleted file mode 100644 index 3d02efb97c2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json +++ /dev/null @@ -1,2027 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-alloydb", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.alloydb.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListClusters_async", - "title": "AlloyDBAdmin listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists Clusters in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListClusters", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.ListClustersResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListClusters", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetCluster_async", - "title": "AlloyDBAdmin getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.alloydb.v1.ClusterView" - } - ], - "resultType": ".google.cloud.alloydb.v1.Cluster", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async", - "title": "AlloyDBAdmin createCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Cluster in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async", - "title": "AlloyDBAdmin updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async", - "title": "AlloyDBAdmin exportCluster Sample", - "origin": "API_DEFINITION", - "description": " Exports data from the cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.export_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExportCluster", - "async": true, - "parameters": [ - { - "name": "gcs_destination", - "type": ".google.cloud.alloydb.v1.GcsDestination" - }, - { - "name": "csv_export_options", - "type": ".google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions" - }, - { - "name": "sql_export_options", - "type": ".google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ExportCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExportCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async", - "title": "AlloyDBAdmin importCluster Sample", - "origin": "API_DEFINITION", - "description": " Imports data to the cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.import_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ImportCluster", - "async": true, - "parameters": [ - { - "name": "sql_import_options", - "type": ".google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions" - }, - { - "name": "csv_import_options", - "type": ".google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "gcs_uri", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ImportCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ImportCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async", - "title": "AlloyDBAdmin upgradeCluster Sample", - "origin": "API_DEFINITION", - "description": " Upgrades a single Cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.upgrade_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpgradeCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": ".google.cloud.alloydb.v1.DatabaseVersion" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpgradeCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpgradeCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async", - "title": "AlloyDBAdmin deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async", - "title": "AlloyDBAdmin promoteCluster Sample", - "origin": "API_DEFINITION", - "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.promote_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PromoteCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.PromoteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "PromoteCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.PromoteCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async", - "title": "AlloyDBAdmin switchoverCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.switchover_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SwitchoverCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "SwitchoverCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.SwitchoverCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async", - "title": "AlloyDBAdmin restoreCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.restore_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestoreCluster", - "async": true, - "parameters": [ - { - "name": "backup_source", - "type": ".google.cloud.alloydb.v1.BackupSource" - }, - { - "name": "continuous_backup_source", - "type": ".google.cloud.alloydb.v1.ContinuousBackupSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "RestoreCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestoreCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async", - "title": "AlloyDBAdmin createSecondaryCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", - "canonical": true, - "file": "alloy_d_b_admin.create_secondary_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecondaryCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateSecondaryCluster", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListInstances_async", - "title": "AlloyDBAdmin listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.ListInstancesResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListInstances", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetInstance_async", - "title": "AlloyDBAdmin getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.alloydb.v1.InstanceView" - } - ], - "resultType": ".google.cloud.alloydb.v1.Instance", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async", - "title": "AlloyDBAdmin createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Instance in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async", - "title": "AlloyDBAdmin createSecondaryInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new SECONDARY Instance in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_secondary_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecondaryInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateSecondaryInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateSecondaryInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async", - "title": "AlloyDBAdmin batchCreateInstances Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.batch_create_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateInstances", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": ".google.cloud.alloydb.v1.CreateInstanceRequests" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "BatchCreateInstances", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.BatchCreateInstances", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async", - "title": "AlloyDBAdmin updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async", - "title": "AlloyDBAdmin deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async", - "title": "AlloyDBAdmin failoverInstance Sample", - "origin": "API_DEFINITION", - "description": " Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.failover_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FailoverInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "FailoverInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.FailoverInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_InjectFault_async", - "title": "AlloyDBAdmin injectFault Sample", - "origin": "API_DEFINITION", - "description": " Injects fault in an instance. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.inject_fault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InjectFault", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.InjectFault", - "async": true, - "parameters": [ - { - "name": "fault_type", - "type": ".google.cloud.alloydb.v1.InjectFaultRequest.FaultType" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "InjectFault", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.InjectFault", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async", - "title": "AlloyDBAdmin restartInstance Sample", - "origin": "API_DEFINITION", - "description": " Restart an Instance in a cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.restart_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "node_ids", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "RestartInstance", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.RestartInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async", - "title": "AlloyDBAdmin executeSql Sample", - "origin": "API_DEFINITION", - "description": " Executes a SQL statement in a database inside an AlloyDB instance.", - "canonical": true, - "file": "alloy_d_b_admin.execute_sql.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExecuteSql", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSql", - "async": true, - "parameters": [ - { - "name": "password", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": "TYPE_STRING" - }, - { - "name": "sql_statement", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1.ExecuteSqlResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ExecuteSql", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ExecuteSql", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListBackups_async", - "title": "AlloyDBAdmin listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists Backups in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListBackups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.ListBackupsResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListBackups", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListBackups", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetBackup_async", - "title": "AlloyDBAdmin getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.Backup", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async", - "title": "AlloyDBAdmin createBackup Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Backup in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": ".google.cloud.alloydb.v1.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async", - "title": "AlloyDBAdmin updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "backup", - "type": ".google.cloud.alloydb.v1.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async", - "title": "AlloyDBAdmin deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async", - "title": "AlloyDBAdmin listSupportedDatabaseFlags Sample", - "origin": "API_DEFINITION", - "description": " Lists SupportedDatabaseFlags for a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_supported_database_flags.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSupportedDatabaseFlags", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlags", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "scope", - "type": ".google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope" - } - ], - "resultType": ".google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListSupportedDatabaseFlags", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListSupportedDatabaseFlags", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async", - "title": "AlloyDBAdmin generateClientCertificate Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.generate_client_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateClientCertificate", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "cert_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "public_key", - "type": "TYPE_STRING" - }, - { - "name": "use_metadata_exchange", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1.GenerateClientCertificateResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "GenerateClientCertificate", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GenerateClientCertificate", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async", - "title": "AlloyDBAdmin getConnectionInfo Sample", - "origin": "API_DEFINITION", - "description": " Get instance metadata used for a connection.", - "canonical": true, - "file": "alloy_d_b_admin.get_connection_info.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConnectionInfo", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfo", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.ConnectionInfo", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetConnectionInfo", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetConnectionInfo", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListUsers_async", - "title": "AlloyDBAdmin listUsers Sample", - "origin": "API_DEFINITION", - "description": " Lists Users in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_users.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsers", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListUsers", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.ListUsersResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListUsers", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListUsers", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_GetUser_async", - "title": "AlloyDBAdmin getUser Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single User.", - "canonical": true, - "file": "alloy_d_b_admin.get_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.GetUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_CreateUser_async", - "title": "AlloyDBAdmin createUser Sample", - "origin": "API_DEFINITION", - "description": " Creates a new User in a given project, location, and cluster.", - "canonical": true, - "file": "alloy_d_b_admin.create_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateUser", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "user_id", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": ".google.cloud.alloydb.v1.User" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.CreateUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async", - "title": "AlloyDBAdmin updateUser Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single User.", - "canonical": true, - "file": "alloy_d_b_admin.update_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUser", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "user", - "type": ".google.cloud.alloydb.v1.User" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.UpdateUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async", - "title": "AlloyDBAdmin deleteUser Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single User.", - "canonical": true, - "file": "alloy_d_b_admin.delete_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteUser", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.DeleteUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async", - "title": "AlloyDBAdmin listDatabases Sample", - "origin": "API_DEFINITION", - "description": " Lists Databases in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_databases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDatabases", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1.ListDatabasesResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListDatabases", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin.ListDatabases", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async", - "title": "AlloyDBAdmin restoreFromCloudSQL Sample", - "origin": "API_DEFINITION", - "description": " Restores an AlloyDB cluster from a CloudSQL resource.", - "canonical": true, - "file": "alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreFromCloudSQL", - "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "async": true, - "parameters": [ - { - "name": "cloudsql_backup_run_source", - "type": ".google.cloud.alloydb.v1.CloudSQLBackupRunSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1.Cluster" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBCSQLAdminClient", - "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdminClient" - }, - "method": { - "shortName": "RestoreFromCloudSQL", - "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "service": { - "shortName": "AlloyDBCSQLAdmin", - "fullName": "google.cloud.alloydb.v1.AlloyDBCSQLAdmin" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js deleted file mode 100644 index 159c1f23ae9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, requests) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. - */ - // const parent = 'abc123' - /** - * Required. Resources being created. - */ - // const requests = {} - /** - * 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). - */ - // const requestId = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callBatchCreateInstances() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const [operation] = await alloydbClient.batchCreateInstances(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchCreateInstances(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js deleted file mode 100644 index 8ec6bb39226..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, backupId, backup) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const backupId = 'abc123' - /** - * Required. The resource being created - */ - // const backup = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateBackup() { - // Construct request - const request = { - parent, - backupId, - backup, - }; - - // Run request - const [operation] = await alloydbClient.createBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackup(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js deleted file mode 100644 index 7ec98c9db98..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.createCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js deleted file mode 100644 index ab067ad68a3..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_database.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, databaseId, database) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const databaseId = 'abc123' - /** - * Required. The resource being created. - */ - // const database = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateDatabase() { - // Construct request - const request = { - parent, - databaseId, - database, - }; - - // Run request - const response = await alloydbClient.createDatabase(request); - console.log(response); - } - - callCreateDatabase(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js deleted file mode 100644 index d988841631b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, instanceId, instance) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const instanceId = 'abc123' - /** - * Required. The resource being created - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await alloydbClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js deleted file mode 100644 index 9a9487742ac..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object (the secondary cluster). - */ - // const clusterId = 'abc123' - /** - * Required. Configuration of the requesting object (the secondary cluster). - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateSecondaryCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.createSecondaryCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSecondaryCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js deleted file mode 100644 index 3ff62b344aa..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, instanceId, instance) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const instanceId = 'abc123' - /** - * Required. The resource being created - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateSecondaryInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await alloydbClient.createSecondaryInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSecondaryInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js deleted file mode 100644 index ab582adf7c4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, userId, user) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const userId = 'abc123' - /** - * Required. The resource being created - */ - // const user = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateUser() { - // Construct request - const request = { - parent, - userId, - user, - }; - - // Run request - const response = await alloydbClient.createUser(request); - console.log(response); - } - - callCreateUser(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js deleted file mode 100644 index 794b8d3587f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * 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. - */ - // const etag = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackup(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js deleted file mode 100644 index 4b4d593566f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * Optional. Whether to cascade delete child instances for given cluster. - */ - // const force = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js deleted file mode 100644 index acb531eab1c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js deleted file mode 100644 index 1edc6fe6f87..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.deleteUser(request); - console.log(response); - } - - callDeleteUser(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js deleted file mode 100644 index 6b47657e629..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance, database, user, sqlStatement) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Optional. The database native user’s password. - */ - // const password = 'abc123' - /** - * Required. The instance where the SQL will be executed. For the required - * format, see the comment on the Instance.name field. - */ - // const instance = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - /** - * 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. - */ - // const user = 'abc123' - /** - * Required. SQL statement to execute on database. Any valid statement is - * permitted, including DDL, DML, DQL statements. - */ - // const sqlStatement = 'abc123' - /** - * Optional. If set, validates the sql statement by performing - * syntax and semantic validation and doesn't execute the query. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callExecuteSql() { - // Construct request - const request = { - instance, - database, - user, - sqlStatement, - }; - - // Run request - const response = await alloydbClient.executeSql(request); - console.log(response); - } - - callExecuteSql(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js deleted file mode 100644 index 7e176680751..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(gcsDestination, name, database) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Option to export data to cloud storage. - */ - // const gcsDestination = {} - /** - * Options for exporting data in CSV format. Required field to be set for - * CSV file type. - */ - // const csvExportOptions = {} - /** - * Options for exporting data in SQL format. Required field to be set for - * SQL file type. - */ - // const sqlExportOptions = {} - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callExportCluster() { - // Construct request - const request = { - gcsDestination, - name, - database, - }; - - // Run request - const [operation] = await alloydbClient.exportCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callExportCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js deleted file mode 100644 index 57e6dd3299a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callFailoverInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.failoverInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callFailoverInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js deleted file mode 100644 index b72ae40df68..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - */ - // const parent = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). It is - * recommended to use public_key instead. - */ - // const pemCsr = 'abc123' - /** - * 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. - */ - // const certDuration = {} - /** - * Optional. The public key from the client. - */ - // const publicKey = 'abc123' - /** - * 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. - */ - // const useMetadataExchange = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGenerateClientCertificate() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await alloydbClient.generateClientCertificate(request); - console.log(response); - } - - callGenerateClientCertificate(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js deleted file mode 100644 index 41734dbeb63..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource - */ - // const name = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getBackup(request); - console.log(response); - } - - callGetBackup(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js deleted file mode 100644 index b15f8e31cf1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const name = 'abc123' - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - */ - // const view = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js deleted file mode 100644 index 813d598abd2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - */ - // const parent = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetConnectionInfo() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await alloydbClient.getConnectionInfo(request); - console.log(response); - } - - callGetConnectionInfo(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js deleted file mode 100644 index 570ea167e99..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * The view of the instance to return. - */ - // const view = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getInstance(request); - console.log(response); - } - - callGetInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js deleted file mode 100644 index 36d6f01f262..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - */ - // const name = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getUser(request); - console.log(response); - } - - callGetUser(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js deleted file mode 100644 index 825e964f080..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, gcsUri) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Options for importing data in SQL format. - */ - // const sqlImportOptions = {} - /** - * Options for importing data in CSV format. - */ - // const csvImportOptions = {} - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * 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`. - */ - // const gcsUri = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - /** - * 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. - */ - // const user = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callImportCluster() { - // Construct request - const request = { - name, - gcsUri, - }; - - // Run request - const [operation] = await alloydbClient.importCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callImportCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js deleted file mode 100644 index d07fea0c8b7..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(faultType, name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The type of fault to be injected in an instance. - */ - // const faultType = {} - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callInjectFault() { - // Construct request - const request = { - faultType, - name, - }; - - // Run request - const [operation] = await alloydbClient.injectFault(request); - const [response] = await operation.promise(); - console.log(response); - } - - callInjectFault(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js deleted file mode 100644 index f803eb473c0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListBackupsRequest - */ - // const parent = 'abc123' - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Filtering results - */ - // const filter = 'abc123' - /** - * Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListBackups() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listBackupsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackups(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js deleted file mode 100644 index 5d473fa68e2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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/- - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListClusters() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listClustersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListClusters(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js deleted file mode 100644 index ea14804ec8b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListDatabasesRequest. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - */ - // const filter = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListDatabases() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listDatabasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDatabases(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js deleted file mode 100644 index 30ec7f4fcc1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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/- - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListInstances() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listInstancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListInstances(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js deleted file mode 100644 index 78d2c817bea..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const parent = 'abc123' - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - */ - // const scope = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListSupportedDatabaseFlags() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listSupportedDatabaseFlagsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSupportedDatabaseFlags(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js deleted file mode 100644 index 5f38621cde9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListUsersRequest - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListUsers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listUsersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsers(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js deleted file mode 100644 index 7420b6e626c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callPromoteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.promoteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callPromoteCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js deleted file mode 100644 index 152fdad826c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - * restart upon. Applicable only to read instances. - */ - // const nodeIds = ['abc','def'] - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callRestartInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.restartInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestartInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js deleted file mode 100644 index 2c5e047f2fe..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Backup source. - */ - // const backupSource = {} - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - */ - // const continuousBackupSource = {} - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callRestoreCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.restoreCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js deleted file mode 100644 index b28a933620f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callSwitchoverCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.switchoverCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSwitchoverCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js deleted file mode 100644 index 6bdd55559f8..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(backup) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const backup = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateBackup() { - // Construct request - const request = { - backup, - }; - - // Run request - const [operation] = await alloydbClient.updateBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackup(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js deleted file mode 100644 index b3910e399e9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(cluster) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - cluster, - }; - - // Run request - const [operation] = await alloydbClient.updateCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js deleted file mode 100644 index db72d37ed6d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateInstance() { - // Construct request - const request = { - instance, - }; - - // Run request - const [operation] = await alloydbClient.updateInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateInstance(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js deleted file mode 100644 index 224abf4a507..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(user) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const user = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * Optional. Allow missing fields in the update mask. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateUser() { - // Construct request - const request = { - user, - }; - - // Run request - const response = await alloydbClient.updateUser(request); - console.log(response); - } - - callUpdateUser(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js deleted file mode 100644 index 0aeea7a8925..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, version) { - // [START alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * Required. The version the cluster is going to be upgraded to. - */ - // const version = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const etag = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpgradeCluster() { - // Construct request - const request = { - name, - version, - }; - - // Run request - const [operation] = await alloydbClient.upgradeCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpgradeCluster(); - // [END alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js deleted file mode 100644 index 16fe2e1d756..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Cluster created from CloudSQL backup run. - */ - // const cloudsqlBackupRunSource = {} - /** - * Required. The location of the new cluster. For the required format, see the - * comment on Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - - // Imports the Alloydb library - const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1alpha; - - // Instantiates a client - const alloydbClient = new AlloyDBCSQLAdminClient(); - - async function callRestoreFromCloudSQL() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.restoreFromCloudSQL(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreFromCloudSQL(); - // [END alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json deleted file mode 100644 index d56ea5cbf39..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json +++ /dev/null @@ -1,2079 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-alloydb", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.alloydb.v1alpha", - "version": "v1alpha" - } - ] - }, - "snippets": [ - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async", - "title": "AlloyDBAdmin listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists Clusters in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClusters", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ListClustersResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListClusters", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async", - "title": "AlloyDBAdmin getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.alloydb.v1alpha.ClusterView" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.Cluster", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async", - "title": "AlloyDBAdmin createCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Cluster in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1alpha.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async", - "title": "AlloyDBAdmin updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1alpha.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async", - "title": "AlloyDBAdmin exportCluster Sample", - "origin": "API_DEFINITION", - "description": " Exports data from the cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.export_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportCluster", - "async": true, - "parameters": [ - { - "name": "gcs_destination", - "type": ".google.cloud.alloydb.v1alpha.GcsDestination" - }, - { - "name": "csv_export_options", - "type": ".google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions" - }, - { - "name": "sql_export_options", - "type": ".google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ExportCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExportCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async", - "title": "AlloyDBAdmin importCluster Sample", - "origin": "API_DEFINITION", - "description": " Imports data to the cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.import_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportCluster", - "async": true, - "parameters": [ - { - "name": "sql_import_options", - "type": ".google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions" - }, - { - "name": "csv_import_options", - "type": ".google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "gcs_uri", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ImportCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ImportCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async", - "title": "AlloyDBAdmin upgradeCluster Sample", - "origin": "API_DEFINITION", - "description": " Upgrades a single Cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.upgrade_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpgradeCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": ".google.cloud.alloydb.v1alpha.DatabaseVersion" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpgradeCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpgradeCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async", - "title": "AlloyDBAdmin deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async", - "title": "AlloyDBAdmin promoteCluster Sample", - "origin": "API_DEFINITION", - "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.promote_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PromoteCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "PromoteCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.PromoteCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async", - "title": "AlloyDBAdmin switchoverCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.switchover_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SwitchoverCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "SwitchoverCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.SwitchoverCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async", - "title": "AlloyDBAdmin restoreCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.restore_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreCluster", - "async": true, - "parameters": [ - { - "name": "backup_source", - "type": ".google.cloud.alloydb.v1alpha.BackupSource" - }, - { - "name": "continuous_backup_source", - "type": ".google.cloud.alloydb.v1alpha.ContinuousBackupSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1alpha.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "RestoreCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestoreCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async", - "title": "AlloyDBAdmin createSecondaryCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", - "canonical": true, - "file": "alloy_d_b_admin.create_secondary_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecondaryCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1alpha.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateSecondaryCluster", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async", - "title": "AlloyDBAdmin listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ListInstancesResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListInstances", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async", - "title": "AlloyDBAdmin getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.alloydb.v1alpha.InstanceView" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.Instance", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async", - "title": "AlloyDBAdmin createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Instance in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1alpha.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async", - "title": "AlloyDBAdmin createSecondaryInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new SECONDARY Instance in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_secondary_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecondaryInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1alpha.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateSecondaryInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateSecondaryInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async", - "title": "AlloyDBAdmin batchCreateInstances Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.batch_create_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateInstances", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": ".google.cloud.alloydb.v1alpha.CreateInstanceRequests" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "BatchCreateInstances", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.BatchCreateInstances", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async", - "title": "AlloyDBAdmin updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1alpha.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async", - "title": "AlloyDBAdmin deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async", - "title": "AlloyDBAdmin failoverInstance Sample", - "origin": "API_DEFINITION", - "description": " Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.failover_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FailoverInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "FailoverInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.FailoverInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async", - "title": "AlloyDBAdmin injectFault Sample", - "origin": "API_DEFINITION", - "description": " Injects fault in an instance. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.inject_fault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InjectFault", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFault", - "async": true, - "parameters": [ - { - "name": "fault_type", - "type": ".google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "InjectFault", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.InjectFault", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async", - "title": "AlloyDBAdmin restartInstance Sample", - "origin": "API_DEFINITION", - "description": " Restart an Instance in a cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.restart_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "node_ids", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "RestartInstance", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.RestartInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async", - "title": "AlloyDBAdmin executeSql Sample", - "origin": "API_DEFINITION", - "description": " Executes a SQL statement in a database inside an AlloyDB instance.", - "canonical": true, - "file": "alloy_d_b_admin.execute_sql.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExecuteSql", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSql", - "async": true, - "parameters": [ - { - "name": "password", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": "TYPE_STRING" - }, - { - "name": "sql_statement", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ExecuteSqlResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ExecuteSql", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ExecuteSql", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async", - "title": "AlloyDBAdmin listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists Backups in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ListBackupsResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListBackups", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListBackups", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async", - "title": "AlloyDBAdmin getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.Backup", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async", - "title": "AlloyDBAdmin createBackup Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Backup in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": ".google.cloud.alloydb.v1alpha.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async", - "title": "AlloyDBAdmin updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "backup", - "type": ".google.cloud.alloydb.v1alpha.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async", - "title": "AlloyDBAdmin deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async", - "title": "AlloyDBAdmin listSupportedDatabaseFlags Sample", - "origin": "API_DEFINITION", - "description": " Lists SupportedDatabaseFlags for a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_supported_database_flags.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSupportedDatabaseFlags", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlags", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "scope", - "type": ".google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListSupportedDatabaseFlags", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListSupportedDatabaseFlags", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async", - "title": "AlloyDBAdmin generateClientCertificate Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.generate_client_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 91, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateClientCertificate", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "pem_csr", - "type": "TYPE_STRING" - }, - { - "name": "cert_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "public_key", - "type": "TYPE_STRING" - }, - { - "name": "use_metadata_exchange", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "GenerateClientCertificate", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GenerateClientCertificate", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async", - "title": "AlloyDBAdmin getConnectionInfo Sample", - "origin": "API_DEFINITION", - "description": " Get instance metadata used for a connection.", - "canonical": true, - "file": "alloy_d_b_admin.get_connection_info.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConnectionInfo", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfo", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ConnectionInfo", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetConnectionInfo", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetConnectionInfo", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async", - "title": "AlloyDBAdmin listUsers Sample", - "origin": "API_DEFINITION", - "description": " Lists Users in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_users.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsers", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsers", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ListUsersResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListUsers", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListUsers", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async", - "title": "AlloyDBAdmin getUser Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single User.", - "canonical": true, - "file": "alloy_d_b_admin.get_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.GetUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async", - "title": "AlloyDBAdmin createUser Sample", - "origin": "API_DEFINITION", - "description": " Creates a new User in a given project, location, and cluster.", - "canonical": true, - "file": "alloy_d_b_admin.create_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUser", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "user_id", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": ".google.cloud.alloydb.v1alpha.User" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async", - "title": "AlloyDBAdmin updateUser Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single User.", - "canonical": true, - "file": "alloy_d_b_admin.update_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUser", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "user", - "type": ".google.cloud.alloydb.v1alpha.User" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.UpdateUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async", - "title": "AlloyDBAdmin deleteUser Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single User.", - "canonical": true, - "file": "alloy_d_b_admin.delete_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteUser", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.DeleteUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async", - "title": "AlloyDBAdmin listDatabases Sample", - "origin": "API_DEFINITION", - "description": " Lists Databases in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_databases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDatabases", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.ListDatabasesResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListDatabases", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.ListDatabases", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async", - "title": "AlloyDBAdmin createDatabase Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Database in a given project, location, and cluster.", - "canonical": true, - "file": "alloy_d_b_admin.create_database.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDatabase", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabase", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": ".google.cloud.alloydb.v1alpha.Database" - } - ], - "resultType": ".google.cloud.alloydb.v1alpha.Database", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateDatabase", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin.CreateDatabase", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async", - "title": "AlloyDBAdmin restoreFromCloudSQL Sample", - "origin": "API_DEFINITION", - "description": " Restores an AlloyDB cluster from a CloudSQL resource.", - "canonical": true, - "file": "alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreFromCloudSQL", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "async": true, - "parameters": [ - { - "name": "cloudsql_backup_run_source", - "type": ".google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1alpha.Cluster" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBCSQLAdminClient", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdminClient" - }, - "method": { - "shortName": "RestoreFromCloudSQL", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "service": { - "shortName": "AlloyDBCSQLAdmin", - "fullName": "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js deleted file mode 100644 index 302a6b9b6c1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, requests) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. - */ - // const parent = 'abc123' - /** - * Required. Resources being created. - */ - // const requests = {} - /** - * 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). - */ - // const requestId = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callBatchCreateInstances() { - // Construct request - const request = { - parent, - requests, - }; - - // Run request - const [operation] = await alloydbClient.batchCreateInstances(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchCreateInstances(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js deleted file mode 100644 index de8881d9769..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, backupId, backup) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const backupId = 'abc123' - /** - * Required. The resource being created - */ - // const backup = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateBackup() { - // Construct request - const request = { - parent, - backupId, - backup, - }; - - // Run request - const [operation] = await alloydbClient.createBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackup(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js deleted file mode 100644 index f554f9d87cf..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.createCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js deleted file mode 100644 index aacb481086e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_database.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, databaseId, database) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const databaseId = 'abc123' - /** - * Required. The resource being created. - */ - // const database = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateDatabase() { - // Construct request - const request = { - parent, - databaseId, - database, - }; - - // Run request - const response = await alloydbClient.createDatabase(request); - console.log(response); - } - - callCreateDatabase(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js deleted file mode 100644 index 346e9c20bfa..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, instanceId, instance) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const instanceId = 'abc123' - /** - * Required. The resource being created - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await alloydbClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js deleted file mode 100644 index 8770b3427b7..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object (the secondary cluster). - */ - // const clusterId = 'abc123' - /** - * Required. Configuration of the requesting object (the secondary cluster). - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateSecondaryCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.createSecondaryCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSecondaryCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js deleted file mode 100644 index b08b0c4a1b4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, instanceId, instance) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const instanceId = 'abc123' - /** - * Required. The resource being created - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateSecondaryInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await alloydbClient.createSecondaryInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSecondaryInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js deleted file mode 100644 index a2f785a0062..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, userId, user) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const userId = 'abc123' - /** - * Required. The resource being created - */ - // const user = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callCreateUser() { - // Construct request - const request = { - parent, - userId, - user, - }; - - // Run request - const response = await alloydbClient.createUser(request); - console.log(response); - } - - callCreateUser(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js deleted file mode 100644 index a89dc75a2e1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * 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. - */ - // const etag = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackup(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js deleted file mode 100644 index 2926f4fa27b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * Optional. Whether to cascade delete child instances for given cluster. - */ - // const force = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js deleted file mode 100644 index 813cc5ed65d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.deleteInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js deleted file mode 100644 index 7be0afa729b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callDeleteUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.deleteUser(request); - console.log(response); - } - - callDeleteUser(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js deleted file mode 100644 index 731ebf74c79..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance, database, user, sqlStatement) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Optional. The database native user’s password. - */ - // const password = 'abc123' - /** - * Required. The instance where the SQL will be executed. For the required - * format, see the comment on the Instance.name field. - */ - // const instance = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - /** - * 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. - */ - // const user = 'abc123' - /** - * Required. SQL statement to execute on database. Any valid statement is - * permitted, including DDL, DML, DQL statements. - */ - // const sqlStatement = 'abc123' - /** - * Optional. If set, validates the sql statement by performing - * syntax and semantic validation and doesn't execute the query. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callExecuteSql() { - // Construct request - const request = { - instance, - database, - user, - sqlStatement, - }; - - // Run request - const response = await alloydbClient.executeSql(request); - console.log(response); - } - - callExecuteSql(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js deleted file mode 100644 index 5e1dead1ccb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.export_cluster.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(gcsDestination, name, database) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Option to export data to cloud storage. - */ - // const gcsDestination = {} - /** - * Options for exporting data in CSV format. Required field to be set for - * CSV file type. - */ - // const csvExportOptions = {} - /** - * Options for exporting data in SQL format. Required field to be set for - * SQL file type. - */ - // const sqlExportOptions = {} - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callExportCluster() { - // Construct request - const request = { - gcsDestination, - name, - database, - }; - - // Run request - const [operation] = await alloydbClient.exportCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callExportCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js deleted file mode 100644 index a01bb97decf..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callFailoverInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.failoverInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callFailoverInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js deleted file mode 100644 index ae5c0115335..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - */ - // const parent = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. A pem-encoded X.509 certificate signing request (CSR). It is - * recommended to use public_key instead. - */ - // const pemCsr = 'abc123' - /** - * 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. - */ - // const certDuration = {} - /** - * Optional. The public key from the client. - */ - // const publicKey = 'abc123' - /** - * 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. - */ - // const useMetadataExchange = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGenerateClientCertificate() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await alloydbClient.generateClientCertificate(request); - console.log(response); - } - - callGenerateClientCertificate(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js deleted file mode 100644 index c2583a607ae..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource - */ - // const name = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getBackup(request); - console.log(response); - } - - callGetBackup(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js deleted file mode 100644 index f9790f5d80e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const name = 'abc123' - /** - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - */ - // const view = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js deleted file mode 100644 index 839d0c881b7..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - */ - // const parent = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetConnectionInfo() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await alloydbClient.getConnectionInfo(request); - console.log(response); - } - - callGetConnectionInfo(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js deleted file mode 100644 index a7767239e4a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * The view of the instance to return. - */ - // const view = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getInstance(request); - console.log(response); - } - - callGetInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js deleted file mode 100644 index c3ae329f841..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - */ - // const name = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callGetUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await alloydbClient.getUser(request); - console.log(response); - } - - callGetUser(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js deleted file mode 100644 index bf4ce09e015..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.import_cluster.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, gcsUri) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Options for importing data in SQL format. - */ - // const sqlImportOptions = {} - /** - * Options for importing data in CSV format. - */ - // const csvImportOptions = {} - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * 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`. - */ - // const gcsUri = 'abc123' - /** - * 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. - */ - // const database = 'abc123' - /** - * 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. - */ - // const user = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callImportCluster() { - // Construct request - const request = { - name, - gcsUri, - }; - - // Run request - const [operation] = await alloydbClient.importCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callImportCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js deleted file mode 100644 index 044560ca42b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(faultType, name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The type of fault to be injected in an instance. - */ - // const faultType = {} - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callInjectFault() { - // Construct request - const request = { - faultType, - name, - }; - - // Run request - const [operation] = await alloydbClient.injectFault(request); - const [response] = await operation.promise(); - console.log(response); - } - - callInjectFault(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js deleted file mode 100644 index 4501033661f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListBackupsRequest - */ - // const parent = 'abc123' - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Filtering results - */ - // const filter = 'abc123' - /** - * Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListBackups() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listBackupsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackups(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js deleted file mode 100644 index 8845d6666f4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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/- - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListClusters() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listClustersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListClusters(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js deleted file mode 100644 index cc5e3a38c3c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListDatabasesRequest. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - */ - // const filter = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListDatabases() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listDatabasesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDatabases(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js deleted file mode 100644 index a54786f380f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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/- - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListInstances() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listInstancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListInstances(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js deleted file mode 100644 index c200f126244..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const parent = 'abc123' - /** - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - */ - // const scope = {} - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListSupportedDatabaseFlags() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listSupportedDatabaseFlagsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSupportedDatabaseFlags(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js deleted file mode 100644 index d864c3dbd61..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent value for ListUsersRequest - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results - */ - // const orderBy = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callListUsers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = alloydbClient.listUsersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsers(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js deleted file mode 100644 index 5457e744338..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * 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. - */ - // const etag = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callPromoteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.promoteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callPromoteCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js deleted file mode 100644 index 5f5c8e675e0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - * restart upon. Applicable only to read instances. - */ - // const nodeIds = ['abc','def'] - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callRestartInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.restartInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestartInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js deleted file mode 100644 index af04906f9c2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Backup source. - */ - // const backupSource = {} - /** - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - */ - // const continuousBackupSource = {} - /** - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callRestoreCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.restoreCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js deleted file mode 100644 index d5046c8191f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - */ - // const name = 'abc123' - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callSwitchoverCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await alloydbClient.switchoverCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSwitchoverCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js deleted file mode 100644 index c1795b46d8f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(backup) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const backup = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateBackup() { - // Construct request - const request = { - backup, - }; - - // Run request - const [operation] = await alloydbClient.updateBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackup(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js deleted file mode 100644 index f4040faf914..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(cluster) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const cluster = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - cluster, - }; - - // Run request - const [operation] = await alloydbClient.updateCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js deleted file mode 100644 index e2361d28f58..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const instance = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateInstance() { - // Construct request - const request = { - instance, - }; - - // Run request - const [operation] = await alloydbClient.updateInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateInstance(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js deleted file mode 100644 index 9044dee5eee..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(user) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * 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. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const user = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - */ - // const validateOnly = true - /** - * Optional. Allow missing fields in the update mask. - */ - // const allowMissing = true - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpdateUser() { - // Construct request - const request = { - user, - }; - - // Run request - const response = await alloydbClient.updateUser(request); - console.log(response); - } - - callUpdateUser(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js deleted file mode 100644 index fa4269e7d55..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, version) { - // [START alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the cluster. - */ - // const name = 'abc123' - /** - * Required. The version the cluster is going to be upgraded to. - */ - // const version = {} - /** - * 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). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation, for example, permission - * checks and any other type of validation, but does not actually execute the - * create request. - */ - // const validateOnly = true - /** - * 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. - */ - // const etag = 'abc123' - - // Imports the Alloydb library - const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBAdminClient(); - - async function callUpgradeCluster() { - // Construct request - const request = { - name, - version, - }; - - // Run request - const [operation] = await alloydbClient.upgradeCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpgradeCluster(); - // [END alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js deleted file mode 100644 index 06b57fac034..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, clusterId, cluster) { - // [START alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Cluster created from CloudSQL backup run. - */ - // const cloudsqlBackupRunSource = {} - /** - * Required. The location of the new cluster. For the required format, see the - * comment on Cluster.name field. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object. - */ - // const clusterId = 'abc123' - /** - * Required. The resource being created - */ - // const cluster = {} - - // Imports the Alloydb library - const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1beta; - - // Instantiates a client - const alloydbClient = new AlloyDBCSQLAdminClient(); - - async function callRestoreFromCloudSQL() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await alloydbClient.restoreFromCloudSQL(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreFromCloudSQL(); - // [END alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json deleted file mode 100644 index 788ada239ba..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json +++ /dev/null @@ -1,2079 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-alloydb", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.alloydb.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async", - "title": "AlloyDBAdmin listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists Clusters in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClusters", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ListClustersResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClusters", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async", - "title": "AlloyDBAdmin getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.alloydb.v1beta.ClusterView" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.Cluster", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async", - "title": "AlloyDBAdmin createCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Cluster in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1beta.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async", - "title": "AlloyDBAdmin updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1beta.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async", - "title": "AlloyDBAdmin exportCluster Sample", - "origin": "API_DEFINITION", - "description": " Exports data from the cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.export_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportCluster", - "async": true, - "parameters": [ - { - "name": "gcs_destination", - "type": ".google.cloud.alloydb.v1beta.GcsDestination" - }, - { - "name": "csv_export_options", - "type": ".google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions" - }, - { - "name": "sql_export_options", - "type": ".google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ExportCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async", - "title": "AlloyDBAdmin importCluster Sample", - "origin": "API_DEFINITION", - "description": " Imports data to the cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.import_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportCluster", - "async": true, - "parameters": [ - { - "name": "sql_import_options", - "type": ".google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions" - }, - { - "name": "csv_import_options", - "type": ".google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "gcs_uri", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ImportCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async", - "title": "AlloyDBAdmin upgradeCluster Sample", - "origin": "API_DEFINITION", - "description": " Upgrades a single Cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.upgrade_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpgradeCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": ".google.cloud.alloydb.v1beta.DatabaseVersion" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpgradeCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async", - "title": "AlloyDBAdmin deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Cluster.", - "canonical": true, - "file": "alloy_d_b_admin.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async", - "title": "AlloyDBAdmin promoteCluster Sample", - "origin": "API_DEFINITION", - "description": " Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.promote_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PromoteCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "PromoteCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async", - "title": "AlloyDBAdmin switchoverCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.switchover_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SwitchoverCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "SwitchoverCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async", - "title": "AlloyDBAdmin restoreCluster Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.restore_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreCluster", - "async": true, - "parameters": [ - { - "name": "backup_source", - "type": ".google.cloud.alloydb.v1beta.BackupSource" - }, - { - "name": "continuous_backup_source", - "type": ".google.cloud.alloydb.v1beta.ContinuousBackupSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1beta.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "RestoreCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async", - "title": "AlloyDBAdmin createSecondaryCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.", - "canonical": true, - "file": "alloy_d_b_admin.create_secondary_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecondaryCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1beta.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateSecondaryCluster", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryCluster", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async", - "title": "AlloyDBAdmin listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ListInstancesResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstances", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async", - "title": "AlloyDBAdmin getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.alloydb.v1beta.InstanceView" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.Instance", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async", - "title": "AlloyDBAdmin createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Instance in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1beta.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async", - "title": "AlloyDBAdmin createSecondaryInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new SECONDARY Instance in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_secondary_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSecondaryInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1beta.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateSecondaryInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async", - "title": "AlloyDBAdmin batchCreateInstances Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.batch_create_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateInstances", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "requests", - "type": ".google.cloud.alloydb.v1beta.CreateInstanceRequests" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "BatchCreateInstances", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstances", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async", - "title": "AlloyDBAdmin updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "instance", - "type": ".google.cloud.alloydb.v1beta.Instance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async", - "title": "AlloyDBAdmin deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Instance.", - "canonical": true, - "file": "alloy_d_b_admin.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async", - "title": "AlloyDBAdmin failoverInstance Sample", - "origin": "API_DEFINITION", - "description": " Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.failover_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FailoverInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "FailoverInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async", - "title": "AlloyDBAdmin injectFault Sample", - "origin": "API_DEFINITION", - "description": " Injects fault in an instance. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.inject_fault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InjectFault", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", - "async": true, - "parameters": [ - { - "name": "fault_type", - "type": ".google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "InjectFault", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async", - "title": "AlloyDBAdmin restartInstance Sample", - "origin": "API_DEFINITION", - "description": " Restart an Instance in a cluster. Imperative only.", - "canonical": true, - "file": "alloy_d_b_admin.restart_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "node_ids", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "RestartInstance", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstance", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async", - "title": "AlloyDBAdmin executeSql Sample", - "origin": "API_DEFINITION", - "description": " Executes a SQL statement in a database inside an AlloyDB instance.", - "canonical": true, - "file": "alloy_d_b_admin.execute_sql.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExecuteSql", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSql", - "async": true, - "parameters": [ - { - "name": "password", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": "TYPE_STRING" - }, - { - "name": "sql_statement", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ExecuteSqlResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ExecuteSql", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSql", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async", - "title": "AlloyDBAdmin listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists Backups in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ListBackupsResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListBackups", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackups", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async", - "title": "AlloyDBAdmin getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.Backup", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async", - "title": "AlloyDBAdmin createBackup Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Backup in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.create_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": ".google.cloud.alloydb.v1beta.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async", - "title": "AlloyDBAdmin updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "backup", - "type": ".google.cloud.alloydb.v1beta.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async", - "title": "AlloyDBAdmin deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Backup.", - "canonical": true, - "file": "alloy_d_b_admin.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackup", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async", - "title": "AlloyDBAdmin listSupportedDatabaseFlags Sample", - "origin": "API_DEFINITION", - "description": " Lists SupportedDatabaseFlags for a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_supported_database_flags.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSupportedDatabaseFlags", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlags", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "scope", - "type": ".google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListSupportedDatabaseFlags", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlags", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async", - "title": "AlloyDBAdmin generateClientCertificate Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "alloy_d_b_admin.generate_client_certificate.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 91, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateClientCertificate", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "pem_csr", - "type": "TYPE_STRING" - }, - { - "name": "cert_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "public_key", - "type": "TYPE_STRING" - }, - { - "name": "use_metadata_exchange", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "GenerateClientCertificate", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificate", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async", - "title": "AlloyDBAdmin getConnectionInfo Sample", - "origin": "API_DEFINITION", - "description": " Get instance metadata used for a connection.", - "canonical": true, - "file": "alloy_d_b_admin.get_connection_info.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConnectionInfo", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfo", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ConnectionInfo", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetConnectionInfo", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfo", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async", - "title": "AlloyDBAdmin listUsers Sample", - "origin": "API_DEFINITION", - "description": " Lists Users in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_users.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsers", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ListUsersResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListUsers", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async", - "title": "AlloyDBAdmin getUser Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single User.", - "canonical": true, - "file": "alloy_d_b_admin.get_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "GetUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async", - "title": "AlloyDBAdmin createUser Sample", - "origin": "API_DEFINITION", - "description": " Creates a new User in a given project, location, and cluster.", - "canonical": true, - "file": "alloy_d_b_admin.create_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "user_id", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": ".google.cloud.alloydb.v1beta.User" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async", - "title": "AlloyDBAdmin updateUser Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single User.", - "canonical": true, - "file": "alloy_d_b_admin.update_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "user", - "type": ".google.cloud.alloydb.v1beta.User" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.User", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "UpdateUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async", - "title": "AlloyDBAdmin deleteUser Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single User.", - "canonical": true, - "file": "alloy_d_b_admin.delete_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "DeleteUser", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async", - "title": "AlloyDBAdmin listDatabases Sample", - "origin": "API_DEFINITION", - "description": " Lists Databases in a given project and location.", - "canonical": true, - "file": "alloy_d_b_admin.list_databases.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDatabases", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabases", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.ListDatabasesResponse", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "ListDatabases", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabases", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async", - "title": "AlloyDBAdmin createDatabase Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Database in a given project, location, and cluster.", - "canonical": true, - "file": "alloy_d_b_admin.create_database.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateDatabase", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabase", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "database", - "type": ".google.cloud.alloydb.v1beta.Database" - } - ], - "resultType": ".google.cloud.alloydb.v1beta.Database", - "client": { - "shortName": "AlloyDBAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdminClient" - }, - "method": { - "shortName": "CreateDatabase", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabase", - "service": { - "shortName": "AlloyDBAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - } - }, - { - "regionTag": "alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async", - "title": "AlloyDBAdmin restoreFromCloudSQL Sample", - "origin": "API_DEFINITION", - "description": " Restores an AlloyDB cluster from a CloudSQL resource.", - "canonical": true, - "file": "alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreFromCloudSQL", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "async": true, - "parameters": [ - { - "name": "cloudsql_backup_run_source", - "type": ".google.cloud.alloydb.v1beta.CloudSQLBackupRunSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.alloydb.v1beta.Cluster" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AlloyDBCSQLAdminClient", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdminClient" - }, - "method": { - "shortName": "RestoreFromCloudSQL", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "service": { - "shortName": "AlloyDBCSQLAdmin", - "fullName": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/index.ts b/owl-bot-staging/google-cloud-alloydb/src/index.ts deleted file mode 100644 index 99c2645bb6c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -import * as v1alpha from './v1alpha'; -import * as v1beta from './v1beta'; - -const AlloyDBAdminClient = v1.AlloyDBAdminClient; -type AlloyDBAdminClient = v1.AlloyDBAdminClient; -const AlloyDBCSQLAdminClient = v1.AlloyDBCSQLAdminClient; -type AlloyDBCSQLAdminClient = v1.AlloyDBCSQLAdminClient; - -export {v1, v1alpha, v1beta, AlloyDBAdminClient, AlloyDBCSQLAdminClient}; -export default {v1, v1alpha, v1beta, AlloyDBAdminClient, AlloyDBCSQLAdminClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts deleted file mode 100644 index f92542dc310..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts +++ /dev/null @@ -1,6582 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/alloy_d_b_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alloy_d_b_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service describing handlers for resources - * @class - * @memberof v1 - */ -export class AlloyDBAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('alloydb'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - alloyDBAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlloyDBAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AlloyDBAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlloyDBAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'alloydb.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ), - connectionInfoPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/flags/{flag}' - ), - userPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listClusters: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), - listBackups: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), - listSupportedDatabaseFlags: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'supportedDatabaseFlags'), - listUsers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users'), - listDatabases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const createClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const updateClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const updateClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const exportClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.ExportClusterResponse') as gax.protobuf.Type; - const exportClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const importClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.ImportClusterResponse') as gax.protobuf.Type; - const importClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const upgradeClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.UpgradeClusterResponse') as gax.protobuf.Type; - const upgradeClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const deleteClusterResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const promoteClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const promoteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const switchoverClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const switchoverClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const restoreClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const restoreClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const createSecondaryClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const createSecondaryClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const createSecondaryInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; - const createSecondaryInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const batchCreateInstancesResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.BatchCreateInstancesResponse') as gax.protobuf.Type; - const batchCreateInstancesMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; - const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const failoverInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; - const failoverInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const injectFaultResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; - const injectFaultMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Instance') as gax.protobuf.Type; - const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const createBackupResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Backup') as gax.protobuf.Type; - const createBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const updateBackupResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Backup') as gax.protobuf.Type; - const updateBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - const deleteBackupResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createClusterResponse.decode.bind(createClusterResponse), - createClusterMetadata.decode.bind(createClusterMetadata)), - updateCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateClusterResponse.decode.bind(updateClusterResponse), - updateClusterMetadata.decode.bind(updateClusterMetadata)), - exportCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportClusterResponse.decode.bind(exportClusterResponse), - exportClusterMetadata.decode.bind(exportClusterMetadata)), - importCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importClusterResponse.decode.bind(importClusterResponse), - importClusterMetadata.decode.bind(importClusterMetadata)), - upgradeCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - upgradeClusterResponse.decode.bind(upgradeClusterResponse), - upgradeClusterMetadata.decode.bind(upgradeClusterMetadata)), - deleteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteClusterResponse.decode.bind(deleteClusterResponse), - deleteClusterMetadata.decode.bind(deleteClusterMetadata)), - promoteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - promoteClusterResponse.decode.bind(promoteClusterResponse), - promoteClusterMetadata.decode.bind(promoteClusterMetadata)), - switchoverCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - switchoverClusterResponse.decode.bind(switchoverClusterResponse), - switchoverClusterMetadata.decode.bind(switchoverClusterMetadata)), - restoreCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreClusterResponse.decode.bind(restoreClusterResponse), - restoreClusterMetadata.decode.bind(restoreClusterMetadata)), - createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSecondaryClusterResponse.decode.bind(createSecondaryClusterResponse), - createSecondaryClusterMetadata.decode.bind(createSecondaryClusterMetadata)), - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSecondaryInstanceResponse.decode.bind(createSecondaryInstanceResponse), - createSecondaryInstanceMetadata.decode.bind(createSecondaryInstanceMetadata)), - batchCreateInstances: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), - batchCreateInstancesMetadata.decode.bind(batchCreateInstancesMetadata)), - updateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), - deleteInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), - failoverInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - failoverInstanceResponse.decode.bind(failoverInstanceResponse), - failoverInstanceMetadata.decode.bind(failoverInstanceMetadata)), - injectFault: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - injectFaultResponse.decode.bind(injectFaultResponse), - injectFaultMetadata.decode.bind(injectFaultMetadata)), - restartInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)), - createBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupResponse.decode.bind(createBackupResponse), - createBackupMetadata.decode.bind(createBackupMetadata)), - updateBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupResponse.decode.bind(updateBackupResponse), - updateBackupMetadata.decode.bind(updateBackupMetadata)), - deleteBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupResponse.decode.bind(deleteBackupResponse), - deleteBackupMetadata.decode.bind(deleteBackupMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.alloydb.v1.AlloyDBAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alloyDBAdminStub) { - return this.alloyDBAdminStub; - } - - // Put together the "service stub" for - // google.cloud.alloydb.v1.AlloyDBAdmin. - this.alloyDBAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1.AlloyDBAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.alloydb.v1.AlloyDBAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alloyDBAdminStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'exportCluster', 'importCluster', 'upgradeCluster', 'deleteCluster', 'promoteCluster', 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', 'executeSql', 'listBackups', 'getBackup', 'createBackup', 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', 'listUsers', 'getUser', 'createUser', 'updateUser', 'deleteUser', 'listDatabases']; - for (const methodName of alloyDBAdminStubMethods) { - const callPromise = this.alloyDBAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alloyDBAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets details of a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param {google.cloud.alloydb.v1.ClusterView} [request.view] - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.Cluster|Cluster}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.get_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetCluster_async - */ - getCluster( - request?: protos.google.cloud.alloydb.v1.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.cloud.alloydb.v1.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.cloud.alloydb.v1.IGetClusterRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.cloud.alloydb.v1.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getCluster request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCluster response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getCluster(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.ICluster, - protos.google.cloud.alloydb.v1.IGetClusterRequest|undefined, - {}|undefined - ]) => { - this._log.info('getCluster response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {google.cloud.alloydb.v1.InstanceView} request.view - * The view of the instance to return. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.Instance|Instance}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.get_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetInstance_async - */ - getInstance( - request?: protos.google.cloud.alloydb.v1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.cloud.alloydb.v1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.cloud.alloydb.v1.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request?: protos.google.cloud.alloydb.v1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getInstance request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getInstance response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getInstance(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IInstance, - protos.google.cloud.alloydb.v1.IGetInstanceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getInstance response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Executes a SQL statement in a database inside an AlloyDB instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.password] - * Optional. The database native user’s password. - * @param {string} request.instance - * Required. The instance where the SQL will be executed. For the required - * format, see the comment on the Instance.name field. - * @param {string} request.database - * 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 {string} [request.user] - * 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 {string} request.sqlStatement - * Required. SQL statement to execute on database. Any valid statement is - * permitted, including DDL, DML, DQL statements. - * @param {boolean} [request.validateOnly] - * Optional. If set, validates the sql statement by performing - * syntax and semantic validation and doesn't execute the query. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.ExecuteSqlResponse|ExecuteSqlResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.execute_sql.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ExecuteSql_async - */ - executeSql( - request?: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|undefined, {}|undefined - ]>; - executeSql( - request: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request?: protos.google.cloud.alloydb.v1.IExecuteSqlRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance': request.instance ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeSql request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('executeSql response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.executeSql(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1.IExecuteSqlRequest|undefined, - {}|undefined - ]) => { - this._log.info('executeSql response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.get_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetBackup_async - */ - getBackup( - request?: protos.google.cloud.alloydb.v1.IGetBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|undefined, {}|undefined - ]>; - getBackup( - request: protos.google.cloud.alloydb.v1.IGetBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request: protos.google.cloud.alloydb.v1.IGetBackupRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request?: protos.google.cloud.alloydb.v1.IGetBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBackup request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IBackup, - protos.google.cloud.alloydb.v1.IGetBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackup response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @param {string} [request.requestId] - * 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 {google.protobuf.Duration} [request.certDuration] - * 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 {string} [request.publicKey] - * Optional. The public key from the client. - * @param {boolean} [request.useMetadataExchange] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse|GenerateClientCertificateResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_GenerateClientCertificate_async - */ - generateClientCertificate( - request?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|undefined, {}|undefined - ]>; - generateClientCertificate( - request: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): void; - generateClientCertificate( - request: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): void; - generateClientCertificate( - request?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('generateClientCertificate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('generateClientCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.generateClientCertificate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest|undefined, - {}|undefined - ]) => { - this._log.info('generateClientCertificate response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get instance metadata used for a connection. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @param {string} [request.requestId] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.ConnectionInfo|ConnectionInfo}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.get_connection_info.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetConnectionInfo_async - */ - getConnectionInfo( - request?: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|undefined, {}|undefined - ]>; - getConnectionInfo( - request: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): void; - getConnectionInfo( - request: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): void; - getConnectionInfo( - request?: protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getConnectionInfo request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getConnectionInfo response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getConnectionInfo(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IConnectionInfo, - protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest|undefined, - {}|undefined - ]) => { - this._log.info('getConnectionInfo response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.get_user.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_GetUser_async - */ - getUser( - request?: protos.google.cloud.alloydb.v1.IGetUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|undefined, {}|undefined - ]>; - getUser( - request: protos.google.cloud.alloydb.v1.IGetUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request: protos.google.cloud.alloydb.v1.IGetUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request?: protos.google.cloud.alloydb.v1.IGetUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IGetUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('getUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new User in a given project, location, and cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.userId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.User} request.user - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_user.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateUser_async - */ - createUser( - request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|undefined, {}|undefined - ]>; - createUser( - request: protos.google.cloud.alloydb.v1.ICreateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request: protos.google.cloud.alloydb.v1.ICreateUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request?: protos.google.cloud.alloydb.v1.ICreateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.ICreateUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('createUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the parameters of a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1.User} request.user - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {boolean} [request.allowMissing] - * Optional. Allow missing fields in the update mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_user.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateUser_async - */ - updateUser( - request?: protos.google.cloud.alloydb.v1.IUpdateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|undefined, {}|undefined - ]>; - updateUser( - request: protos.google.cloud.alloydb.v1.IUpdateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request: protos.google.cloud.alloydb.v1.IUpdateUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request?: protos.google.cloud.alloydb.v1.IUpdateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'user.name': request.user!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1.IUser, - protos.google.cloud.alloydb.v1.IUpdateUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_user.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteUser_async - */ - deleteUser( - request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|undefined, {}|undefined - ]>; - deleteUser( - request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request: protos.google.cloud.alloydb.v1.IDeleteUserRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request?: protos.google.cloud.alloydb.v1.IDeleteUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteUser request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1.IDeleteUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new Cluster in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Cluster} request.cluster - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async - */ - createCluster( - request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.cloud.alloydb.v1.ICreateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.cloud.alloydb.v1.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCluster request %j', request); - return this.innerApiCalls.createCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateCluster_async - */ - async checkCreateClusterProgress(name: string): Promise>{ - this._log.info('createCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1.Cluster} request.cluster - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async - */ - updateCluster( - request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.cloud.alloydb.v1.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'cluster.name': request.cluster!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCluster request %j', request); - return this.innerApiCalls.updateCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateCluster_async - */ - async checkUpdateClusterProgress(name: string): Promise>{ - this._log.info('updateCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports data from the cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1.GcsDestination} request.gcsDestination - * Required. Option to export data to cloud storage. - * @param {google.cloud.alloydb.v1.ExportClusterRequest.CsvExportOptions} request.csvExportOptions - * Options for exporting data in CSV format. Required field to be set for - * CSV file type. - * @param {google.cloud.alloydb.v1.ExportClusterRequest.SqlExportOptions} request.sqlExportOptions - * Options for exporting data in SQL format. Required field to be set for - * SQL file type. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {string} request.database - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.export_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async - */ - exportCluster( - request?: protos.google.cloud.alloydb.v1.IExportClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportCluster( - request: protos.google.cloud.alloydb.v1.IExportClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportCluster( - request: protos.google.cloud.alloydb.v1.IExportClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportCluster( - request?: protos.google.cloud.alloydb.v1.IExportClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('exportCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('exportCluster request %j', request); - return this.innerApiCalls.exportCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('exportCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `exportCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.export_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ExportCluster_async - */ - async checkExportClusterProgress(name: string): Promise>{ - this._log.info('exportCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports data to the cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1.ImportClusterRequest.SqlImportOptions} request.sqlImportOptions - * Options for importing data in SQL format. - * @param {google.cloud.alloydb.v1.ImportClusterRequest.CsvImportOptions} request.csvImportOptions - * Options for importing data in CSV format. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {string} request.gcsUri - * 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 {string} [request.database] - * 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 {string} [request.user] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.import_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async - */ - importCluster( - request?: protos.google.cloud.alloydb.v1.IImportClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importCluster( - request: protos.google.cloud.alloydb.v1.IImportClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importCluster( - request: protos.google.cloud.alloydb.v1.IImportClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importCluster( - request?: protos.google.cloud.alloydb.v1.IImportClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('importCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importCluster request %j', request); - return this.innerApiCalls.importCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('importCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `importCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.import_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ImportCluster_async - */ - async checkImportClusterProgress(name: string): Promise>{ - this._log.info('importCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Upgrades a single Cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {google.cloud.alloydb.v1.DatabaseVersion} request.version - * Required. The version the cluster is going to be upgraded to. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {string} [request.etag] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async - */ - upgradeCluster( - request?: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - upgradeCluster( - request: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeCluster( - request: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeCluster( - request?: protos.google.cloud.alloydb.v1.IUpgradeClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('upgradeCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('upgradeCluster request %j', request); - return this.innerApiCalls.upgradeCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('upgradeCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `upgradeCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.upgrade_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpgradeCluster_async - */ - async checkUpgradeClusterProgress(name: string): Promise>{ - this._log.info('upgradeCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.upgradeCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.force] - * Optional. Whether to cascade delete child instances for given cluster. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.cloud.alloydb.v1.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCluster request %j', request); - return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteCluster_async - */ - async checkDeleteClusterProgress(name: string): Promise>{ - this._log.info('deleteCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.promote_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async - */ - promoteCluster( - request?: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - promoteCluster( - request: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteCluster( - request: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteCluster( - request?: protos.google.cloud.alloydb.v1.IPromoteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('promoteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('promoteCluster request %j', request); - return this.innerApiCalls.promoteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('promoteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `promoteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.promote_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_PromoteCluster_async - */ - async checkPromoteClusterProgress(name: string): Promise>{ - this._log.info('promoteCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.switchover_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async - */ - switchoverCluster( - request?: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - switchoverCluster( - request: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - switchoverCluster( - request: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - switchoverCluster( - request?: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('switchoverCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('switchoverCluster request %j', request); - return this.innerApiCalls.switchoverCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('switchoverCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `switchoverCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.switchover_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_SwitchoverCluster_async - */ - async checkSwitchoverClusterProgress(name: string): Promise>{ - this._log.info('switchoverCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.switchoverCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1.BackupSource} request.backupSource - * Backup source. - * @param {google.cloud.alloydb.v1.ContinuousBackupSource} request.continuousBackupSource - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Cluster} request.cluster - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async - */ - restoreCluster( - request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreCluster( - request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreCluster( - request: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreCluster( - request?: protos.google.cloud.alloydb.v1.IRestoreClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreCluster request %j', request); - return this.innerApiCalls.restoreCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestoreCluster_async - */ - async checkRestoreClusterProgress(name: string): Promise>{ - this._log.info('restoreCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object (the secondary cluster). - * @param {google.cloud.alloydb.v1.Cluster} request.cluster - * Required. Configuration of the requesting object (the secondary cluster). - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async - */ - createSecondaryCluster( - request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSecondaryCluster( - request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryCluster( - request: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryCluster( - request?: protos.google.cloud.alloydb.v1.ICreateSecondaryClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSecondaryCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSecondaryCluster request %j', request); - return this.innerApiCalls.createSecondaryCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSecondaryCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSecondaryCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryCluster_async - */ - async checkCreateSecondaryClusterProgress(name: string): Promise>{ - this._log.info('createSecondaryCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} request.instanceId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Instance} request.instance - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async - */ - createInstance( - request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request?: protos.google.cloud.alloydb.v1.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createInstance request %j', request); - return this.innerApiCalls.createInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateInstance_async - */ - async checkCreateInstanceProgress(name: string): Promise>{ - this._log.info('createInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new SECONDARY Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} request.instanceId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Instance} request.instance - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async - */ - createSecondaryInstance( - request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSecondaryInstance( - request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryInstance( - request: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryInstance( - request?: protos.google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSecondaryInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSecondaryInstance request %j', request); - return this.innerApiCalls.createSecondaryInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSecondaryInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSecondaryInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateSecondaryInstance_async - */ - async checkCreateSecondaryInstanceProgress(name: string): Promise>{ - this._log.info('createSecondaryInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. - * @param {google.cloud.alloydb.v1.CreateInstanceRequests} request.requests - * Required. Resources being created. - * @param {string} [request.requestId] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.batch_create_instances.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async - */ - batchCreateInstances( - request?: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchCreateInstances( - request: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateInstances( - request: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateInstances( - request?: protos.google.cloud.alloydb.v1.IBatchCreateInstancesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('batchCreateInstances response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchCreateInstances request %j', request); - return this.innerApiCalls.batchCreateInstances(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchCreateInstances response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchCreateInstances()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.batch_create_instances.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_BatchCreateInstances_async - */ - async checkBatchCreateInstancesProgress(name: string): Promise>{ - this._log.info('batchCreateInstances long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateInstances, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1.Instance} request.instance - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async - */ - updateInstance( - request?: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request?: protos.google.cloud.alloydb.v1.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance.name': request.instance!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateInstance request %j', request); - return this.innerApiCalls.updateInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateInstance_async - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - this._log.info('updateInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async - */ - deleteInstance( - request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request?: protos.google.cloud.alloydb.v1.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteInstance request %j', request); - return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteInstance_async - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - this._log.info('deleteInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async - */ - failoverInstance( - request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - failoverInstance( - request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - failoverInstance( - request: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - failoverInstance( - request?: protos.google.cloud.alloydb.v1.IFailoverInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('failoverInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('failoverInstance request %j', request); - return this.innerApiCalls.failoverInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('failoverInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `failoverInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_FailoverInstance_async - */ - async checkFailoverInstanceProgress(name: string): Promise>{ - this._log.info('failoverInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Injects fault in an instance. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} request.faultType - * Required. The type of fault to be injected in an instance. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.inject_fault.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_InjectFault_async - */ - injectFault( - request?: protos.google.cloud.alloydb.v1.IInjectFaultRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - injectFault( - request: protos.google.cloud.alloydb.v1.IInjectFaultRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - injectFault( - request: protos.google.cloud.alloydb.v1.IInjectFaultRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - injectFault( - request?: protos.google.cloud.alloydb.v1.IInjectFaultRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('injectFault response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('injectFault request %j', request); - return this.innerApiCalls.injectFault(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('injectFault response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `injectFault()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.inject_fault.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_InjectFault_async - */ - async checkInjectFaultProgress(name: string): Promise>{ - this._log.info('injectFault long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restart an Instance in a cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {string[]} [request.nodeIds] - * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - * restart upon. Applicable only to read instances. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.restart_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async - */ - restartInstance( - request?: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartInstance( - request: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request?: protos.google.cloud.alloydb.v1.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restartInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restartInstance request %j', request); - return this.innerApiCalls.restartInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restartInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.restart_instance.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_RestartInstance_async - */ - async checkRestartInstanceProgress(name: string): Promise>{ - this._log.info('restartInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Backup in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.backupId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Backup} request.backup - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async - */ - createBackup( - request?: protos.google.cloud.alloydb.v1.ICreateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackup( - request: protos.google.cloud.alloydb.v1.ICreateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request: protos.google.cloud.alloydb.v1.ICreateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request?: protos.google.cloud.alloydb.v1.ICreateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackup request %j', request); - return this.innerApiCalls.createBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.create_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_CreateBackup_async - */ - async checkCreateBackupProgress(name: string): Promise>{ - this._log.info('createBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1.Backup} request.backup - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async - */ - updateBackup( - request?: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackup( - request: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request?: protos.google.cloud.alloydb.v1.IUpdateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackup request %j', request); - return this.innerApiCalls.updateBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.update_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_UpdateBackup_async - */ - async checkUpdateBackupProgress(name: string): Promise>{ - this._log.info('updateBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {string} [request.etag] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async - */ - deleteBackup( - request?: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackup( - request: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request?: protos.google.cloud.alloydb.v1.IDeleteBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackup request %j', request); - return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.delete_backup.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_DeleteBackup_async - */ - async checkDeleteBackupProgress(name: string): Promise>{ - this._log.info('deleteBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Clusters in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Cluster|Cluster}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listClustersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listClusters( - request?: protos.google.cloud.alloydb.v1.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.ICluster[], - protos.google.cloud.alloydb.v1.IListClustersRequest|null, - protos.google.cloud.alloydb.v1.IListClustersResponse - ]>; - listClusters( - request: protos.google.cloud.alloydb.v1.IListClustersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListClustersRequest, - protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1.ICluster>): void; - listClusters( - request: protos.google.cloud.alloydb.v1.IListClustersRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListClustersRequest, - protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1.ICluster>): void; - listClusters( - request?: protos.google.cloud.alloydb.v1.IListClustersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1.IListClustersRequest, - protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1.ICluster>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1.IListClustersRequest, - protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1.ICluster>): - Promise<[ - protos.google.cloud.alloydb.v1.ICluster[], - protos.google.cloud.alloydb.v1.IListClustersRequest|null, - protos.google.cloud.alloydb.v1.IListClustersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListClustersRequest, - protos.google.cloud.alloydb.v1.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1.ICluster>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listClusters values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listClusters request %j', request); - return this.innerApiCalls - .listClusters(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1.ICluster[], - protos.google.cloud.alloydb.v1.IListClustersRequest|null, - protos.google.cloud.alloydb.v1.IListClustersResponse - ]) => { - this._log.info('listClusters values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listClusters`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Cluster|Cluster} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listClustersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listClustersStream( - request?: protos.google.cloud.alloydb.v1.IListClustersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters stream %j', request); - return this.descriptors.page.listClusters.createStream( - this.innerApiCalls.listClusters as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listClusters`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.list_clusters.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListClusters_async - */ - listClustersAsync( - request?: protos.google.cloud.alloydb.v1.IListClustersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters iterate %j', request); - return this.descriptors.page.listClusters.asyncIterate( - this.innerApiCalls['listClusters'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Instances in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Instance|Instance}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstances( - request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IInstance[], - protos.google.cloud.alloydb.v1.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1.IListInstancesResponse - ]>; - listInstances( - request: protos.google.cloud.alloydb.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListInstancesRequest, - protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IInstance>): void; - listInstances( - request: protos.google.cloud.alloydb.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListInstancesRequest, - protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IInstance>): void; - listInstances( - request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1.IListInstancesRequest, - protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1.IListInstancesRequest, - protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IInstance>): - Promise<[ - protos.google.cloud.alloydb.v1.IInstance[], - protos.google.cloud.alloydb.v1.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1.IListInstancesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListInstancesRequest, - protos.google.cloud.alloydb.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IInstance>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstances values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstances request %j', request); - return this.innerApiCalls - .listInstances(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1.IInstance[], - protos.google.cloud.alloydb.v1.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1.IListInstancesResponse - ]) => { - this._log.info('listInstances values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstances`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Instance|Instance} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancesStream( - request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances stream %j', request); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstances`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1.Instance|Instance}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.list_instances.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListInstances_async - */ - listInstancesAsync( - request?: protos.google.cloud.alloydb.v1.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances iterate %j', request); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Backups in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Backup|Backup}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackups( - request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IBackup[], - protos.google.cloud.alloydb.v1.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1.IListBackupsResponse - ]>; - listBackups( - request: protos.google.cloud.alloydb.v1.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListBackupsRequest, - protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1.IBackup>): void; - listBackups( - request: protos.google.cloud.alloydb.v1.IListBackupsRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListBackupsRequest, - protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1.IBackup>): void; - listBackups( - request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1.IListBackupsRequest, - protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1.IBackup>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1.IListBackupsRequest, - protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1.IBackup>): - Promise<[ - protos.google.cloud.alloydb.v1.IBackup[], - protos.google.cloud.alloydb.v1.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1.IListBackupsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListBackupsRequest, - protos.google.cloud.alloydb.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1.IBackup>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackups values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackups request %j', request); - return this.innerApiCalls - .listBackups(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1.IBackup[], - protos.google.cloud.alloydb.v1.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1.IListBackupsResponse - ]) => { - this._log.info('listBackups values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackups`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Backup|Backup} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupsStream( - request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups stream %j', request); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackups`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.list_backups.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListBackups_async - */ - listBackupsAsync( - request?: protos.google.cloud.alloydb.v1.IListBackupsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups iterate %j', request); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.SupportedDatabaseFlag|SupportedDatabaseFlag}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSupportedDatabaseFlagsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSupportedDatabaseFlags( - request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse - ]>; - listSupportedDatabaseFlags( - request: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>): void; - listSupportedDatabaseFlags( - request: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>): void; - listSupportedDatabaseFlags( - request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>): - Promise<[ - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSupportedDatabaseFlags values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSupportedDatabaseFlags request %j', request); - return this.innerApiCalls - .listSupportedDatabaseFlags(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse - ]) => { - this._log.info('listSupportedDatabaseFlags values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.SupportedDatabaseFlag|SupportedDatabaseFlag} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSupportedDatabaseFlagsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSupportedDatabaseFlagsStream( - request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSupportedDatabaseFlags stream %j', request); - return this.descriptors.page.listSupportedDatabaseFlags.createStream( - this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSupportedDatabaseFlags`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1.SupportedDatabaseFlag|SupportedDatabaseFlag}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async - */ - listSupportedDatabaseFlagsAsync( - request?: protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSupportedDatabaseFlags iterate %j', request); - return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( - this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Users in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.User|User}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsers( - request?: protos.google.cloud.alloydb.v1.IListUsersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IUser[], - protos.google.cloud.alloydb.v1.IListUsersRequest|null, - protos.google.cloud.alloydb.v1.IListUsersResponse - ]>; - listUsers( - request: protos.google.cloud.alloydb.v1.IListUsersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListUsersRequest, - protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1.IUser>): void; - listUsers( - request: protos.google.cloud.alloydb.v1.IListUsersRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListUsersRequest, - protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1.IUser>): void; - listUsers( - request?: protos.google.cloud.alloydb.v1.IListUsersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1.IListUsersRequest, - protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1.IUser>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1.IListUsersRequest, - protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1.IUser>): - Promise<[ - protos.google.cloud.alloydb.v1.IUser[], - protos.google.cloud.alloydb.v1.IListUsersRequest|null, - protos.google.cloud.alloydb.v1.IListUsersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListUsersRequest, - protos.google.cloud.alloydb.v1.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1.IUser>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listUsers values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listUsers request %j', request); - return this.innerApiCalls - .listUsers(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1.IUser[], - protos.google.cloud.alloydb.v1.IListUsersRequest|null, - protos.google.cloud.alloydb.v1.IListUsersResponse - ]) => { - this._log.info('listUsers values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listUsers`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.User|User} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsersStream( - request?: protos.google.cloud.alloydb.v1.IListUsersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listUsers stream %j', request); - return this.descriptors.page.listUsers.createStream( - this.innerApiCalls.listUsers as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsers`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1.User|User}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.list_users.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListUsers_async - */ - listUsersAsync( - request?: protos.google.cloud.alloydb.v1.IListUsersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listUsers iterate %j', request); - return this.descriptors.page.listUsers.asyncIterate( - this.innerApiCalls['listUsers'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Databases in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1.Database|Database}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabases( - request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1.IDatabase[], - protos.google.cloud.alloydb.v1.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1.IListDatabasesResponse - ]>; - listDatabases( - request: protos.google.cloud.alloydb.v1.IListDatabasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListDatabasesRequest, - protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IDatabase>): void; - listDatabases( - request: protos.google.cloud.alloydb.v1.IListDatabasesRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListDatabasesRequest, - protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IDatabase>): void; - listDatabases( - request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1.IListDatabasesRequest, - protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IDatabase>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1.IListDatabasesRequest, - protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IDatabase>): - Promise<[ - protos.google.cloud.alloydb.v1.IDatabase[], - protos.google.cloud.alloydb.v1.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1.IListDatabasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1.IListDatabasesRequest, - protos.google.cloud.alloydb.v1.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1.IDatabase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDatabases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDatabases request %j', request); - return this.innerApiCalls - .listDatabases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1.IDatabase[], - protos.google.cloud.alloydb.v1.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1.IListDatabasesResponse - ]) => { - this._log.info('listDatabases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDatabases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1.Database|Database} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabasesStream( - request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases stream %j', request); - return this.descriptors.page.listDatabases.createStream( - this.innerApiCalls.listDatabases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatabases`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1.Database|Database}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_admin.list_databases.js - * region_tag:alloydb_v1_generated_AlloyDBAdmin_ListDatabases_async - */ - listDatabasesAsync( - request?: protos.google.cloud.alloydb.v1.IListDatabasesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases iterate %j', request); - return this.descriptors.page.listDatabases.asyncIterate( - this.innerApiCalls['listDatabases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * 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 - * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * 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`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,location:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the location from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the location. - */ - matchLocationFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).location; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified connectionInfo resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - connectionInfoPath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.connectionInfoPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; - } - - /** - * Parse the location from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; - } - - /** - * Parse the cluster from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; - } - - /** - * Parse the instance from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,location:string,cluster:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the location from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).location; - } - - /** - * Parse the cluster from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the cluster from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified supportedDatabaseFlag resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} flag - * @returns {string} Resource name string. - */ - supportedDatabaseFlagPath(project:string,location:string,flag:string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ - project: project, - location: location, - flag: flag, - }); - } - - /** - * Parse the project from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; - } - - /** - * Parse the location from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; - } - - /** - * Parse the flag from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the flag. - */ - matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; - } - - /** - * Return a fully-qualified user resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} user - * @returns {string} Resource name string. - */ - userPath(project:string,location:string,cluster:string,user:string) { - return this.pathTemplates.userPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - user: user, - }); - } - - /** - * Parse the project from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the project. - */ - matchProjectFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).project; - } - - /** - * Parse the location from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the location. - */ - matchLocationFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).location; - } - - /** - * Parse the cluster from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).cluster; - } - - /** - * Parse the user from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the user. - */ - matchUserFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).user; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alloyDBAdminStub && !this._terminated) { - return this.alloyDBAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json deleted file mode 100644 index 9f4d18d5deb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1.AlloyDBAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpgradeCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PromoteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SwitchoverCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestoreCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecondaryCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecondaryInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InjectFault": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExecuteSql": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSupportedDatabaseFlags": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GenerateClientCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetConnectionInfo": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDatabases": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json deleted file mode 100644 index 9d50f544344..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1/csql_resources.proto", - "../../protos/google/cloud/alloydb/v1/csql_service.proto", - "../../protos/google/cloud/alloydb/v1/data_model.proto", - "../../protos/google/cloud/alloydb/v1/resources.proto", - "../../protos/google/cloud/alloydb/v1/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts deleted file mode 100644 index 6b704db7833..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client.ts +++ /dev/null @@ -1,1422 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/alloy_d_b_c_s_q_l_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alloy_d_b_c_s_q_l_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for interactions with CloudSQL. - * @class - * @memberof v1 - */ -export class AlloyDBCSQLAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('alloydb'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - alloyDBCSQLAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlloyDBCSQLAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AlloyDBCSQLAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlloyDBCSQLAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'alloydb.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ), - connectionInfoPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/flags/{flag}' - ), - userPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const restoreFromCloudSQLResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.Cluster') as gax.protobuf.Type; - const restoreFromCloudSQLMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - restoreFromCloudSQL: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreFromCloudSQLResponse.decode.bind(restoreFromCloudSQLResponse), - restoreFromCloudSQLMetadata.decode.bind(restoreFromCloudSQLMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.alloydb.v1.AlloyDBCSQLAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alloyDBCSQLAdminStub) { - return this.alloyDBCSQLAdminStub; - } - - // Put together the "service stub" for - // google.cloud.alloydb.v1.AlloyDBCSQLAdmin. - this.alloyDBCSQLAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1.AlloyDBCSQLAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.alloydb.v1.AlloyDBCSQLAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alloyDBCSQLAdminStubMethods = - ['restoreFromCloudSqL']; - for (const methodName of alloyDBCSQLAdminStubMethods) { - const callPromise = this.alloyDBCSQLAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alloyDBCSQLAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - -/** - * Restores an AlloyDB cluster from a CloudSQL resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1.CloudSQLBackupRunSource} request.cloudsqlBackupRunSource - * Cluster created from CloudSQL backup run. - * @param {string} request.parent - * Required. The location of the new cluster. For the required format, see the - * comment on Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1.Cluster} request.cluster - * Required. The resource being created - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js - * region_tag:alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async - */ - restoreFromCloudSQL( - request?: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreFromCloudSQL( - request: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreFromCloudSQL( - request: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreFromCloudSQL( - request?: protos.google.cloud.alloydb.v1.IRestoreFromCloudSQLRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreFromCloudSQL response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreFromCloudSQL request %j', request); - return this.innerApiCalls.restoreFromCloudSqL(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreFromCloudSQL response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreFromCloudSQL()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js - * region_tag:alloydb_v1_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async - */ - async checkRestoreFromCloudSQLProgress(name: string): Promise>{ - this._log.info('restoreFromCloudSQL long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreFromCloudSQL, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * 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 - * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * 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`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,location:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the location from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the location. - */ - matchLocationFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).location; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified connectionInfo resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - connectionInfoPath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.connectionInfoPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; - } - - /** - * Parse the location from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; - } - - /** - * Parse the cluster from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; - } - - /** - * Parse the instance from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,location:string,cluster:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the location from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).location; - } - - /** - * Parse the cluster from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the cluster from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified supportedDatabaseFlag resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} flag - * @returns {string} Resource name string. - */ - supportedDatabaseFlagPath(project:string,location:string,flag:string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ - project: project, - location: location, - flag: flag, - }); - } - - /** - * Parse the project from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; - } - - /** - * Parse the location from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; - } - - /** - * Parse the flag from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the flag. - */ - matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; - } - - /** - * Return a fully-qualified user resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} user - * @returns {string} Resource name string. - */ - userPath(project:string,location:string,cluster:string,user:string) { - return this.pathTemplates.userPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - user: user, - }); - } - - /** - * Parse the project from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the project. - */ - matchProjectFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).project; - } - - /** - * Parse the location from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the location. - */ - matchLocationFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).location; - } - - /** - * Parse the cluster from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).cluster; - } - - /** - * Parse the user from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the user. - */ - matchUserFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).user; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alloyDBCSQLAdminStub && !this._terminated) { - return this.alloyDBCSQLAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json deleted file mode 100644 index 7d7118bea32..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1.AlloyDBCSQLAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "RestoreFromCloudSQL": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json deleted file mode 100644 index 9d50f544344..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/alloy_d_b_c_s_q_l_admin_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1/csql_resources.proto", - "../../protos/google/cloud/alloydb/v1/csql_service.proto", - "../../protos/google/cloud/alloydb/v1/data_model.proto", - "../../protos/google/cloud/alloydb/v1/resources.proto", - "../../protos/google/cloud/alloydb/v1/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json deleted file mode 100644 index a9cc6ea4db3..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/gapic_metadata.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.alloydb.v1", - "libraryPackage": "@google-cloud/alloydb", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBAdminClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "ExportCluster": { - "methods": [ - "exportCluster" - ] - }, - "ImportCluster": { - "methods": [ - "importCluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgradeCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchoverCluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags", - "listSupportedDatabaseFlagsStream", - "listSupportedDatabaseFlagsAsync" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlloyDBAdminClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "ExportCluster": { - "methods": [ - "exportCluster" - ] - }, - "ImportCluster": { - "methods": [ - "importCluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgradeCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchoverCluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags", - "listSupportedDatabaseFlagsStream", - "listSupportedDatabaseFlagsAsync" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - } - } - } - } - }, - "AlloyDBCSQLAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBCSQLAdminClient", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restoreFromCloudSQL" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlloyDBCSQLAdminClient", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restoreFromCloudSQL" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1/index.ts b/owl-bot-staging/google-cloud-alloydb/src/v1/index.ts deleted file mode 100644 index dd5000cd3cb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {AlloyDBAdminClient} from './alloy_d_b_admin_client'; -export {AlloyDBCSQLAdminClient} from './alloy_d_b_c_s_q_l_admin_client'; diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts deleted file mode 100644 index b99e0fa1f61..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts +++ /dev/null @@ -1,6683 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1alpha/alloy_d_b_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alloy_d_b_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service describing handlers for resources - * @class - * @memberof v1alpha - */ -export class AlloyDBAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('alloydb'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - alloyDBAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlloyDBAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AlloyDBAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlloyDBAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'alloydb.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ), - connectionInfoPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/flags/{flag}' - ), - userPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listClusters: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), - listBackups: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), - listSupportedDatabaseFlags: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'supportedDatabaseFlags'), - listUsers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users'), - listDatabases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const createClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const updateClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const updateClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const exportClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.ExportClusterResponse') as gax.protobuf.Type; - const exportClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const importClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.ImportClusterResponse') as gax.protobuf.Type; - const importClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const upgradeClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.UpgradeClusterResponse') as gax.protobuf.Type; - const upgradeClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const deleteClusterResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const promoteClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const promoteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const switchoverClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const switchoverClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const restoreClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const restoreClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const createSecondaryClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const createSecondaryClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const createSecondaryInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; - const createSecondaryInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const batchCreateInstancesResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.BatchCreateInstancesResponse') as gax.protobuf.Type; - const batchCreateInstancesMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; - const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const failoverInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; - const failoverInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const injectFaultResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; - const injectFaultMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Instance') as gax.protobuf.Type; - const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const createBackupResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Backup') as gax.protobuf.Type; - const createBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const updateBackupResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Backup') as gax.protobuf.Type; - const updateBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - const deleteBackupResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createClusterResponse.decode.bind(createClusterResponse), - createClusterMetadata.decode.bind(createClusterMetadata)), - updateCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateClusterResponse.decode.bind(updateClusterResponse), - updateClusterMetadata.decode.bind(updateClusterMetadata)), - exportCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportClusterResponse.decode.bind(exportClusterResponse), - exportClusterMetadata.decode.bind(exportClusterMetadata)), - importCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importClusterResponse.decode.bind(importClusterResponse), - importClusterMetadata.decode.bind(importClusterMetadata)), - upgradeCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - upgradeClusterResponse.decode.bind(upgradeClusterResponse), - upgradeClusterMetadata.decode.bind(upgradeClusterMetadata)), - deleteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteClusterResponse.decode.bind(deleteClusterResponse), - deleteClusterMetadata.decode.bind(deleteClusterMetadata)), - promoteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - promoteClusterResponse.decode.bind(promoteClusterResponse), - promoteClusterMetadata.decode.bind(promoteClusterMetadata)), - switchoverCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - switchoverClusterResponse.decode.bind(switchoverClusterResponse), - switchoverClusterMetadata.decode.bind(switchoverClusterMetadata)), - restoreCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreClusterResponse.decode.bind(restoreClusterResponse), - restoreClusterMetadata.decode.bind(restoreClusterMetadata)), - createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSecondaryClusterResponse.decode.bind(createSecondaryClusterResponse), - createSecondaryClusterMetadata.decode.bind(createSecondaryClusterMetadata)), - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSecondaryInstanceResponse.decode.bind(createSecondaryInstanceResponse), - createSecondaryInstanceMetadata.decode.bind(createSecondaryInstanceMetadata)), - batchCreateInstances: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), - batchCreateInstancesMetadata.decode.bind(batchCreateInstancesMetadata)), - updateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), - deleteInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), - failoverInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - failoverInstanceResponse.decode.bind(failoverInstanceResponse), - failoverInstanceMetadata.decode.bind(failoverInstanceMetadata)), - injectFault: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - injectFaultResponse.decode.bind(injectFaultResponse), - injectFaultMetadata.decode.bind(injectFaultMetadata)), - restartInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)), - createBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupResponse.decode.bind(createBackupResponse), - createBackupMetadata.decode.bind(createBackupMetadata)), - updateBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupResponse.decode.bind(updateBackupResponse), - updateBackupMetadata.decode.bind(updateBackupMetadata)), - deleteBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupResponse.decode.bind(deleteBackupResponse), - deleteBackupMetadata.decode.bind(deleteBackupMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.alloydb.v1alpha.AlloyDBAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alloyDBAdminStub) { - return this.alloyDBAdminStub; - } - - // Put together the "service stub" for - // google.cloud.alloydb.v1alpha.AlloyDBAdmin. - this.alloyDBAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1alpha.AlloyDBAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.alloydb.v1alpha.AlloyDBAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alloyDBAdminStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'exportCluster', 'importCluster', 'upgradeCluster', 'deleteCluster', 'promoteCluster', 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', 'executeSql', 'listBackups', 'getBackup', 'createBackup', 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', 'listUsers', 'getUser', 'createUser', 'updateUser', 'deleteUser', 'listDatabases', 'createDatabase']; - for (const methodName of alloyDBAdminStubMethods) { - const callPromise = this.alloyDBAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alloyDBAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets details of a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param {google.cloud.alloydb.v1alpha.ClusterView} [request.view] - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetCluster_async - */ - getCluster( - request?: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.cloud.alloydb.v1alpha.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getCluster request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCluster response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getCluster(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.ICluster, - protos.google.cloud.alloydb.v1alpha.IGetClusterRequest|undefined, - {}|undefined - ]) => { - this._log.info('getCluster response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {google.cloud.alloydb.v1alpha.InstanceView} request.view - * The view of the instance to return. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetInstance_async - */ - getInstance( - request?: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request?: protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getInstance request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getInstance response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getInstance(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IInstance, - protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getInstance response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Executes a SQL statement in a database inside an AlloyDB instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.password] - * Optional. The database native user’s password. - * @param {string} request.instance - * Required. The instance where the SQL will be executed. For the required - * format, see the comment on the Instance.name field. - * @param {string} request.database - * 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 {string} request.user - * 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 {string} request.sqlStatement - * Required. SQL statement to execute on database. Any valid statement is - * permitted, including DDL, DML, DQL statements. - * @param {boolean} [request.validateOnly] - * Optional. If set, validates the sql statement by performing - * syntax and semantic validation and doesn't execute the query. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse|ExecuteSqlResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ExecuteSql_async - */ - executeSql( - request?: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|undefined, {}|undefined - ]>; - executeSql( - request: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request?: protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance': request.instance ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeSql request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('executeSql response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.executeSql(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest|undefined, - {}|undefined - ]) => { - this._log.info('executeSql response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetBackup_async - */ - getBackup( - request?: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|undefined, {}|undefined - ]>; - getBackup( - request: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request?: protos.google.cloud.alloydb.v1alpha.IGetBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBackup request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IBackup, - protos.google.cloud.alloydb.v1alpha.IGetBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackup response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @param {string} [request.requestId] - * 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 {string} [request.pemCsr] - * Optional. A pem-encoded X.509 certificate signing request (CSR). It is - * recommended to use public_key instead. - * @param {google.protobuf.Duration} [request.certDuration] - * 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 {string} [request.publicKey] - * Optional. The public key from the client. - * @param {boolean} [request.useMetadataExchange] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse|GenerateClientCertificateResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GenerateClientCertificate_async - */ - generateClientCertificate( - request?: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|undefined, {}|undefined - ]>; - generateClientCertificate( - request: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): void; - generateClientCertificate( - request: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): void; - generateClientCertificate( - request?: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('generateClientCertificate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('generateClientCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.generateClientCertificate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest|undefined, - {}|undefined - ]) => { - this._log.info('generateClientCertificate response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get instance metadata used for a connection. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @param {string} [request.requestId] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.ConnectionInfo|ConnectionInfo}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetConnectionInfo_async - */ - getConnectionInfo( - request?: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|undefined, {}|undefined - ]>; - getConnectionInfo( - request: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): void; - getConnectionInfo( - request: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): void; - getConnectionInfo( - request?: protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getConnectionInfo request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getConnectionInfo response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getConnectionInfo(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IConnectionInfo, - protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest|undefined, - {}|undefined - ]) => { - this._log.info('getConnectionInfo response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.get_user.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_GetUser_async - */ - getUser( - request?: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|undefined, {}|undefined - ]>; - getUser( - request: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request?: protos.google.cloud.alloydb.v1alpha.IGetUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IGetUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('getUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new User in a given project, location, and cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.userId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.User} request.user - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_user.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateUser_async - */ - createUser( - request?: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|undefined, {}|undefined - ]>; - createUser( - request: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request?: protos.google.cloud.alloydb.v1alpha.ICreateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.ICreateUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('createUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the parameters of a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1alpha.User} request.user - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {boolean} [request.allowMissing] - * Optional. Allow missing fields in the update mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_user.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateUser_async - */ - updateUser( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|undefined, {}|undefined - ]>; - updateUser( - request: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'user.name': request.user!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IUser, - protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_user.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteUser_async - */ - deleteUser( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|undefined, {}|undefined - ]>; - deleteUser( - request: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteUser request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new Database in a given project, location, and cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.databaseId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Database} request.database - * Required. The resource being created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1alpha.Database|Database}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_database.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateDatabase_async - */ - createDatabase( - request?: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|undefined, {}|undefined - ]>; - createDatabase( - request: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>): void; - createDatabase( - request: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, - callback: Callback< - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>): void; - createDatabase( - request?: protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createDatabase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createDatabase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createDatabase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1alpha.IDatabase, - protos.google.cloud.alloydb.v1alpha.ICreateDatabaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('createDatabase response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new Cluster in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async - */ - createCluster( - request?: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.cloud.alloydb.v1alpha.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCluster request %j', request); - return this.innerApiCalls.createCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateCluster_async - */ - async checkCreateClusterProgress(name: string): Promise>{ - this._log.info('createCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1alpha.Cluster} request.cluster - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async - */ - updateCluster( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'cluster.name': request.cluster!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCluster request %j', request); - return this.innerApiCalls.updateCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateCluster_async - */ - async checkUpdateClusterProgress(name: string): Promise>{ - this._log.info('updateCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports data from the cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1alpha.GcsDestination} request.gcsDestination - * Required. Option to export data to cloud storage. - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.CsvExportOptions} request.csvExportOptions - * Options for exporting data in CSV format. Required field to be set for - * CSV file type. - * @param {google.cloud.alloydb.v1alpha.ExportClusterRequest.SqlExportOptions} request.sqlExportOptions - * Options for exporting data in SQL format. Required field to be set for - * SQL file type. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {string} request.database - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async - */ - exportCluster( - request?: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportCluster( - request: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportCluster( - request: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportCluster( - request?: protos.google.cloud.alloydb.v1alpha.IExportClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('exportCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('exportCluster request %j', request); - return this.innerApiCalls.exportCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('exportCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `exportCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.export_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ExportCluster_async - */ - async checkExportClusterProgress(name: string): Promise>{ - this._log.info('exportCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports data to the cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.SqlImportOptions} request.sqlImportOptions - * Options for importing data in SQL format. - * @param {google.cloud.alloydb.v1alpha.ImportClusterRequest.CsvImportOptions} request.csvImportOptions - * Options for importing data in CSV format. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {string} request.gcsUri - * 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 {string} [request.database] - * 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 {string} [request.user] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async - */ - importCluster( - request?: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importCluster( - request: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importCluster( - request: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importCluster( - request?: protos.google.cloud.alloydb.v1alpha.IImportClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('importCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importCluster request %j', request); - return this.innerApiCalls.importCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('importCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `importCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.import_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ImportCluster_async - */ - async checkImportClusterProgress(name: string): Promise>{ - this._log.info('importCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Upgrades a single Cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {google.cloud.alloydb.v1alpha.DatabaseVersion} request.version - * Required. The version the cluster is going to be upgraded to. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {string} [request.etag] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async - */ - upgradeCluster( - request?: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - upgradeCluster( - request: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeCluster( - request: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeCluster( - request?: protos.google.cloud.alloydb.v1alpha.IUpgradeClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('upgradeCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('upgradeCluster request %j', request); - return this.innerApiCalls.upgradeCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('upgradeCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `upgradeCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpgradeCluster_async - */ - async checkUpgradeClusterProgress(name: string): Promise>{ - this._log.info('upgradeCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.upgradeCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.force] - * Optional. Whether to cascade delete child instances for given cluster. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCluster request %j', request); - return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteCluster_async - */ - async checkDeleteClusterProgress(name: string): Promise>{ - this._log.info('deleteCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async - */ - promoteCluster( - request?: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - promoteCluster( - request: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteCluster( - request: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteCluster( - request?: protos.google.cloud.alloydb.v1alpha.IPromoteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('promoteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('promoteCluster request %j', request); - return this.innerApiCalls.promoteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('promoteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `promoteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_PromoteCluster_async - */ - async checkPromoteClusterProgress(name: string): Promise>{ - this._log.info('promoteCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async - */ - switchoverCluster( - request?: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - switchoverCluster( - request: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - switchoverCluster( - request: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - switchoverCluster( - request?: protos.google.cloud.alloydb.v1alpha.ISwitchoverClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('switchoverCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('switchoverCluster request %j', request); - return this.innerApiCalls.switchoverCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('switchoverCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `switchoverCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_SwitchoverCluster_async - */ - async checkSwitchoverClusterProgress(name: string): Promise>{ - this._log.info('switchoverCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.switchoverCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1alpha.BackupSource} request.backupSource - * Backup source. - * @param {google.cloud.alloydb.v1alpha.ContinuousBackupSource} request.continuousBackupSource - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async - */ - restoreCluster( - request?: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreCluster( - request: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreCluster( - request: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreCluster( - request?: protos.google.cloud.alloydb.v1alpha.IRestoreClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreCluster request %j', request); - return this.innerApiCalls.restoreCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestoreCluster_async - */ - async checkRestoreClusterProgress(name: string): Promise>{ - this._log.info('restoreCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object (the secondary cluster). - * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster - * Required. Configuration of the requesting object (the secondary cluster). - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async - */ - createSecondaryCluster( - request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSecondaryCluster( - request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryCluster( - request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryCluster( - request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSecondaryCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSecondaryCluster request %j', request); - return this.innerApiCalls.createSecondaryCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSecondaryCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSecondaryCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryCluster_async - */ - async checkCreateSecondaryClusterProgress(name: string): Promise>{ - this._log.info('createSecondaryCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} request.instanceId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Instance} request.instance - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async - */ - createInstance( - request?: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request?: protos.google.cloud.alloydb.v1alpha.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createInstance request %j', request); - return this.innerApiCalls.createInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateInstance_async - */ - async checkCreateInstanceProgress(name: string): Promise>{ - this._log.info('createInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new SECONDARY Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} request.instanceId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Instance} request.instance - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async - */ - createSecondaryInstance( - request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSecondaryInstance( - request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryInstance( - request: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryInstance( - request?: protos.google.cloud.alloydb.v1alpha.ICreateSecondaryInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSecondaryInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSecondaryInstance request %j', request); - return this.innerApiCalls.createSecondaryInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSecondaryInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSecondaryInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateSecondaryInstance_async - */ - async checkCreateSecondaryInstanceProgress(name: string): Promise>{ - this._log.info('createSecondaryInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. - * @param {google.cloud.alloydb.v1alpha.CreateInstanceRequests} request.requests - * Required. Resources being created. - * @param {string} [request.requestId] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async - */ - batchCreateInstances( - request?: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchCreateInstances( - request: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateInstances( - request: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateInstances( - request?: protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('batchCreateInstances response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchCreateInstances request %j', request); - return this.innerApiCalls.batchCreateInstances(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchCreateInstances response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchCreateInstances()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_BatchCreateInstances_async - */ - async checkBatchCreateInstancesProgress(name: string): Promise>{ - this._log.info('batchCreateInstances long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateInstances, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1alpha.Instance} request.instance - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async - */ - updateInstance( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance.name': request.instance!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateInstance request %j', request); - return this.innerApiCalls.updateInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateInstance_async - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - this._log.info('updateInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async - */ - deleteInstance( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteInstance request %j', request); - return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteInstance_async - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - this._log.info('deleteInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async - */ - failoverInstance( - request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - failoverInstance( - request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - failoverInstance( - request: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - failoverInstance( - request?: protos.google.cloud.alloydb.v1alpha.IFailoverInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('failoverInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('failoverInstance request %j', request); - return this.innerApiCalls.failoverInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('failoverInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `failoverInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_FailoverInstance_async - */ - async checkFailoverInstanceProgress(name: string): Promise>{ - this._log.info('failoverInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Injects fault in an instance. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1alpha.InjectFaultRequest.FaultType} request.faultType - * Required. The type of fault to be injected in an instance. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async - */ - injectFault( - request?: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - injectFault( - request: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - injectFault( - request: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - injectFault( - request?: protos.google.cloud.alloydb.v1alpha.IInjectFaultRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('injectFault response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('injectFault request %j', request); - return this.innerApiCalls.injectFault(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('injectFault response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `injectFault()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_InjectFault_async - */ - async checkInjectFaultProgress(name: string): Promise>{ - this._log.info('injectFault long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restart an Instance in a cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {string[]} [request.nodeIds] - * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - * restart upon. Applicable only to read instances. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async - */ - restartInstance( - request?: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartInstance( - request: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request?: protos.google.cloud.alloydb.v1alpha.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restartInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restartInstance request %j', request); - return this.innerApiCalls.restartInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restartInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_RestartInstance_async - */ - async checkRestartInstanceProgress(name: string): Promise>{ - this._log.info('restartInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Backup in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.backupId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Backup} request.backup - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async - */ - createBackup( - request?: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackup( - request: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request?: protos.google.cloud.alloydb.v1alpha.ICreateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackup request %j', request); - return this.innerApiCalls.createBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.create_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_CreateBackup_async - */ - async checkCreateBackupProgress(name: string): Promise>{ - this._log.info('createBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1alpha.Backup} request.backup - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async - */ - updateBackup( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackup( - request: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request?: protos.google.cloud.alloydb.v1alpha.IUpdateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackup request %j', request); - return this.innerApiCalls.updateBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.update_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_UpdateBackup_async - */ - async checkUpdateBackupProgress(name: string): Promise>{ - this._log.info('updateBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {string} [request.etag] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async - */ - deleteBackup( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackup( - request: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request?: protos.google.cloud.alloydb.v1alpha.IDeleteBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackup request %j', request); - return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_DeleteBackup_async - */ - async checkDeleteBackupProgress(name: string): Promise>{ - this._log.info('deleteBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Clusters in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listClustersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listClusters( - request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.ICluster[], - protos.google.cloud.alloydb.v1alpha.IListClustersRequest|null, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse - ]>; - listClusters( - request: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ICluster>): void; - listClusters( - request: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ICluster>): void; - listClusters( - request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ICluster>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ICluster>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.ICluster[], - protos.google.cloud.alloydb.v1alpha.IListClustersRequest|null, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ICluster>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listClusters values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listClusters request %j', request); - return this.innerApiCalls - .listClusters(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1alpha.ICluster[], - protos.google.cloud.alloydb.v1alpha.IListClustersRequest|null, - protos.google.cloud.alloydb.v1alpha.IListClustersResponse - ]) => { - this._log.info('listClusters values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listClusters`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listClustersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listClustersStream( - request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters stream %j', request); - return this.descriptors.page.listClusters.createStream( - this.innerApiCalls.listClusters as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listClusters`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1alpha.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListClusters_async - */ - listClustersAsync( - request?: protos.google.cloud.alloydb.v1alpha.IListClustersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters iterate %j', request); - return this.descriptors.page.listClusters.asyncIterate( - this.innerApiCalls['listClusters'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Instances in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstances( - request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IInstance[], - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse - ]>; - listInstances( - request: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IInstance>): void; - listInstances( - request: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IInstance>): void; - listInstances( - request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IInstance>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IInstance[], - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IInstance>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstances values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstances request %j', request); - return this.innerApiCalls - .listInstances(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1alpha.IInstance[], - protos.google.cloud.alloydb.v1alpha.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1alpha.IListInstancesResponse - ]) => { - this._log.info('listInstances values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstances`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancesStream( - request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances stream %j', request); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstances`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1alpha.Instance|Instance}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_instances.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListInstances_async - */ - listInstancesAsync( - request?: protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances iterate %j', request); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Backups in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackups( - request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IBackup[], - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse - ]>; - listBackups( - request: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IBackup>): void; - listBackups( - request: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IBackup>): void; - listBackups( - request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IBackup>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IBackup>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IBackup[], - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IBackup>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackups values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackups request %j', request); - return this.innerApiCalls - .listBackups(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1alpha.IBackup[], - protos.google.cloud.alloydb.v1alpha.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1alpha.IListBackupsResponse - ]) => { - this._log.info('listBackups values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackups`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupsStream( - request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups stream %j', request); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackups`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1alpha.Backup|Backup}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_backups.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListBackups_async - */ - listBackupsAsync( - request?: protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups iterate %j', request); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag|SupportedDatabaseFlag}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSupportedDatabaseFlagsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSupportedDatabaseFlags( - request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse - ]>; - listSupportedDatabaseFlags( - request: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>): void; - listSupportedDatabaseFlags( - request: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>): void; - listSupportedDatabaseFlags( - request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSupportedDatabaseFlags values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSupportedDatabaseFlags request %j', request); - return this.innerApiCalls - .listSupportedDatabaseFlags(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse - ]) => { - this._log.info('listSupportedDatabaseFlags values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag|SupportedDatabaseFlag} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSupportedDatabaseFlagsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSupportedDatabaseFlagsStream( - request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSupportedDatabaseFlags stream %j', request); - return this.descriptors.page.listSupportedDatabaseFlags.createStream( - this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSupportedDatabaseFlags`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1alpha.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag|SupportedDatabaseFlag}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async - */ - listSupportedDatabaseFlagsAsync( - request?: protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSupportedDatabaseFlags iterate %j', request); - return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( - this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Users in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.User|User}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsers( - request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser[], - protos.google.cloud.alloydb.v1alpha.IListUsersRequest|null, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse - ]>; - listUsers( - request: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IUser>): void; - listUsers( - request: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IUser>): void; - listUsers( - request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IUser>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IUser>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IUser[], - protos.google.cloud.alloydb.v1alpha.IListUsersRequest|null, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IUser>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listUsers values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listUsers request %j', request); - return this.innerApiCalls - .listUsers(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1alpha.IUser[], - protos.google.cloud.alloydb.v1alpha.IListUsersRequest|null, - protos.google.cloud.alloydb.v1alpha.IListUsersResponse - ]) => { - this._log.info('listUsers values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listUsers`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.User|User} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsersStream( - request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listUsers stream %j', request); - return this.descriptors.page.listUsers.createStream( - this.innerApiCalls.listUsers as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsers`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1alpha.User|User}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_users.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListUsers_async - */ - listUsersAsync( - request?: protos.google.cloud.alloydb.v1alpha.IListUsersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listUsers iterate %j', request); - return this.descriptors.page.listUsers.asyncIterate( - this.innerApiCalls['listUsers'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Databases in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1alpha.Database|Database}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabases( - request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IDatabase[], - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse - ]>; - listDatabases( - request: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IDatabase>): void; - listDatabases( - request: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IDatabase>): void; - listDatabases( - request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IDatabase>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IDatabase>): - Promise<[ - protos.google.cloud.alloydb.v1alpha.IDatabase[], - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1alpha.IDatabase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDatabases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDatabases request %j', request); - return this.innerApiCalls - .listDatabases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1alpha.IDatabase[], - protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse - ]) => { - this._log.info('listDatabases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDatabases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1alpha.Database|Database} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabasesStream( - request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases stream %j', request); - return this.descriptors.page.listDatabases.createStream( - this.innerApiCalls.listDatabases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatabases`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1alpha.Database|Database}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_admin.list_databases.js - * region_tag:alloydb_v1alpha_generated_AlloyDBAdmin_ListDatabases_async - */ - listDatabasesAsync( - request?: protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases iterate %j', request); - return this.descriptors.page.listDatabases.asyncIterate( - this.innerApiCalls['listDatabases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * 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 - * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * 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`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,location:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the location from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the location. - */ - matchLocationFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).location; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified connectionInfo resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - connectionInfoPath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.connectionInfoPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; - } - - /** - * Parse the location from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; - } - - /** - * Parse the cluster from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; - } - - /** - * Parse the instance from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,location:string,cluster:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the location from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).location; - } - - /** - * Parse the cluster from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the cluster from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified supportedDatabaseFlag resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} flag - * @returns {string} Resource name string. - */ - supportedDatabaseFlagPath(project:string,location:string,flag:string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ - project: project, - location: location, - flag: flag, - }); - } - - /** - * Parse the project from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; - } - - /** - * Parse the location from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; - } - - /** - * Parse the flag from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the flag. - */ - matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; - } - - /** - * Return a fully-qualified user resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} user - * @returns {string} Resource name string. - */ - userPath(project:string,location:string,cluster:string,user:string) { - return this.pathTemplates.userPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - user: user, - }); - } - - /** - * Parse the project from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the project. - */ - matchProjectFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).project; - } - - /** - * Parse the location from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the location. - */ - matchLocationFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).location; - } - - /** - * Parse the cluster from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).cluster; - } - - /** - * Parse the user from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the user. - */ - matchUserFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).user; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alloyDBAdminStub && !this._terminated) { - return this.alloyDBAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json deleted file mode 100644 index 1d47fe63323..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client_config.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1alpha.AlloyDBAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpgradeCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PromoteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SwitchoverCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestoreCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecondaryCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecondaryInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InjectFault": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExecuteSql": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSupportedDatabaseFlags": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GenerateClientCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetConnectionInfo": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDatabases": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json deleted file mode 100644 index cd27a68e5cc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_proto_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1alpha/csql_resources.proto", - "../../protos/google/cloud/alloydb/v1alpha/csql_service.proto", - "../../protos/google/cloud/alloydb/v1alpha/data_model.proto", - "../../protos/google/cloud/alloydb/v1alpha/gemini.proto", - "../../protos/google/cloud/alloydb/v1alpha/resources.proto", - "../../protos/google/cloud/alloydb/v1alpha/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts deleted file mode 100644 index 940408e18a9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client.ts +++ /dev/null @@ -1,1422 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alloy_d_b_c_s_q_l_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for interactions with CloudSQL. - * @class - * @memberof v1alpha - */ -export class AlloyDBCSQLAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('alloydb'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - alloyDBCSQLAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlloyDBCSQLAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AlloyDBCSQLAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlloyDBCSQLAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'alloydb.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ), - connectionInfoPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/flags/{flag}' - ), - userPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const restoreFromCloudSQLResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.Cluster') as gax.protobuf.Type; - const restoreFromCloudSQLMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1alpha.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - restoreFromCloudSQL: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreFromCloudSQLResponse.decode.bind(restoreFromCloudSQLResponse), - restoreFromCloudSQLMetadata.decode.bind(restoreFromCloudSQLMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alloyDBCSQLAdminStub) { - return this.alloyDBCSQLAdminStub; - } - - // Put together the "service stub" for - // google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin. - this.alloyDBCSQLAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alloyDBCSQLAdminStubMethods = - ['restoreFromCloudSqL']; - for (const methodName of alloyDBCSQLAdminStubMethods) { - const callPromise = this.alloyDBCSQLAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alloyDBCSQLAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - -/** - * Restores an AlloyDB cluster from a CloudSQL resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource} request.cloudsqlBackupRunSource - * Cluster created from CloudSQL backup run. - * @param {string} request.parent - * Required. The location of the new cluster. For the required format, see the - * comment on Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1alpha.Cluster} request.cluster - * Required. The resource being created - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js - * region_tag:alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async - */ - restoreFromCloudSQL( - request?: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreFromCloudSQL( - request: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreFromCloudSQL( - request: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreFromCloudSQL( - request?: protos.google.cloud.alloydb.v1alpha.IRestoreFromCloudSQLRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreFromCloudSQL response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreFromCloudSQL request %j', request); - return this.innerApiCalls.restoreFromCloudSqL(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreFromCloudSQL response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreFromCloudSQL()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1alpha/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js - * region_tag:alloydb_v1alpha_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async - */ - async checkRestoreFromCloudSQLProgress(name: string): Promise>{ - this._log.info('restoreFromCloudSQL long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreFromCloudSQL, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * 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 - * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * 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`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,location:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the location from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the location. - */ - matchLocationFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).location; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified connectionInfo resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - connectionInfoPath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.connectionInfoPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; - } - - /** - * Parse the location from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; - } - - /** - * Parse the cluster from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; - } - - /** - * Parse the instance from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,location:string,cluster:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the location from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).location; - } - - /** - * Parse the cluster from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the cluster from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified supportedDatabaseFlag resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} flag - * @returns {string} Resource name string. - */ - supportedDatabaseFlagPath(project:string,location:string,flag:string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ - project: project, - location: location, - flag: flag, - }); - } - - /** - * Parse the project from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; - } - - /** - * Parse the location from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; - } - - /** - * Parse the flag from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the flag. - */ - matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; - } - - /** - * Return a fully-qualified user resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} user - * @returns {string} Resource name string. - */ - userPath(project:string,location:string,cluster:string,user:string) { - return this.pathTemplates.userPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - user: user, - }); - } - - /** - * Parse the project from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the project. - */ - matchProjectFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).project; - } - - /** - * Parse the location from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the location. - */ - matchLocationFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).location; - } - - /** - * Parse the cluster from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).cluster; - } - - /** - * Parse the user from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the user. - */ - matchUserFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).user; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alloyDBCSQLAdminStub && !this._terminated) { - return this.alloyDBCSQLAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json deleted file mode 100644 index e881759a6af..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1alpha.AlloyDBCSQLAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "RestoreFromCloudSQL": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json deleted file mode 100644 index cd27a68e5cc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/alloy_d_b_c_s_q_l_admin_proto_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1alpha/csql_resources.proto", - "../../protos/google/cloud/alloydb/v1alpha/csql_service.proto", - "../../protos/google/cloud/alloydb/v1alpha/data_model.proto", - "../../protos/google/cloud/alloydb/v1alpha/gemini.proto", - "../../protos/google/cloud/alloydb/v1alpha/resources.proto", - "../../protos/google/cloud/alloydb/v1alpha/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json deleted file mode 100644 index 0fec579ceb0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.alloydb.v1alpha", - "libraryPackage": "@google-cloud/alloydb", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBAdminClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "ExportCluster": { - "methods": [ - "exportCluster" - ] - }, - "ImportCluster": { - "methods": [ - "importCluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgradeCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchoverCluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags", - "listSupportedDatabaseFlagsStream", - "listSupportedDatabaseFlagsAsync" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlloyDBAdminClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "ExportCluster": { - "methods": [ - "exportCluster" - ] - }, - "ImportCluster": { - "methods": [ - "importCluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgradeCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchoverCluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags", - "listSupportedDatabaseFlagsStream", - "listSupportedDatabaseFlagsAsync" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - } - } - } - } - }, - "AlloyDBCSQLAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBCSQLAdminClient", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restoreFromCloudSQL" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlloyDBCSQLAdminClient", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restoreFromCloudSQL" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts deleted file mode 100644 index dd5000cd3cb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1alpha/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {AlloyDBAdminClient} from './alloy_d_b_admin_client'; -export {AlloyDBCSQLAdminClient} from './alloy_d_b_c_s_q_l_admin_client'; diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts deleted file mode 100644 index d88b42c02aa..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts +++ /dev/null @@ -1,6683 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/alloy_d_b_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alloy_d_b_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service describing handlers for resources - * @class - * @memberof v1beta - */ -export class AlloyDBAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('alloydb'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - alloyDBAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlloyDBAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AlloyDBAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlloyDBAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'alloydb.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ), - connectionInfoPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/flags/{flag}' - ), - userPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listClusters: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), - listBackups: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), - listSupportedDatabaseFlags: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'supportedDatabaseFlags'), - listUsers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users'), - listDatabases: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databases') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1beta/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const createClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const updateClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const updateClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const exportClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.ExportClusterResponse') as gax.protobuf.Type; - const exportClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const importClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.ImportClusterResponse') as gax.protobuf.Type; - const importClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const upgradeClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.UpgradeClusterResponse') as gax.protobuf.Type; - const upgradeClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const deleteClusterResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const promoteClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const promoteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const switchoverClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const switchoverClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const restoreClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const restoreClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const createSecondaryClusterResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const createSecondaryClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const createSecondaryInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; - const createSecondaryInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const batchCreateInstancesResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.BatchCreateInstancesResponse') as gax.protobuf.Type; - const batchCreateInstancesMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; - const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const failoverInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; - const failoverInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const injectFaultResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; - const injectFaultMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Instance') as gax.protobuf.Type; - const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const createBackupResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Backup') as gax.protobuf.Type; - const createBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const updateBackupResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Backup') as gax.protobuf.Type; - const updateBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - const deleteBackupResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createClusterResponse.decode.bind(createClusterResponse), - createClusterMetadata.decode.bind(createClusterMetadata)), - updateCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateClusterResponse.decode.bind(updateClusterResponse), - updateClusterMetadata.decode.bind(updateClusterMetadata)), - exportCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportClusterResponse.decode.bind(exportClusterResponse), - exportClusterMetadata.decode.bind(exportClusterMetadata)), - importCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importClusterResponse.decode.bind(importClusterResponse), - importClusterMetadata.decode.bind(importClusterMetadata)), - upgradeCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - upgradeClusterResponse.decode.bind(upgradeClusterResponse), - upgradeClusterMetadata.decode.bind(upgradeClusterMetadata)), - deleteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteClusterResponse.decode.bind(deleteClusterResponse), - deleteClusterMetadata.decode.bind(deleteClusterMetadata)), - promoteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - promoteClusterResponse.decode.bind(promoteClusterResponse), - promoteClusterMetadata.decode.bind(promoteClusterMetadata)), - switchoverCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - switchoverClusterResponse.decode.bind(switchoverClusterResponse), - switchoverClusterMetadata.decode.bind(switchoverClusterMetadata)), - restoreCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreClusterResponse.decode.bind(restoreClusterResponse), - restoreClusterMetadata.decode.bind(restoreClusterMetadata)), - createSecondaryCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSecondaryClusterResponse.decode.bind(createSecondaryClusterResponse), - createSecondaryClusterMetadata.decode.bind(createSecondaryClusterMetadata)), - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - createSecondaryInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSecondaryInstanceResponse.decode.bind(createSecondaryInstanceResponse), - createSecondaryInstanceMetadata.decode.bind(createSecondaryInstanceMetadata)), - batchCreateInstances: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchCreateInstancesResponse.decode.bind(batchCreateInstancesResponse), - batchCreateInstancesMetadata.decode.bind(batchCreateInstancesMetadata)), - updateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), - deleteInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), - failoverInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - failoverInstanceResponse.decode.bind(failoverInstanceResponse), - failoverInstanceMetadata.decode.bind(failoverInstanceMetadata)), - injectFault: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - injectFaultResponse.decode.bind(injectFaultResponse), - injectFaultMetadata.decode.bind(injectFaultMetadata)), - restartInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)), - createBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupResponse.decode.bind(createBackupResponse), - createBackupMetadata.decode.bind(createBackupMetadata)), - updateBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupResponse.decode.bind(updateBackupResponse), - updateBackupMetadata.decode.bind(updateBackupMetadata)), - deleteBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupResponse.decode.bind(deleteBackupResponse), - deleteBackupMetadata.decode.bind(deleteBackupMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.alloydb.v1beta.AlloyDBAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alloyDBAdminStub) { - return this.alloyDBAdminStub; - } - - // Put together the "service stub" for - // google.cloud.alloydb.v1beta.AlloyDBAdmin. - this.alloyDBAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1beta.AlloyDBAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.alloydb.v1beta.AlloyDBAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alloyDBAdminStubMethods = - ['listClusters', 'getCluster', 'createCluster', 'updateCluster', 'exportCluster', 'importCluster', 'upgradeCluster', 'deleteCluster', 'promoteCluster', 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', 'executeSql', 'listBackups', 'getBackup', 'createBackup', 'updateBackup', 'deleteBackup', 'listSupportedDatabaseFlags', 'generateClientCertificate', 'getConnectionInfo', 'listUsers', 'getUser', 'createUser', 'updateUser', 'deleteUser', 'listDatabases', 'createDatabase']; - for (const methodName of alloyDBAdminStubMethods) { - const callPromise = this.alloyDBAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alloyDBAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets details of a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param {google.cloud.alloydb.v1beta.ClusterView} [request.view] - * Optional. The view of the cluster to return. Returns all default fields if - * not set. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.get_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_async - */ - getCluster( - request?: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.cloud.alloydb.v1beta.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getCluster request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCluster response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getCluster(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.ICluster, - protos.google.cloud.alloydb.v1beta.IGetClusterRequest|undefined, - {}|undefined - ]) => { - this._log.info('getCluster response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {google.cloud.alloydb.v1beta.InstanceView} request.view - * The view of the instance to return. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Instance|Instance}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.get_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_async - */ - getInstance( - request?: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request?: protos.google.cloud.alloydb.v1beta.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getInstance request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getInstance response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getInstance(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IInstance, - protos.google.cloud.alloydb.v1beta.IGetInstanceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getInstance response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Executes a SQL statement in a database inside an AlloyDB instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.password] - * Optional. The database native user’s password. - * @param {string} request.instance - * Required. The instance where the SQL will be executed. For the required - * format, see the comment on the Instance.name field. - * @param {string} request.database - * 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 {string} request.user - * 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 {string} request.sqlStatement - * Required. SQL statement to execute on database. Any valid statement is - * permitted, including DDL, DML, DQL statements. - * @param {boolean} [request.validateOnly] - * Optional. If set, validates the sql statement by performing - * syntax and semantic validation and doesn't execute the query. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse|ExecuteSqlResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.execute_sql.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_async - */ - executeSql( - request?: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|undefined, {}|undefined - ]>; - executeSql( - request: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): void; - executeSql( - request?: protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance': request.instance ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('executeSql request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('executeSql response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.executeSql(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, - protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest|undefined, - {}|undefined - ]) => { - this._log.info('executeSql response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.get_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_async - */ - getBackup( - request?: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|undefined, {}|undefined - ]>; - getBackup( - request: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request?: protos.google.cloud.alloydb.v1beta.IGetBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getBackup request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IBackup, - protos.google.cloud.alloydb.v1beta.IGetBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackup response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. The required format is: - * * projects/{project}/locations/{location}/clusters/{cluster} - * @param {string} [request.requestId] - * 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 {string} [request.pemCsr] - * Optional. A pem-encoded X.509 certificate signing request (CSR). It is - * recommended to use public_key instead. - * @param {google.protobuf.Duration} [request.certDuration] - * 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 {string} [request.publicKey] - * Optional. The public key from the client. - * @param {boolean} [request.useMetadataExchange] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse|GenerateClientCertificateResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async - */ - generateClientCertificate( - request?: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|undefined, {}|undefined - ]>; - generateClientCertificate( - request: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): void; - generateClientCertificate( - request: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): void; - generateClientCertificate( - request?: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('generateClientCertificate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('generateClientCertificate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.generateClientCertificate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, - protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest|undefined, - {}|undefined - ]) => { - this._log.info('generateClientCertificate response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Get instance metadata used for a connection. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. The required format is: - * projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance} - * @param {string} [request.requestId] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.ConnectionInfo|ConnectionInfo}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_async - */ - getConnectionInfo( - request?: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|undefined, {}|undefined - ]>; - getConnectionInfo( - request: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): void; - getConnectionInfo( - request: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): void; - getConnectionInfo( - request?: protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getConnectionInfo request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getConnectionInfo response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getConnectionInfo(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IConnectionInfo, - protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest|undefined, - {}|undefined - ]) => { - this._log.info('getConnectionInfo response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets details of a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.get_user.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_GetUser_async - */ - getUser( - request?: protos.google.cloud.alloydb.v1beta.IGetUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|undefined, {}|undefined - ]>; - getUser( - request: protos.google.cloud.alloydb.v1beta.IGetUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request: protos.google.cloud.alloydb.v1beta.IGetUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request?: protos.google.cloud.alloydb.v1beta.IGetUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IGetUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('getUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new User in a given project, location, and cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.userId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.User} request.user - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_user.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_async - */ - createUser( - request?: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|undefined, {}|undefined - ]>; - createUser( - request: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request?: protos.google.cloud.alloydb.v1beta.ICreateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.ICreateUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('createUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the parameters of a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1beta.User} request.user - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {boolean} [request.allowMissing] - * Optional. Allow missing fields in the update mask. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.User|User}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_user.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_async - */ - updateUser( - request?: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|undefined, {}|undefined - ]>; - updateUser( - request: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request?: protos.google.cloud.alloydb.v1beta.IUpdateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'user.name': request.user!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateUser request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IUser, - protos.google.cloud.alloydb.v1beta.IUpdateUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes a single User. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the User.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_user.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_async - */ - deleteUser( - request?: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|undefined, {}|undefined - ]>; - deleteUser( - request: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request?: protos.google.cloud.alloydb.v1beta.IDeleteUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteUser request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteUser response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteUser(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.alloydb.v1beta.IDeleteUserRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteUser response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Creates a new Database in a given project, location, and cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.databaseId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Database} request.database - * Required. The resource being created. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.alloydb.v1beta.Database|Database}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_database.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_async - */ - createDatabase( - request?: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|undefined, {}|undefined - ]>; - createDatabase( - request: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>): void; - createDatabase( - request: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, - callback: Callback< - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>): void; - createDatabase( - request?: protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('createDatabase request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createDatabase response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createDatabase(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.alloydb.v1beta.IDatabase, - protos.google.cloud.alloydb.v1beta.ICreateDatabaseRequest|undefined, - {}|undefined - ]) => { - this._log.info('createDatabase response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new Cluster in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the new cluster. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async - */ - createCluster( - request?: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.cloud.alloydb.v1beta.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCluster request %j', request); - return this.innerApiCalls.createCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_async - */ - async checkCreateClusterProgress(name: string): Promise>{ - this._log.info('createCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1beta.Cluster} request.cluster - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async - */ - updateCluster( - request?: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.cloud.alloydb.v1beta.IUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'cluster.name': request.cluster!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCluster request %j', request); - return this.innerApiCalls.updateCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_async - */ - async checkUpdateClusterProgress(name: string): Promise>{ - this._log.info('updateCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Exports data from the cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1beta.GcsDestination} request.gcsDestination - * Required. Option to export data to cloud storage. - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptions} request.csvExportOptions - * Options for exporting data in CSV format. Required field to be set for - * CSV file type. - * @param {google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptions} request.sqlExportOptions - * Options for exporting data in SQL format. Required field to be set for - * SQL file type. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {string} request.database - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.export_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async - */ - exportCluster( - request?: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportCluster( - request: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportCluster( - request: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportCluster( - request?: protos.google.cloud.alloydb.v1beta.IExportClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('exportCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('exportCluster request %j', request); - return this.innerApiCalls.exportCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('exportCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `exportCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.export_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_async - */ - async checkExportClusterProgress(name: string): Promise>{ - this._log.info('exportCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports data to the cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptions} request.sqlImportOptions - * Options for importing data in SQL format. - * @param {google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptions} request.csvImportOptions - * Options for importing data in CSV format. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {string} request.gcsUri - * 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 {string} [request.database] - * 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 {string} [request.user] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.import_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async - */ - importCluster( - request?: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importCluster( - request: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importCluster( - request: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importCluster( - request?: protos.google.cloud.alloydb.v1beta.IImportClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('importCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importCluster request %j', request); - return this.innerApiCalls.importCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('importCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `importCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.import_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_async - */ - async checkImportClusterProgress(name: string): Promise>{ - this._log.info('importCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Upgrades a single Cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the cluster. - * @param {google.cloud.alloydb.v1beta.DatabaseVersion} request.version - * Required. The version the cluster is going to be upgraded to. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {string} [request.etag] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async - */ - upgradeCluster( - request?: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - upgradeCluster( - request: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeCluster( - request: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeCluster( - request?: protos.google.cloud.alloydb.v1beta.IUpgradeClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('upgradeCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('upgradeCluster request %j', request); - return this.innerApiCalls.upgradeCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('upgradeCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `upgradeCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_async - */ - async checkUpgradeClusterProgress(name: string): Promise>{ - this._log.info('upgradeCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.upgradeCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.force] - * Optional. Whether to cascade delete child instances for given cluster. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.cloud.alloydb.v1beta.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCluster request %j', request); - return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_async - */ - async checkDeleteClusterProgress(name: string): Promise>{ - this._log.info('deleteCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Promotes a SECONDARY cluster. This turns down replication - * from the PRIMARY cluster and promotes a secondary cluster - * into its own standalone cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async - */ - promoteCluster( - request?: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - promoteCluster( - request: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteCluster( - request: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteCluster( - request?: protos.google.cloud.alloydb.v1beta.IPromoteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('promoteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('promoteCluster request %j', request); - return this.innerApiCalls.promoteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('promoteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `promoteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_async - */ - async checkPromoteClusterProgress(name: string): Promise>{ - this._log.info('promoteCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.promoteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Cluster.name field - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async - */ - switchoverCluster( - request?: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - switchoverCluster( - request: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - switchoverCluster( - request: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - switchoverCluster( - request?: protos.google.cloud.alloydb.v1beta.ISwitchoverClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('switchoverCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('switchoverCluster request %j', request); - return this.innerApiCalls.switchoverCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('switchoverCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `switchoverCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_async - */ - async checkSwitchoverClusterProgress(name: string): Promise>{ - this._log.info('switchoverCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.switchoverCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1beta.BackupSource} request.backupSource - * Backup source. - * @param {google.cloud.alloydb.v1beta.ContinuousBackupSource} request.continuousBackupSource - * ContinuousBackup source. Continuous backup needs to be enabled in the - * source cluster for this operation to succeed. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async - */ - restoreCluster( - request?: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreCluster( - request: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreCluster( - request: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreCluster( - request?: protos.google.cloud.alloydb.v1beta.IRestoreClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreCluster request %j', request); - return this.innerApiCalls.restoreCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_async - */ - async checkRestoreClusterProgress(name: string): Promise>{ - this._log.info('restoreCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a cluster of type SECONDARY in the given location using - * the primary cluster as the source. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of the new cluster. For the required - * format, see the comment on the Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object (the secondary cluster). - * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster - * Required. Configuration of the requesting object (the secondary cluster). - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async - */ - createSecondaryCluster( - request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSecondaryCluster( - request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryCluster( - request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryCluster( - request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSecondaryCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSecondaryCluster request %j', request); - return this.innerApiCalls.createSecondaryCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSecondaryCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSecondaryCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_async - */ - async checkCreateSecondaryClusterProgress(name: string): Promise>{ - this._log.info('createSecondaryCluster long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} request.instanceId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Instance} request.instance - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async - */ - createInstance( - request?: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request?: protos.google.cloud.alloydb.v1beta.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createInstance request %j', request); - return this.innerApiCalls.createInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_async - */ - async checkCreateInstanceProgress(name: string): Promise>{ - this._log.info('createInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new SECONDARY Instance in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} request.instanceId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Instance} request.instance - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async - */ - createSecondaryInstance( - request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSecondaryInstance( - request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryInstance( - request: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSecondaryInstance( - request?: protos.google.cloud.alloydb.v1beta.ICreateSecondaryInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSecondaryInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSecondaryInstance request %j', request); - return this.innerApiCalls.createSecondaryInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSecondaryInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSecondaryInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_async - */ - async checkCreateSecondaryInstanceProgress(name: string): Promise>{ - this._log.info('createSecondaryInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecondaryInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent resource. - * @param {google.cloud.alloydb.v1beta.CreateInstanceRequests} request.requests - * Required. Resources being created. - * @param {string} [request.requestId] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async - */ - batchCreateInstances( - request?: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchCreateInstances( - request: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateInstances( - request: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchCreateInstances( - request?: protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('batchCreateInstances response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchCreateInstances request %j', request); - return this.innerApiCalls.batchCreateInstances(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchCreateInstances response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchCreateInstances()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_async - */ - async checkBatchCreateInstancesProgress(name: string): Promise>{ - this._log.info('batchCreateInstances long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateInstances, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1beta.Instance} request.instance - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async - */ - updateInstance( - request?: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request?: protos.google.cloud.alloydb.v1beta.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'instance.name': request.instance!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateInstance request %j', request); - return this.innerApiCalls.updateInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_async - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - this._log.info('updateInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {string} [request.etag] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async - */ - deleteInstance( - request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request?: protos.google.cloud.alloydb.v1beta.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteInstance request %j', request); - return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_async - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - this._log.info('deleteInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Forces a Failover for a highly available instance. - * Failover promotes the HA standby instance as the new primary. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async - */ - failoverInstance( - request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - failoverInstance( - request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - failoverInstance( - request: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - failoverInstance( - request?: protos.google.cloud.alloydb.v1beta.IFailoverInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('failoverInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('failoverInstance request %j', request); - return this.innerApiCalls.failoverInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('failoverInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `failoverInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.failover_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_async - */ - async checkFailoverInstanceProgress(name: string): Promise>{ - this._log.info('failoverInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.failoverInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Injects fault in an instance. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1beta.InjectFaultRequest.FaultType} request.faultType - * Required. The type of fault to be injected in an instance. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.inject_fault.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async - */ - injectFault( - request?: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - injectFault( - request: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - injectFault( - request: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - injectFault( - request?: protos.google.cloud.alloydb.v1beta.IInjectFaultRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('injectFault response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('injectFault request %j', request); - return this.innerApiCalls.injectFault(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('injectFault response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `injectFault()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.inject_fault.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_async - */ - async checkInjectFaultProgress(name: string): Promise>{ - this._log.info('injectFault long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.injectFault, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restart an Instance in a cluster. - * Imperative only. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the resource. For the required format, see the - * comment on the Instance.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * 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 {string[]} [request.nodeIds] - * Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - * restart upon. Applicable only to read instances. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.restart_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async - */ - restartInstance( - request?: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartInstance( - request: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request?: protos.google.cloud.alloydb.v1beta.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restartInstance response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restartInstance request %j', request); - return this.innerApiCalls.restartInstance(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restartInstance response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.restart_instance.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_async - */ - async checkRestartInstanceProgress(name: string): Promise>{ - this._log.info('restartInstance long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new Backup in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.backupId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Backup} request.backup - * Required. The resource being created - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async - */ - createBackup( - request?: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackup( - request: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request?: protos.google.cloud.alloydb.v1beta.ICreateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackup request %j', request); - return this.innerApiCalls.createBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.create_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_async - */ - async checkCreateBackupProgress(name: string): Promise>{ - this._log.info('createBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * 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 {google.cloud.alloydb.v1beta.Backup} request.backup - * Required. The resource being updated - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {boolean} [request.allowMissing] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async - */ - updateBackup( - request?: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackup( - request: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request?: protos.google.cloud.alloydb.v1beta.IUpdateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackup request %j', request); - return this.innerApiCalls.updateBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.update_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_async - */ - async checkUpdateBackupProgress(name: string): Promise>{ - this._log.info('updateBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource. For the required format, see the comment on - * the Backup.name field. - * @param {string} [request.requestId] - * 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 {boolean} [request.validateOnly] - * Optional. If set, the backend validates the request, but doesn't actually - * execute it. - * @param {string} [request.etag] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async - */ - deleteBackup( - request?: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackup( - request: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request?: protos.google.cloud.alloydb.v1beta.IDeleteBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackup request %j', request); - return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.delete_backup.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_async - */ - async checkDeleteBackupProgress(name: string): Promise>{ - this._log.info('deleteBackup long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Clusters in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listClustersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listClusters( - request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.ICluster[], - protos.google.cloud.alloydb.v1beta.IListClustersRequest|null, - protos.google.cloud.alloydb.v1beta.IListClustersResponse - ]>; - listClusters( - request: protos.google.cloud.alloydb.v1beta.IListClustersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListClustersRequest, - protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ICluster>): void; - listClusters( - request: protos.google.cloud.alloydb.v1beta.IListClustersRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListClustersRequest, - protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ICluster>): void; - listClusters( - request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListClustersRequest, - protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ICluster>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListClustersRequest, - protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ICluster>): - Promise<[ - protos.google.cloud.alloydb.v1beta.ICluster[], - protos.google.cloud.alloydb.v1beta.IListClustersRequest|null, - protos.google.cloud.alloydb.v1beta.IListClustersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListClustersRequest, - protos.google.cloud.alloydb.v1beta.IListClustersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ICluster>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listClusters values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listClusters request %j', request); - return this.innerApiCalls - .listClusters(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1beta.ICluster[], - protos.google.cloud.alloydb.v1beta.IListClustersRequest|null, - protos.google.cloud.alloydb.v1beta.IListClustersResponse - ]) => { - this._log.info('listClusters values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listClusters`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listClustersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listClustersStream( - request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters stream %j', request); - return this.descriptors.page.listClusters.createStream( - this.innerApiCalls.listClusters as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listClusters`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1beta.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.list_clusters.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_async - */ - listClustersAsync( - request?: protos.google.cloud.alloydb.v1beta.IListClustersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters iterate %j', request); - return this.descriptors.page.listClusters.asyncIterate( - this.innerApiCalls['listClusters'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Instances in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Instance|Instance}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstances( - request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IInstance[], - protos.google.cloud.alloydb.v1beta.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse - ]>; - listInstances( - request: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IInstance>): void; - listInstances( - request: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IInstance>): void; - listInstances( - request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IInstance>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IInstance[], - protos.google.cloud.alloydb.v1beta.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IInstance>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listInstances values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listInstances request %j', request); - return this.innerApiCalls - .listInstances(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1beta.IInstance[], - protos.google.cloud.alloydb.v1beta.IListInstancesRequest|null, - protos.google.cloud.alloydb.v1beta.IListInstancesResponse - ]) => { - this._log.info('listInstances values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listInstances`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Instance|Instance} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listInstancesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listInstancesStream( - request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances stream %j', request); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstances`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1beta.Instance|Instance}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.list_instances.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_async - */ - listInstancesAsync( - request?: protos.google.cloud.alloydb.v1beta.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listInstances iterate %j', request); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Backups in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Backup|Backup}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackups( - request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IBackup[], - protos.google.cloud.alloydb.v1beta.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse - ]>; - listBackups( - request: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IBackup>): void; - listBackups( - request: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IBackup>): void; - listBackups( - request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IBackup>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IBackup>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IBackup[], - protos.google.cloud.alloydb.v1beta.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IBackup>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackups values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackups request %j', request); - return this.innerApiCalls - .listBackups(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1beta.IBackup[], - protos.google.cloud.alloydb.v1beta.IListBackupsRequest|null, - protos.google.cloud.alloydb.v1beta.IListBackupsResponse - ]) => { - this._log.info('listBackups values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackups`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Backup|Backup} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listBackupsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listBackupsStream( - request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups stream %j', request); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackups`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListBackupsRequest - * @param {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {string} request.filter - * Filtering results - * @param {string} request.orderBy - * Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1beta.Backup|Backup}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.list_backups.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_async - */ - listBackupsAsync( - request?: protos.google.cloud.alloydb.v1beta.IListBackupsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups iterate %j', request); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists SupportedDatabaseFlags for a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag|SupportedDatabaseFlag}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSupportedDatabaseFlagsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSupportedDatabaseFlags( - request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse - ]>; - listSupportedDatabaseFlags( - request: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>): void; - listSupportedDatabaseFlags( - request: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>): void; - listSupportedDatabaseFlags( - request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>): - Promise<[ - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSupportedDatabaseFlags values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSupportedDatabaseFlags request %j', request); - return this.innerApiCalls - .listSupportedDatabaseFlags(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest|null, - protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse - ]) => { - this._log.info('listSupportedDatabaseFlags values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag|SupportedDatabaseFlag} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSupportedDatabaseFlagsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSupportedDatabaseFlagsStream( - request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSupportedDatabaseFlags stream %j', request); - return this.descriptors.page.listSupportedDatabaseFlags.createStream( - this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSupportedDatabaseFlags`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * 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 {number} request.pageSize - * Requested page size. Server may return fewer items than requested. - * If unspecified, server will pick an appropriate default. - * @param {string} request.pageToken - * A token identifying a page of results the server should return. - * @param {google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope} [request.scope] - * Optional. The scope for which supported flags are requested. If not - * specified, default is DATABASE. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag|SupportedDatabaseFlag}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_async - */ - listSupportedDatabaseFlagsAsync( - request?: protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSupportedDatabaseFlags iterate %j', request); - return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( - this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Users in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.User|User}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsers( - request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser[], - protos.google.cloud.alloydb.v1beta.IListUsersRequest|null, - protos.google.cloud.alloydb.v1beta.IListUsersResponse - ]>; - listUsers( - request: protos.google.cloud.alloydb.v1beta.IListUsersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListUsersRequest, - protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IUser>): void; - listUsers( - request: protos.google.cloud.alloydb.v1beta.IListUsersRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListUsersRequest, - protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IUser>): void; - listUsers( - request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListUsersRequest, - protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IUser>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListUsersRequest, - protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IUser>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IUser[], - protos.google.cloud.alloydb.v1beta.IListUsersRequest|null, - protos.google.cloud.alloydb.v1beta.IListUsersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListUsersRequest, - protos.google.cloud.alloydb.v1beta.IListUsersResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IUser>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listUsers values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listUsers request %j', request); - return this.innerApiCalls - .listUsers(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1beta.IUser[], - protos.google.cloud.alloydb.v1beta.IListUsersRequest|null, - protos.google.cloud.alloydb.v1beta.IListUsersResponse - ]) => { - this._log.info('listUsers values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listUsers`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.User|User} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsersStream( - request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listUsers stream %j', request); - return this.descriptors.page.listUsers.createStream( - this.innerApiCalls.listUsers as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsers`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListUsersRequest - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1beta.User|User}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.list_users.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_async - */ - listUsersAsync( - request?: protos.google.cloud.alloydb.v1beta.IListUsersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listUsers iterate %j', request); - return this.descriptors.page.listUsers.asyncIterate( - this.innerApiCalls['listUsers'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Databases in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.alloydb.v1beta.Database|Database}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabases( - request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.alloydb.v1beta.IDatabase[], - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse - ]>; - listDatabases( - request: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IDatabase>): void; - listDatabases( - request: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - callback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IDatabase>): void; - listDatabases( - request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IDatabase>, - callback?: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IDatabase>): - Promise<[ - protos.google.cloud.alloydb.v1beta.IDatabase[], - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse|null|undefined, - protos.google.cloud.alloydb.v1beta.IDatabase>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDatabases values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDatabases request %j', request); - return this.innerApiCalls - .listDatabases(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.alloydb.v1beta.IDatabase[], - protos.google.cloud.alloydb.v1beta.IListDatabasesRequest|null, - protos.google.cloud.alloydb.v1beta.IListDatabasesResponse - ]) => { - this._log.info('listDatabases values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDatabases`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.alloydb.v1beta.Database|Database} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listDatabasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listDatabasesStream( - request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases stream %j', request); - return this.descriptors.page.listDatabases.createStream( - this.innerApiCalls.listDatabases as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDatabases`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent value for ListDatabasesRequest. - * @param {number} [request.pageSize] - * 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 {string} [request.pageToken] - * 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 {string} [request.filter] - * Optional. Filtering results. - * This field is currently not supported, its value will be ignored if passed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.alloydb.v1beta.Database|Database}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_admin.list_databases.js - * region_tag:alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_async - */ - listDatabasesAsync( - request?: protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDatabases']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDatabases iterate %j', request); - return this.descriptors.page.listDatabases.asyncIterate( - this.innerApiCalls['listDatabases'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * 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 - * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * 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`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,location:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the location from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the location. - */ - matchLocationFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).location; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified connectionInfo resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - connectionInfoPath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.connectionInfoPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; - } - - /** - * Parse the location from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; - } - - /** - * Parse the cluster from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; - } - - /** - * Parse the instance from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,location:string,cluster:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the location from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).location; - } - - /** - * Parse the cluster from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the cluster from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified supportedDatabaseFlag resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} flag - * @returns {string} Resource name string. - */ - supportedDatabaseFlagPath(project:string,location:string,flag:string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ - project: project, - location: location, - flag: flag, - }); - } - - /** - * Parse the project from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; - } - - /** - * Parse the location from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; - } - - /** - * Parse the flag from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the flag. - */ - matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; - } - - /** - * Return a fully-qualified user resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} user - * @returns {string} Resource name string. - */ - userPath(project:string,location:string,cluster:string,user:string) { - return this.pathTemplates.userPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - user: user, - }); - } - - /** - * Parse the project from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the project. - */ - matchProjectFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).project; - } - - /** - * Parse the location from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the location. - */ - matchLocationFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).location; - } - - /** - * Parse the cluster from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).cluster; - } - - /** - * Parse the user from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the user. - */ - matchUserFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).user; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alloyDBAdminStub && !this._terminated) { - return this.alloyDBAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json deleted file mode 100644 index 353aa21106c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client_config.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1beta.AlloyDBAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExportCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpgradeCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PromoteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SwitchoverCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestoreCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecondaryCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateSecondaryInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchCreateInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InjectFault": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ExecuteSql": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSupportedDatabaseFlags": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GenerateClientCertificate": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetConnectionInfo": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDatabases": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - }, - "CreateDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json deleted file mode 100644 index 8b640e7d02b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_proto_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1beta/csql_resources.proto", - "../../protos/google/cloud/alloydb/v1beta/csql_service.proto", - "../../protos/google/cloud/alloydb/v1beta/data_model.proto", - "../../protos/google/cloud/alloydb/v1beta/gemini.proto", - "../../protos/google/cloud/alloydb/v1beta/resources.proto", - "../../protos/google/cloud/alloydb/v1beta/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts deleted file mode 100644 index f998ac8f4b3..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client.ts +++ /dev/null @@ -1,1422 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './alloy_d_b_c_s_q_l_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for interactions with CloudSQL. - * @class - * @memberof v1beta - */ -export class AlloyDBCSQLAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('alloydb'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - alloyDBCSQLAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AlloyDBCSQLAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new AlloyDBCSQLAdminClient({fallback: true}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof AlloyDBCSQLAdminClient; - if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { - throw new Error('Please set either universe_domain or universeDomain, but not both.'); - } - const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; - this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; - this._servicePath = 'alloydb.' + this._universeDomain; - const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}' - ), - connectionInfoPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo' - ), - databasePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - supportedDatabaseFlagPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/flags/{flag}' - ), - userPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/clusters/{cluster}/users/{user}' - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1beta/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const restoreFromCloudSQLResponse = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.Cluster') as gax.protobuf.Type; - const restoreFromCloudSQLMetadata = protoFilesRoot.lookup( - '.google.cloud.alloydb.v1beta.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - restoreFromCloudSQL: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreFromCloudSQLResponse.decode.bind(restoreFromCloudSQLResponse), - restoreFromCloudSQLMetadata.decode.bind(restoreFromCloudSQLMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.alloyDBCSQLAdminStub) { - return this.alloyDBCSQLAdminStub; - } - - // Put together the "service stub" for - // google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin. - this.alloyDBCSQLAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alloyDBCSQLAdminStubMethods = - ['restoreFromCloudSqL']; - for (const methodName of alloyDBCSQLAdminStubMethods) { - const callPromise = this.alloyDBCSQLAdminStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.alloyDBCSQLAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); - } - return 'alloydb.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - -/** - * Restores an AlloyDB cluster from a CloudSQL resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.alloydb.v1beta.CloudSQLBackupRunSource} request.cloudsqlBackupRunSource - * Cluster created from CloudSQL backup run. - * @param {string} request.parent - * Required. The location of the new cluster. For the required format, see the - * comment on Cluster.name field. - * @param {string} request.clusterId - * Required. ID of the requesting object. - * @param {google.cloud.alloydb.v1beta.Cluster} request.cluster - * Required. The resource being created - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js - * region_tag:alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async - */ - restoreFromCloudSQL( - request?: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreFromCloudSQL( - request: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreFromCloudSQL( - request: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreFromCloudSQL( - request?: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('restoreFromCloudSQL response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreFromCloudSQL request %j', request); - return this.innerApiCalls.restoreFromCloudSqL(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreFromCloudSQL response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreFromCloudSQL()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/alloy_d_b_c_s_q_l_admin.restore_from_cloud_s_q_l.js - * region_tag:alloydb_v1beta_generated_AlloyDBCSQLAdmin_RestoreFromCloudSQL_async - */ - async checkRestoreFromCloudSQLProgress(name: string): Promise>{ - this._log.info('restoreFromCloudSQL long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreFromCloudSQL, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * 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 - * {@link 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 {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * 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`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,location:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the location from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the location. - */ - matchLocationFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).location; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified connectionInfo resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - connectionInfoPath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.connectionInfoPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).project; - } - - /** - * Parse the location from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).location; - } - - /** - * Parse the cluster from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).cluster; - } - - /** - * Parse the instance from ConnectionInfo resource. - * - * @param {string} connectionInfoName - * A fully-qualified path representing ConnectionInfo resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromConnectionInfoName(connectionInfoName: string) { - return this.pathTemplates.connectionInfoPathTemplate.match(connectionInfoName).instance; - } - - /** - * Return a fully-qualified database resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} database - * @returns {string} Resource name string. - */ - databasePath(project:string,location:string,cluster:string,database:string) { - return this.pathTemplates.databasePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - database: database, - }); - } - - /** - * Parse the project from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).project; - } - - /** - * Parse the location from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).location; - } - - /** - * Parse the cluster from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).cluster; - } - - /** - * Parse the database from Database resource. - * - * @param {string} databaseName - * A fully-qualified path representing Database resource. - * @returns {string} A string representing the database. - */ - matchDatabaseFromDatabaseName(databaseName: string) { - return this.pathTemplates.databasePathTemplate.match(databaseName).database; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,cluster:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - cluster: cluster, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the cluster from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).cluster; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified supportedDatabaseFlag resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} flag - * @returns {string} Resource name string. - */ - supportedDatabaseFlagPath(project:string,location:string,flag:string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.render({ - project: project, - location: location, - flag: flag, - }); - } - - /** - * Parse the project from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).project; - } - - /** - * Parse the location from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).location; - } - - /** - * Parse the flag from SupportedDatabaseFlag resource. - * - * @param {string} supportedDatabaseFlagName - * A fully-qualified path representing SupportedDatabaseFlag resource. - * @returns {string} A string representing the flag. - */ - matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string) { - return this.pathTemplates.supportedDatabaseFlagPathTemplate.match(supportedDatabaseFlagName).flag; - } - - /** - * Return a fully-qualified user resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} cluster - * @param {string} user - * @returns {string} Resource name string. - */ - userPath(project:string,location:string,cluster:string,user:string) { - return this.pathTemplates.userPathTemplate.render({ - project: project, - location: location, - cluster: cluster, - user: user, - }); - } - - /** - * Parse the project from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the project. - */ - matchProjectFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).project; - } - - /** - * Parse the location from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the location. - */ - matchLocationFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).location; - } - - /** - * Parse the cluster from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).cluster; - } - - /** - * Parse the user from User resource. - * - * @param {string} userName - * A fully-qualified path representing User resource. - * @returns {string} A string representing the user. - */ - matchUserFromUserName(userName: string) { - return this.pathTemplates.userPathTemplate.match(userName).user; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.alloyDBCSQLAdminStub && !this._terminated) { - return this.alloyDBCSQLAdminStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json deleted file mode 100644 index 8da946a0a96..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "RestoreFromCloudSQL": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json deleted file mode 100644 index 8b640e7d02b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/alloy_d_b_c_s_q_l_admin_proto_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1beta/csql_resources.proto", - "../../protos/google/cloud/alloydb/v1beta/csql_service.proto", - "../../protos/google/cloud/alloydb/v1beta/data_model.proto", - "../../protos/google/cloud/alloydb/v1beta/gemini.proto", - "../../protos/google/cloud/alloydb/v1beta/resources.proto", - "../../protos/google/cloud/alloydb/v1beta/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json deleted file mode 100644 index bd4da19419f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/gapic_metadata.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.alloydb.v1beta", - "libraryPackage": "@google-cloud/alloydb", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBAdminClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "ExportCluster": { - "methods": [ - "exportCluster" - ] - }, - "ImportCluster": { - "methods": [ - "importCluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgradeCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchoverCluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags", - "listSupportedDatabaseFlagsStream", - "listSupportedDatabaseFlagsAsync" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlloyDBAdminClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ExecuteSql": { - "methods": [ - "executeSql" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generateClientCertificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "getConnectionInfo" - ] - }, - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "ExportCluster": { - "methods": [ - "exportCluster" - ] - }, - "ImportCluster": { - "methods": [ - "importCluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgradeCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchoverCluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restoreCluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "createSecondaryCluster" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "createSecondaryInstance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batchCreateInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "FailoverInstance": { - "methods": [ - "failoverInstance" - ] - }, - "InjectFault": { - "methods": [ - "injectFault" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "listSupportedDatabaseFlags", - "listSupportedDatabaseFlagsStream", - "listSupportedDatabaseFlagsAsync" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases", - "listDatabasesStream", - "listDatabasesAsync" - ] - } - } - } - } - }, - "AlloyDBCSQLAdmin": { - "clients": { - "grpc": { - "libraryClient": "AlloyDBCSQLAdminClient", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restoreFromCloudSQL" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AlloyDBCSQLAdminClient", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restoreFromCloudSQL" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts b/owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts deleted file mode 100644 index dd5000cd3cb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/src/v1beta/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {AlloyDBAdminClient} from './alloy_d_b_admin_client'; -export {AlloyDBCSQLAdminClient} from './alloy_d_b_c_s_q_l_admin_client'; diff --git a/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 601c54db846..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const alloydb = require('@google-cloud/alloydb'); - -function main() { - const alloyDBAdminClient = new alloydb.AlloyDBAdminClient(); - const alloyDBCSQLAdminClient = new alloydb.AlloyDBCSQLAdminClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index a1b508a0e5c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {AlloyDBAdminClient, AlloyDBCSQLAdminClient} from '@google-cloud/alloydb'; - -// check that the client class type name can be used -function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { - client.close(); -} -function doStuffWithAlloyDBCSQLAdminClient(client: AlloyDBCSQLAdminClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const alloyDBAdminClient = new AlloyDBAdminClient(); - doStuffWithAlloyDBAdminClient(alloyDBAdminClient); - // check that the client instance can be created - const alloyDBCSQLAdminClient = new AlloyDBCSQLAdminClient(); - doStuffWithAlloyDBCSQLAdminClient(alloyDBCSQLAdminClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts deleted file mode 100644 index 3519b7eefbc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts +++ /dev/null @@ -1,7199 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as alloydbadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.AlloyDBAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = alloydbadminModule.v1.AlloyDBAdminClient.servicePath; - assert.strictEqual(servicePath, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = alloydbadminModule.v1.AlloyDBAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbadminModule.v1.AlloyDBAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new alloydbadminModule.v1.AlloyDBAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = alloydbadminModule.v1.AlloyDBAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBAdminStub, undefined); - await client.initialize(); - assert(client.alloyDBAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.alloyDBAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getInstance(request), expectedError); - }); - }); - - describe('executeSql', () => { - it('invokes executeSql without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExecuteSqlResponse() - ); - client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); - const [response] = await client.executeSql(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExecuteSqlResponse() - ); - client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.executeSql( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IExecuteSqlResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.executeSql(request), expectedError); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.executeSql(request), expectedError); - }); - }); - - describe('getBackup', () => { - it('invokes getBackup without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); - const [response] = await client.getBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackup( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackup(request), expectedError); - }); - }); - - describe('generateClientCertificate', () => { - it('invokes generateClientCertificate without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse() - ); - client.innerApiCalls.generateClientCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.generateClientCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse() - ); - client.innerApiCalls.generateClientCertificate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.generateClientCertificate( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateClientCertificate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.generateClientCertificate(request), expectedError); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.generateClientCertificate(request), expectedError); - }); - }); - - describe('getConnectionInfo', () => { - it('invokes getConnectionInfo without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ConnectionInfo() - ); - client.innerApiCalls.getConnectionInfo = stubSimpleCall(expectedResponse); - const [response] = await client.getConnectionInfo(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ConnectionInfo() - ); - client.innerApiCalls.getConnectionInfo = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConnectionInfo( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IConnectionInfo|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConnectionInfo = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConnectionInfo(request), expectedError); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getConnectionInfo(request), expectedError); - }); - }); - - describe('getUser', () => { - it('invokes getUser without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.User() - ); - client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); - const [response] = await client.getUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.User() - ); - client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getUser(request), expectedError); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getUser(request), expectedError); - }); - }); - - describe('createUser', () => { - it('invokes createUser without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.User() - ); - client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); - const [response] = await client.createUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.User() - ); - client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createUser(request), expectedError); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createUser(request), expectedError); - }); - }); - - describe('updateUser', () => { - it('invokes updateUser without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.User() - ); - client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); - const [response] = await client.updateUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1.User() - ); - client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateUser(request), expectedError); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateUser(request), expectedError); - }); - }); - - describe('deleteUser', () => { - it('invokes deleteUser without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); - const [response] = await client.deleteUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteUser( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteUser(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with closed client', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteUser(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportCluster', () => { - it('invokes exportCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkExportClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importCluster', () => { - it('invokes importCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.importCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('upgradeCluster', () => { - it('invokes upgradeCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.upgradeCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.upgradeCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upgradeCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.upgradeCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.upgradeCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpgradeClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpgradeClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpgradeClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpgradeClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('promoteCluster', () => { - it('invokes promoteCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.promoteCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.promoteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.promoteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkPromoteClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPromoteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPromoteClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPromoteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('switchoverCluster', () => { - it('invokes switchoverCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.switchoverCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.switchoverCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.switchoverCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.switchoverCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.switchoverCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSwitchoverClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkSwitchoverClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSwitchoverClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkSwitchoverClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createSecondaryCluster', () => { - it('invokes createSecondaryCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecondaryCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSecondaryCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSecondaryCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSecondaryClusterProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSecondaryClusterProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSecondaryClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createSecondaryInstance', () => { - it('invokes createSecondaryInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecondaryInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSecondaryInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSecondaryInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSecondaryInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSecondaryInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSecondaryInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchCreateInstances', () => { - it('invokes batchCreateInstances without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateInstances(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateInstances( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateInstances(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchCreateInstancesProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateInstancesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchCreateInstancesProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchCreateInstancesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('failoverInstance', () => { - it('invokes failoverInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.failoverInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.failoverInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.failoverInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.failoverInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.failoverInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkFailoverInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkFailoverInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkFailoverInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkFailoverInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('injectFault', () => { - it('invokes injectFault without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); - const [operation] = await client.injectFault(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.injectFault( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.injectFault = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.injectFault(request), expectedError); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.injectFault = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.injectFault(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkInjectFaultProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkInjectFaultProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkInjectFaultProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkInjectFaultProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackup', () => { - it('invokes createBackup without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with call error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with LRO error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupProgress without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupProgress with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.ICluster[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClustersStream without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - ]; - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listClustersStream with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), - ]; - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; - const iterable = client.listClustersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.ICluster[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstancesStream with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackups( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupsStream without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - ]; - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupsStream with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), - ]; - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; - const iterable = client.listBackupsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSupportedDatabaseFlags', () => { - it('invokes listSupportedDatabaseFlags without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - ]; - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(expectedResponse); - const [response] = await client.listSupportedDatabaseFlags(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlags without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - ]; - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSupportedDatabaseFlags( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlags with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSupportedDatabaseFlags(request), expectedError); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlagsStream without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - ]; - client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSupportedDatabaseFlagsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSupportedDatabaseFlagsStream with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSupportedDatabaseFlagsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.SupportedDatabaseFlag) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSupportedDatabaseFlags without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag()), - ]; - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = []; - const iterable = client.listSupportedDatabaseFlagsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSupportedDatabaseFlags with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSupportedDatabaseFlagsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listUsers', () => { - it('invokes listUsers without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); - const [response] = await client.listUsers(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsers( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IUser[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsers(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsersStream without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - ]; - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.User[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsersStream with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.User[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), - ]; - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.IUser[] = []; - const iterable = client.listUsersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.IUser[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDatabases', () => { - it('invokes listDatabases without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); - const [response] = await client.listDatabases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatabases( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1.IDatabase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatabases(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabasesStream without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - ]; - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Database[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDatabasesStream with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1.Database[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), - ]; - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1.IDatabase[] = []; - const iterable = client.listDatabasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatabasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1.IDatabase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup: "backupValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', async () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromClusterName', () => { - const result = client.matchLocationFromClusterName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('connectionInfo', async () => { - const fakePath = "/rendered/path/connectionInfo"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.connectionInfoPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionInfoPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionInfoPath', () => { - const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionInfoName', () => { - const result = client.matchProjectFromConnectionInfoName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionInfoName', () => { - const result = client.matchLocationFromConnectionInfoName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromConnectionInfoName', () => { - const result = client.matchClusterFromConnectionInfoName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromConnectionInfoName', () => { - const result = client.matchInstanceFromConnectionInfoName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - database: "databaseValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatabaseName', () => { - const result = client.matchLocationFromDatabaseName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromDatabaseName', () => { - const result = client.matchClusterFromDatabaseName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromInstanceName', () => { - const result = client.matchClusterFromInstanceName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('supportedDatabaseFlag', async () => { - const fakePath = "/rendered/path/supportedDatabaseFlag"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - flag: "flagValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.supportedDatabaseFlagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.supportedDatabaseFlagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('supportedDatabaseFlagPath', () => { - const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSupportedDatabaseFlagName', () => { - const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSupportedDatabaseFlagName', () => { - const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFlagFromSupportedDatabaseFlagName', () => { - const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "flagValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('user', async () => { - const fakePath = "/rendered/path/user"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - user: "userValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.userPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.userPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('userPath', () => { - const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.userPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromUserName', () => { - const result = client.matchProjectFromUserName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromUserName', () => { - const result = client.matchLocationFromUserName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromUserName', () => { - const result = client.matchClusterFromUserName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserFromUserName', () => { - const result = client.matchUserFromUserName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts deleted file mode 100644 index 76aa6227cde..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts +++ /dev/null @@ -1,7307 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as alloydbadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1alpha.AlloyDBAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = alloydbadminModule.v1alpha.AlloyDBAdminClient.servicePath; - assert.strictEqual(servicePath, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = alloydbadminModule.v1alpha.AlloyDBAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new alloydbadminModule.v1alpha.AlloyDBAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = alloydbadminModule.v1alpha.AlloyDBAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBAdminStub, undefined); - await client.initialize(); - assert(client.alloyDBAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.alloyDBAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getInstance(request), expectedError); - }); - }); - - describe('executeSql', () => { - it('invokes executeSql without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse() - ); - client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); - const [response] = await client.executeSql(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse() - ); - client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.executeSql( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.executeSql(request), expectedError); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.executeSql(request), expectedError); - }); - }); - - describe('getBackup', () => { - it('invokes getBackup without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); - const [response] = await client.getBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackup( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackup(request), expectedError); - }); - }); - - describe('generateClientCertificate', () => { - it('invokes generateClientCertificate without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse() - ); - client.innerApiCalls.generateClientCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.generateClientCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse() - ); - client.innerApiCalls.generateClientCertificate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.generateClientCertificate( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateClientCertificate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.generateClientCertificate(request), expectedError); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.generateClientCertificate(request), expectedError); - }); - }); - - describe('getConnectionInfo', () => { - it('invokes getConnectionInfo without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ConnectionInfo() - ); - client.innerApiCalls.getConnectionInfo = stubSimpleCall(expectedResponse); - const [response] = await client.getConnectionInfo(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ConnectionInfo() - ); - client.innerApiCalls.getConnectionInfo = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConnectionInfo( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IConnectionInfo|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConnectionInfo = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConnectionInfo(request), expectedError); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getConnectionInfo(request), expectedError); - }); - }); - - describe('getUser', () => { - it('invokes getUser without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.User() - ); - client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); - const [response] = await client.getUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.User() - ); - client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getUser(request), expectedError); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getUser(request), expectedError); - }); - }); - - describe('createUser', () => { - it('invokes createUser without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.User() - ); - client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); - const [response] = await client.createUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.User() - ); - client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createUser(request), expectedError); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createUser(request), expectedError); - }); - }); - - describe('updateUser', () => { - it('invokes updateUser without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.User() - ); - client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); - const [response] = await client.updateUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.User() - ); - client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateUser(request), expectedError); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateUser(request), expectedError); - }); - }); - - describe('deleteUser', () => { - it('invokes deleteUser without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); - const [response] = await client.deleteUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteUser( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteUser(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteUser(request), expectedError); - }); - }); - - describe('createDatabase', () => { - it('invokes createDatabase without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Database() - ); - client.innerApiCalls.createDatabase = stubSimpleCall(expectedResponse); - const [response] = await client.createDatabase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.Database() - ); - client.innerApiCalls.createDatabase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDatabase( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IDatabase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDatabase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase with closed client', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createDatabase(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportCluster', () => { - it('invokes exportCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkExportClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importCluster', () => { - it('invokes importCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.importCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('upgradeCluster', () => { - it('invokes upgradeCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.upgradeCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.upgradeCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upgradeCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.upgradeCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.upgradeCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpgradeClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpgradeClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpgradeClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpgradeClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('promoteCluster', () => { - it('invokes promoteCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.promoteCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.promoteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.promoteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkPromoteClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPromoteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPromoteClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPromoteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('switchoverCluster', () => { - it('invokes switchoverCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.switchoverCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.switchoverCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.switchoverCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.switchoverCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.switchoverCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSwitchoverClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkSwitchoverClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSwitchoverClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkSwitchoverClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createSecondaryCluster', () => { - it('invokes createSecondaryCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecondaryCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSecondaryCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSecondaryCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSecondaryClusterProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSecondaryClusterProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSecondaryClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createSecondaryInstance', () => { - it('invokes createSecondaryInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecondaryInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSecondaryInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSecondaryInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSecondaryInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSecondaryInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSecondaryInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchCreateInstances', () => { - it('invokes batchCreateInstances without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateInstances(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateInstances( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateInstances(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchCreateInstancesProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateInstancesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchCreateInstancesProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchCreateInstancesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('failoverInstance', () => { - it('invokes failoverInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.failoverInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.failoverInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.failoverInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.failoverInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.failoverInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkFailoverInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkFailoverInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkFailoverInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkFailoverInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('injectFault', () => { - it('invokes injectFault without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); - const [operation] = await client.injectFault(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.injectFault( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.injectFault = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.injectFault(request), expectedError); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.injectFault = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.injectFault(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkInjectFaultProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkInjectFaultProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkInjectFaultProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkInjectFaultProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackup', () => { - it('invokes createBackup without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with call error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with LRO error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupProgress without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupProgress with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.ICluster[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClustersStream without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - ]; - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listClustersStream with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Cluster()), - ]; - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; - const iterable = client.listClustersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.ICluster[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstancesStream with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Instance[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackups( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupsStream without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - ]; - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupsStream with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), - ]; - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; - const iterable = client.listBackupsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSupportedDatabaseFlags', () => { - it('invokes listSupportedDatabaseFlags without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - ]; - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(expectedResponse); - const [response] = await client.listSupportedDatabaseFlags(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlags without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - ]; - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSupportedDatabaseFlags( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlags with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSupportedDatabaseFlags(request), expectedError); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlagsStream without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - ]; - client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSupportedDatabaseFlagsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSupportedDatabaseFlagsStream with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSupportedDatabaseFlagsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSupportedDatabaseFlags without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag()), - ]; - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = []; - const iterable = client.listSupportedDatabaseFlagsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSupportedDatabaseFlags with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSupportedDatabaseFlagsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listUsers', () => { - it('invokes listUsers without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); - const [response] = await client.listUsers(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsers( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IUser[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsers(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsersStream without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - ]; - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.User[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsersStream with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.User[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), - ]; - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.IUser[] = []; - const iterable = client.listUsersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.IUser[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDatabases', () => { - it('invokes listDatabases without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); - const [response] = await client.listDatabases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatabases( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1alpha.IDatabase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatabases(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabasesStream without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - ]; - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Database[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDatabasesStream with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1alpha.Database[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1alpha.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Database()), - ]; - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1alpha.IDatabase[] = []; - const iterable = client.listDatabasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatabasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1alpha.IDatabase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup: "backupValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', async () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromClusterName', () => { - const result = client.matchLocationFromClusterName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('connectionInfo', async () => { - const fakePath = "/rendered/path/connectionInfo"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.connectionInfoPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionInfoPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionInfoPath', () => { - const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionInfoName', () => { - const result = client.matchProjectFromConnectionInfoName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionInfoName', () => { - const result = client.matchLocationFromConnectionInfoName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromConnectionInfoName', () => { - const result = client.matchClusterFromConnectionInfoName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromConnectionInfoName', () => { - const result = client.matchInstanceFromConnectionInfoName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - database: "databaseValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatabaseName', () => { - const result = client.matchLocationFromDatabaseName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromDatabaseName', () => { - const result = client.matchClusterFromDatabaseName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromInstanceName', () => { - const result = client.matchClusterFromInstanceName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('supportedDatabaseFlag', async () => { - const fakePath = "/rendered/path/supportedDatabaseFlag"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - flag: "flagValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.supportedDatabaseFlagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.supportedDatabaseFlagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('supportedDatabaseFlagPath', () => { - const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSupportedDatabaseFlagName', () => { - const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSupportedDatabaseFlagName', () => { - const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFlagFromSupportedDatabaseFlagName', () => { - const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "flagValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('user', async () => { - const fakePath = "/rendered/path/user"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - user: "userValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.userPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.userPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('userPath', () => { - const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.userPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromUserName', () => { - const result = client.matchProjectFromUserName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromUserName', () => { - const result = client.matchLocationFromUserName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromUserName', () => { - const result = client.matchClusterFromUserName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserFromUserName', () => { - const result = client.matchUserFromUserName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts deleted file mode 100644 index 4e5ce268f3c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts +++ /dev/null @@ -1,7307 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as alloydbadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.AlloyDBAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = alloydbadminModule.v1beta.AlloyDBAdminClient.servicePath; - assert.strictEqual(servicePath, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = alloydbadminModule.v1beta.AlloyDBAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new alloydbadminModule.v1beta.AlloyDBAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = alloydbadminModule.v1beta.AlloyDBAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBAdminStub, undefined); - await client.initialize(); - assert(client.alloyDBAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.alloyDBAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getInstance(request), expectedError); - }); - }); - - describe('executeSql', () => { - it('invokes executeSql without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse() - ); - client.innerApiCalls.executeSql = stubSimpleCall(expectedResponse); - const [response] = await client.executeSql(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse() - ); - client.innerApiCalls.executeSql = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.executeSql( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.executeSql = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.executeSql(request), expectedError); - const actualRequest = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.executeSql as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes executeSql with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExecuteSqlRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExecuteSqlRequest', ['instance']); - request.instance = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.executeSql(request), expectedError); - }); - }); - - describe('getBackup', () => { - it('invokes getBackup without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); - const [response] = await client.getBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackup( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackup(request), expectedError); - }); - }); - - describe('generateClientCertificate', () => { - it('invokes generateClientCertificate without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse() - ); - client.innerApiCalls.generateClientCertificate = stubSimpleCall(expectedResponse); - const [response] = await client.generateClientCertificate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse() - ); - client.innerApiCalls.generateClientCertificate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.generateClientCertificate( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateClientCertificate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.generateClientCertificate(request), expectedError); - const actualRequest = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateClientCertificate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateClientCertificate with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.generateClientCertificate(request), expectedError); - }); - }); - - describe('getConnectionInfo', () => { - it('invokes getConnectionInfo without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ConnectionInfo() - ); - client.innerApiCalls.getConnectionInfo = stubSimpleCall(expectedResponse); - const [response] = await client.getConnectionInfo(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ConnectionInfo() - ); - client.innerApiCalls.getConnectionInfo = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConnectionInfo( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IConnectionInfo|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConnectionInfo = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConnectionInfo(request), expectedError); - const actualRequest = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionInfo with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetConnectionInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetConnectionInfoRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getConnectionInfo(request), expectedError); - }); - }); - - describe('getUser', () => { - it('invokes getUser without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.User() - ); - client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); - const [response] = await client.getUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.User() - ); - client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getUser(request), expectedError); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getUser(request), expectedError); - }); - }); - - describe('createUser', () => { - it('invokes createUser without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.User() - ); - client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); - const [response] = await client.createUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.User() - ); - client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createUser(request), expectedError); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createUser(request), expectedError); - }); - }); - - describe('updateUser', () => { - it('invokes updateUser without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.User() - ); - client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); - const [response] = await client.updateUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.User() - ); - client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateUser( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateUser(request), expectedError); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateUser(request), expectedError); - }); - }); - - describe('deleteUser', () => { - it('invokes deleteUser without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); - const [response] = await client.deleteUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteUser( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteUser(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteUser(request), expectedError); - }); - }); - - describe('createDatabase', () => { - it('invokes createDatabase without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Database() - ); - client.innerApiCalls.createDatabase = stubSimpleCall(expectedResponse); - const [response] = await client.createDatabase(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.Database() - ); - client.innerApiCalls.createDatabase = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDatabase( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IDatabase|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDatabase = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDatabase(request), expectedError); - const actualRequest = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDatabase as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDatabase with closed client', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateDatabaseRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateDatabaseRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createDatabase(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportCluster', () => { - it('invokes exportCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ExportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ExportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkExportClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importCluster', () => { - it('invokes importCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.importCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ImportClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ImportClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkImportClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('upgradeCluster', () => { - it('invokes upgradeCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.upgradeCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.upgradeCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upgradeCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.upgradeCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upgradeCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpgradeClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpgradeClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.upgradeCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upgradeCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpgradeClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpgradeClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpgradeClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpgradeClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('promoteCluster', () => { - it('invokes promoteCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.promoteCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.promoteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.PromoteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.PromoteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.promoteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkPromoteClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPromoteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPromoteClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkPromoteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('switchoverCluster', () => { - it('invokes switchoverCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.switchoverCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.switchoverCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.switchoverCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.switchoverCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes switchoverCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.SwitchoverClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.SwitchoverClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.switchoverCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.switchoverCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.switchoverCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSwitchoverClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkSwitchoverClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSwitchoverClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkSwitchoverClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createSecondaryCluster', () => { - it('invokes createSecondaryCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecondaryCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSecondaryCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryCluster with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSecondaryCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSecondaryClusterProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSecondaryClusterProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSecondaryClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createSecondaryInstance', () => { - it('invokes createSecondaryInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSecondaryInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSecondaryInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSecondaryInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSecondaryInstance with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateSecondaryInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSecondaryInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSecondaryInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSecondaryInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSecondaryInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSecondaryInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSecondaryInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateSecondaryInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchCreateInstances', () => { - it('invokes batchCreateInstances without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchCreateInstances(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchCreateInstances = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchCreateInstances( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchCreateInstances with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.BatchCreateInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateInstances = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateInstances(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchCreateInstancesProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBatchCreateInstancesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchCreateInstancesProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBatchCreateInstancesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateInstance with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('failoverInstance', () => { - it('invokes failoverInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.failoverInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.failoverInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.failoverInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.failoverInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.failoverInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes failoverInstance with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.FailoverInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.FailoverInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.failoverInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.failoverInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.failoverInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkFailoverInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkFailoverInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkFailoverInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkFailoverInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('injectFault', () => { - it('invokes injectFault without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.injectFault = stubLongRunningCall(expectedResponse); - const [operation] = await client.injectFault(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.injectFault = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.injectFault( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.injectFault = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.injectFault(request), expectedError); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes injectFault with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.InjectFaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.InjectFaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.injectFault = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.injectFault(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.injectFault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkInjectFaultProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkInjectFaultProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkInjectFaultProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkInjectFaultProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartInstance with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestartInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestartInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackup', () => { - it('invokes createBackup without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with call error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with LRO error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupProgress without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupProgress with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.ICluster[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClustersStream without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - ]; - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listClustersStream with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), - ]; - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; - const iterable = client.listClustersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.ICluster[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstances with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - const actualRequest = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listInstancesStream with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Instance[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackups( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupsStream without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - ]; - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupsStream with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Backup[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), - ]; - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; - const iterable = client.listBackupsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSupportedDatabaseFlags', () => { - it('invokes listSupportedDatabaseFlags without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - ]; - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(expectedResponse); - const [response] = await client.listSupportedDatabaseFlags(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlags without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - ]; - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSupportedDatabaseFlags( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlags with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSupportedDatabaseFlags(request), expectedError); - const actualRequest = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSupportedDatabaseFlags as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSupportedDatabaseFlagsStream without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - ]; - client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSupportedDatabaseFlagsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSupportedDatabaseFlagsStream with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSupportedDatabaseFlagsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSupportedDatabaseFlags, request)); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSupportedDatabaseFlags without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag()), - ]; - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = []; - const iterable = client.listSupportedDatabaseFlagsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSupportedDatabaseFlags with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSupportedDatabaseFlagsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSupportedDatabaseFlags.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listUsers', () => { - it('invokes listUsers without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); - const [response] = await client.listUsers(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsers( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IUser[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsers(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsersStream without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - ]; - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.User[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsersStream with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.User[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), - ]; - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.IUser[] = []; - const iterable = client.listUsersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.IUser[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDatabases', () => { - it('invokes listDatabases without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCall(expectedResponse); - const [response] = await client.listDatabases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - ]; - client.innerApiCalls.listDatabases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDatabases( - request, - (err?: Error|null, result?: protos.google.cloud.alloydb.v1beta.IDatabase[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabases with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatabases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatabases(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatabases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDatabasesStream without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - ]; - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Database[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDatabasesStream with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDatabasesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.alloydb.v1beta.Database[] = []; - stream.on('data', (response: protos.google.cloud.alloydb.v1beta.Database) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDatabases, request)); - assert( - (client.descriptors.page.listDatabases.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Database()), - ]; - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.alloydb.v1beta.IDatabase[] = []; - const iterable = client.listDatabasesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDatabases with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.ListDatabasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.ListDatabasesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDatabasesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.alloydb.v1beta.IDatabase[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDatabases.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup: "backupValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', async () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromClusterName', () => { - const result = client.matchLocationFromClusterName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('connectionInfo', async () => { - const fakePath = "/rendered/path/connectionInfo"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.connectionInfoPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionInfoPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionInfoPath', () => { - const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionInfoName', () => { - const result = client.matchProjectFromConnectionInfoName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionInfoName', () => { - const result = client.matchLocationFromConnectionInfoName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromConnectionInfoName', () => { - const result = client.matchClusterFromConnectionInfoName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromConnectionInfoName', () => { - const result = client.matchInstanceFromConnectionInfoName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - database: "databaseValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatabaseName', () => { - const result = client.matchLocationFromDatabaseName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromDatabaseName', () => { - const result = client.matchClusterFromDatabaseName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromInstanceName', () => { - const result = client.matchClusterFromInstanceName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('supportedDatabaseFlag', async () => { - const fakePath = "/rendered/path/supportedDatabaseFlag"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - flag: "flagValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.supportedDatabaseFlagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.supportedDatabaseFlagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('supportedDatabaseFlagPath', () => { - const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSupportedDatabaseFlagName', () => { - const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSupportedDatabaseFlagName', () => { - const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFlagFromSupportedDatabaseFlagName', () => { - const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "flagValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('user', async () => { - const fakePath = "/rendered/path/user"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - user: "userValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.userPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.userPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('userPath', () => { - const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.userPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromUserName', () => { - const result = client.matchProjectFromUserName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromUserName', () => { - const result = client.matchLocationFromUserName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromUserName', () => { - const result = client.matchClusterFromUserName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserFromUserName', () => { - const result = client.matchUserFromUserName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts deleted file mode 100644 index bba7f6897e7..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1.ts +++ /dev/null @@ -1,1522 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as alloydbcsqladminModule from '../src'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.AlloyDBCSQLAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient.servicePath; - assert.strictEqual(servicePath, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); - await client.initialize(); - assert(client.alloyDBCSQLAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.alloyDBCSQLAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('restoreFromCloudSQL', () => { - it('invokes restoreFromCloudSQL without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreFromCloudSQL(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreFromCloudSQL( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL with call error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreFromCloudSQL(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL with LRO error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreFromCloudSQL(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreFromCloudSQLProgress without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreFromCloudSQLProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreFromCloudSQLProgress with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreFromCloudSQLProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup: "backupValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', async () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromClusterName', () => { - const result = client.matchLocationFromClusterName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('connectionInfo', async () => { - const fakePath = "/rendered/path/connectionInfo"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.connectionInfoPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionInfoPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionInfoPath', () => { - const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionInfoName', () => { - const result = client.matchProjectFromConnectionInfoName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionInfoName', () => { - const result = client.matchLocationFromConnectionInfoName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromConnectionInfoName', () => { - const result = client.matchClusterFromConnectionInfoName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromConnectionInfoName', () => { - const result = client.matchInstanceFromConnectionInfoName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - database: "databaseValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatabaseName', () => { - const result = client.matchLocationFromDatabaseName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromDatabaseName', () => { - const result = client.matchClusterFromDatabaseName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromInstanceName', () => { - const result = client.matchClusterFromInstanceName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('supportedDatabaseFlag', async () => { - const fakePath = "/rendered/path/supportedDatabaseFlag"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - flag: "flagValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.supportedDatabaseFlagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.supportedDatabaseFlagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('supportedDatabaseFlagPath', () => { - const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSupportedDatabaseFlagName', () => { - const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSupportedDatabaseFlagName', () => { - const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFlagFromSupportedDatabaseFlagName', () => { - const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "flagValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('user', async () => { - const fakePath = "/rendered/path/user"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - user: "userValue", - }; - const client = new alloydbcsqladminModule.v1.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.userPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.userPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('userPath', () => { - const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.userPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromUserName', () => { - const result = client.matchProjectFromUserName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromUserName', () => { - const result = client.matchLocationFromUserName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromUserName', () => { - const result = client.matchClusterFromUserName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserFromUserName', () => { - const result = client.matchUserFromUserName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts deleted file mode 100644 index 81760b330d5..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1alpha.ts +++ /dev/null @@ -1,1522 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as alloydbcsqladminModule from '../src'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1alpha.AlloyDBCSQLAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient.servicePath; - assert.strictEqual(servicePath, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); - await client.initialize(); - assert(client.alloyDBCSQLAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.alloyDBCSQLAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('restoreFromCloudSQL', () => { - it('invokes restoreFromCloudSQL without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreFromCloudSQL(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreFromCloudSQL( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL with call error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreFromCloudSQL(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL with LRO error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1alpha.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreFromCloudSQL(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreFromCloudSQLProgress without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreFromCloudSQLProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreFromCloudSQLProgress with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreFromCloudSQLProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup: "backupValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', async () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromClusterName', () => { - const result = client.matchLocationFromClusterName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('connectionInfo', async () => { - const fakePath = "/rendered/path/connectionInfo"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.connectionInfoPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionInfoPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionInfoPath', () => { - const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionInfoName', () => { - const result = client.matchProjectFromConnectionInfoName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionInfoName', () => { - const result = client.matchLocationFromConnectionInfoName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromConnectionInfoName', () => { - const result = client.matchClusterFromConnectionInfoName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromConnectionInfoName', () => { - const result = client.matchInstanceFromConnectionInfoName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - database: "databaseValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatabaseName', () => { - const result = client.matchLocationFromDatabaseName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromDatabaseName', () => { - const result = client.matchClusterFromDatabaseName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromInstanceName', () => { - const result = client.matchClusterFromInstanceName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('supportedDatabaseFlag', async () => { - const fakePath = "/rendered/path/supportedDatabaseFlag"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - flag: "flagValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.supportedDatabaseFlagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.supportedDatabaseFlagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('supportedDatabaseFlagPath', () => { - const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSupportedDatabaseFlagName', () => { - const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSupportedDatabaseFlagName', () => { - const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFlagFromSupportedDatabaseFlagName', () => { - const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "flagValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('user', async () => { - const fakePath = "/rendered/path/user"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - user: "userValue", - }; - const client = new alloydbcsqladminModule.v1alpha.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.userPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.userPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('userPath', () => { - const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.userPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromUserName', () => { - const result = client.matchProjectFromUserName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromUserName', () => { - const result = client.matchLocationFromUserName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromUserName', () => { - const result = client.matchClusterFromUserName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserFromUserName', () => { - const result = client.matchUserFromUserName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts b/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts deleted file mode 100644 index f1da9d89fc6..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/test/gapic_alloy_d_b_c_s_q_l_admin_v1beta.ts +++ /dev/null @@ -1,1522 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as alloydbcsqladminModule from '../src'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.AlloyDBCSQLAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, "googleapis.com"); - }); - - if (typeof process === 'object' && typeof process.emitWarning === 'function') { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient.servicePath; - assert.strictEqual(servicePath, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'alloydb.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'alloydb.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); - await client.initialize(); - assert(client.alloyDBCSQLAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.alloyDBCSQLAdminStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.alloyDBCSQLAdminStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('restoreFromCloudSQL', () => { - it('invokes restoreFromCloudSQL without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreFromCloudSQL(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreFromCloudSQL( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL with call error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreFromCloudSQL(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreFromCloudSQL with LRO error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreFromCloudSqL = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreFromCloudSQL(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreFromCloudSqL as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreFromCloudSQLProgress without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestoreFromCloudSQLProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreFromCloudSQLProgress with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestoreFromCloudSQLProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup: "backupValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', async () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "locationValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromClusterName', () => { - const result = client.matchLocationFromClusterName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('connectionInfo', async () => { - const fakePath = "/rendered/path/connectionInfo"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.connectionInfoPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionInfoPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionInfoPath', () => { - const result = client.connectionInfoPath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionInfoPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionInfoName', () => { - const result = client.matchProjectFromConnectionInfoName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionInfoName', () => { - const result = client.matchLocationFromConnectionInfoName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromConnectionInfoName', () => { - const result = client.matchClusterFromConnectionInfoName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromConnectionInfoName', () => { - const result = client.matchInstanceFromConnectionInfoName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.connectionInfoPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('database', async () => { - const fakePath = "/rendered/path/database"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - database: "databaseValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.databasePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.databasePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('databasePath', () => { - const result = client.databasePath("projectValue", "locationValue", "clusterValue", "databaseValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.databasePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatabaseName', () => { - const result = client.matchProjectFromDatabaseName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatabaseName', () => { - const result = client.matchLocationFromDatabaseName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromDatabaseName', () => { - const result = client.matchClusterFromDatabaseName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatabaseFromDatabaseName', () => { - const result = client.matchDatabaseFromDatabaseName(fakePath); - assert.strictEqual(result, "databaseValue"); - assert((client.pathTemplates.databasePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - instance: "instanceValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "clusterValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromInstanceName', () => { - const result = client.matchClusterFromInstanceName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('supportedDatabaseFlag', async () => { - const fakePath = "/rendered/path/supportedDatabaseFlag"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - flag: "flagValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.supportedDatabaseFlagPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.supportedDatabaseFlagPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('supportedDatabaseFlagPath', () => { - const result = client.supportedDatabaseFlagPath("projectValue", "locationValue", "flagValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSupportedDatabaseFlagName', () => { - const result = client.matchProjectFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSupportedDatabaseFlagName', () => { - const result = client.matchLocationFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchFlagFromSupportedDatabaseFlagName', () => { - const result = client.matchFlagFromSupportedDatabaseFlagName(fakePath); - assert.strictEqual(result, "flagValue"); - assert((client.pathTemplates.supportedDatabaseFlagPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('user', async () => { - const fakePath = "/rendered/path/user"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - cluster: "clusterValue", - user: "userValue", - }; - const client = new alloydbcsqladminModule.v1beta.AlloyDBCSQLAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.userPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.userPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('userPath', () => { - const result = client.userPath("projectValue", "locationValue", "clusterValue", "userValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.userPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromUserName', () => { - const result = client.matchProjectFromUserName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromUserName', () => { - const result = client.matchLocationFromUserName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromUserName', () => { - const result = client.matchClusterFromUserName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchUserFromUserName', () => { - const result = client.matchUserFromUserName(fakePath); - assert.strictEqual(result, "userValue"); - assert((client.pathTemplates.userPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-alloydb/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/webpack.config.js deleted file mode 100644 index ee88fe6afc1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'AlloyDBAdmin', - filename: './alloy-d-b-admin.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto index 8eebb0445db..a5a80e137f6 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto @@ -554,6 +554,14 @@ message Cluster { google.protobuf.Timestamp grace_end_time = 4; } + // Configuration for Dataplex integration. + message DataplexConfig { + // Dataplex is enabled by default for resources such as clusters and + // instances. This flag controls the integration of AlloyDB PG + // resources (like databases, schemas, and tables) with Dataplex." + bool enabled = 1; + } + // Cluster State enum State { // The state of the cluster is unknown. @@ -770,6 +778,9 @@ message Cluster { (google.api.field_behavior) = IMMUTABLE, (google.api.field_behavior) = OPTIONAL ]; + + // Optional. Configuration for Dataplex integration. + DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; } // An Instance is a computing unit that an end customer can connect to. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto index 13f91f2d773..d6cb76972f3 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto @@ -558,6 +558,14 @@ message Cluster { google.protobuf.Timestamp grace_end_time = 4; } + // Configuration for Dataplex integration. + message DataplexConfig { + // Dataplex is enabled by default for resources such as clusters and + // instances. This flag controls the integration of AlloyDB PG + // resources (like databases, schemas, and tables) with Dataplex." + bool enabled = 1; + } + // Cluster State enum State { // The state of the cluster is unknown. @@ -788,6 +796,9 @@ message Cluster { // service account. The per-cluster service account naming format is subject // to change. string service_account_email = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for Dataplex integration. + DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; } // An Instance is a computing unit that an end customer can connect to. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto index 2fa7a7729be..7b3ef0259b1 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto @@ -558,6 +558,14 @@ message Cluster { google.protobuf.Timestamp grace_end_time = 4; } + // Configuration for Dataplex integration. + message DataplexConfig { + // Dataplex is enabled by default for resources such as clusters and + // instances. This flag controls the integration of AlloyDB PG + // resources (like databases, schemas, and tables) with Dataplex." + bool enabled = 1; + } + // Cluster State enum State { // The state of the cluster is unknown. @@ -785,6 +793,9 @@ message Cluster { // service account. The per-cluster service account naming format is subject // to change. string service_account_email = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for Dataplex integration. + DataplexConfig dataplex_config = 47 [(google.api.field_behavior) = OPTIONAL]; } // An Instance is a computing unit that an end customer can connect to. diff --git a/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index 4fa74244f63..28c6c475c4e 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -2276,6 +2276,9 @@ export namespace google { /** Cluster tags */ tags?: ({ [k: string]: string }|null); + + /** Cluster dataplexConfig */ + dataplexConfig?: (google.cloud.alloydb.v1.Cluster.IDataplexConfig|null); } /** Represents a Cluster. */ @@ -2389,6 +2392,9 @@ export namespace google { /** Cluster tags. */ public tags: { [k: string]: string }; + /** Cluster dataplexConfig. */ + public dataplexConfig?: (google.cloud.alloydb.v1.Cluster.IDataplexConfig|null); + /** Cluster source. */ public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); @@ -2987,6 +2993,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DataplexConfig. */ + interface IDataplexConfig { + + /** DataplexConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a DataplexConfig. */ + class DataplexConfig implements IDataplexConfig { + + /** + * Constructs a new DataplexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.IDataplexConfig); + + /** DataplexConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataplexConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.IDataplexConfig): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Verifies a DataplexConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataplexConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.DataplexConfig; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @param message DataplexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataplexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataplexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, @@ -16922,6 +17025,9 @@ export namespace google { /** Cluster serviceAccountEmail */ serviceAccountEmail?: (string|null); + + /** Cluster dataplexConfig */ + dataplexConfig?: (google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null); } /** Represents a Cluster. */ @@ -17044,6 +17150,9 @@ export namespace google { /** Cluster serviceAccountEmail. */ public serviceAccountEmail: string; + /** Cluster dataplexConfig. */ + public dataplexConfig?: (google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null); + /** Cluster source. */ public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); @@ -17642,6 +17751,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DataplexConfig. */ + interface IDataplexConfig { + + /** DataplexConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a DataplexConfig. */ + class DataplexConfig implements IDataplexConfig { + + /** + * Constructs a new DataplexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig); + + /** DataplexConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataplexConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Verifies a DataplexConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataplexConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Cluster.DataplexConfig; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @param message DataplexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataplexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataplexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, @@ -32294,6 +32500,9 @@ export namespace google { /** Cluster serviceAccountEmail */ serviceAccountEmail?: (string|null); + + /** Cluster dataplexConfig */ + dataplexConfig?: (google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null); } /** Represents a Cluster. */ @@ -32413,6 +32622,9 @@ export namespace google { /** Cluster serviceAccountEmail. */ public serviceAccountEmail: string; + /** Cluster dataplexConfig. */ + public dataplexConfig?: (google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null); + /** Cluster source. */ public source?: ("backupSource"|"migrationSource"|"cloudsqlBackupRunSource"); @@ -33011,6 +33223,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DataplexConfig. */ + interface IDataplexConfig { + + /** DataplexConfig enabled */ + enabled?: (boolean|null); + } + + /** Represents a DataplexConfig. */ + class DataplexConfig implements IDataplexConfig { + + /** + * Constructs a new DataplexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig); + + /** DataplexConfig enabled. */ + public enabled: boolean; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataplexConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @param message DataplexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Cluster.IDataplexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Verifies a DataplexConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataplexConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Cluster.DataplexConfig; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @param message DataplexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Cluster.DataplexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataplexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataplexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index 66159ebaa1e..0af3beae285 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -5490,6 +5490,7 @@ * @property {google.cloud.alloydb.v1.SubscriptionType|null} [subscriptionType] Cluster subscriptionType * @property {google.cloud.alloydb.v1.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata * @property {Object.|null} [tags] Cluster tags + * @property {google.cloud.alloydb.v1.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig */ /** @@ -5782,6 +5783,14 @@ */ Cluster.prototype.tags = $util.emptyObject; + /** + * Cluster dataplexConfig. + * @member {google.cloud.alloydb.v1.Cluster.IDataplexConfig|null|undefined} dataplexConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.dataplexConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -5891,6 +5900,8 @@ writer.uint32(/* id 41, wireType 2 =*/330).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); if (message.cloudsqlBackupRunSource != null && Object.hasOwnProperty.call(message, "cloudsqlBackupRunSource")) $root.google.cloud.alloydb.v1.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) + $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); return writer; }; @@ -6120,6 +6131,10 @@ message.tags[key] = value; break; } + case 47: { + message.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6360,6 +6375,11 @@ if (!$util.isString(message.tags[key[i]])) return "tags: string{k:string} expected"; } + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.verify(message.dataplexConfig); + if (error) + return "dataplexConfig." + error; + } return null; }; @@ -6630,6 +6650,11 @@ for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) message.tags[keys[i]] = String(object.tags[keys[i]]); } + if (object.dataplexConfig != null) { + if (typeof object.dataplexConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.dataplexConfig: object expected"); + message.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.fromObject(object.dataplexConfig); + } return message; }; @@ -6680,6 +6705,7 @@ object.maintenanceSchedule = null; object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; object.trialMetadata = null; + object.dataplexConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6768,6 +6794,8 @@ if (options.oneofs) object.source = "cloudsqlBackupRunSource"; } + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) + object.dataplexConfig = $root.google.cloud.alloydb.v1.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); return object; }; @@ -7990,6 +8018,211 @@ return TrialMetadata; })(); + Cluster.DataplexConfig = (function() { + + /** + * Properties of a DataplexConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface IDataplexConfig + * @property {boolean|null} [enabled] DataplexConfig enabled + */ + + /** + * Constructs a new DataplexConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a DataplexConfig. + * @implements IDataplexConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig=} [properties] Properties to set + */ + function DataplexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataplexConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @instance + */ + DataplexConfig.prototype.enabled = false; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig instance + */ + DataplexConfig.create = function create(properties) { + return new DataplexConfig(properties); + }; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.DataplexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.DataplexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataplexConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataplexConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.DataplexConfig} DataplexConfig + */ + DataplexConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.DataplexConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.DataplexConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.DataplexConfig} message DataplexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataplexConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this DataplexConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @instance + * @returns {Object.} JSON object + */ + DataplexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataplexConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.DataplexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.DataplexConfig"; + }; + + return DataplexConfig; + })(); + /** * State enum. * @name google.cloud.alloydb.v1.Cluster.State @@ -43442,6 +43675,7 @@ * @property {google.cloud.alloydb.v1alpha.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata * @property {Object.|null} [tags] Cluster tags * @property {string|null} [serviceAccountEmail] Cluster serviceAccountEmail + * @property {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig */ /** @@ -43758,6 +43992,14 @@ */ Cluster.prototype.serviceAccountEmail = ""; + /** + * Cluster dataplexConfig. + * @member {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig|null|undefined} dataplexConfig + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Cluster.prototype.dataplexConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -43873,6 +44115,8 @@ $root.google.cloud.alloydb.v1alpha.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) writer.uint32(/* id 46, wireType 2 =*/370).string(message.serviceAccountEmail); + if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) + $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); return writer; }; @@ -44114,6 +44358,10 @@ message.serviceAccountEmail = reader.string(); break; } + case 47: { + message.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -44366,6 +44614,11 @@ if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) if (!$util.isString(message.serviceAccountEmail)) return "serviceAccountEmail: string expected"; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify(message.dataplexConfig); + if (error) + return "dataplexConfig." + error; + } return null; }; @@ -44649,6 +44902,11 @@ } if (object.serviceAccountEmail != null) message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.dataplexConfig != null) { + if (typeof object.dataplexConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Cluster.dataplexConfig: object expected"); + message.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.fromObject(object.dataplexConfig); + } return message; }; @@ -44702,6 +44960,7 @@ object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; object.trialMetadata = null; object.serviceAccountEmail = ""; + object.dataplexConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -44796,6 +45055,8 @@ } if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) object.serviceAccountEmail = message.serviceAccountEmail; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) + object.dataplexConfig = $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); return object; }; @@ -46018,6 +46279,211 @@ return TrialMetadata; })(); + Cluster.DataplexConfig = (function() { + + /** + * Properties of a DataplexConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @interface IDataplexConfig + * @property {boolean|null} [enabled] DataplexConfig enabled + */ + + /** + * Constructs a new DataplexConfig. + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @classdesc Represents a DataplexConfig. + * @implements IDataplexConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig=} [properties] Properties to set + */ + function DataplexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataplexConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @instance + */ + DataplexConfig.prototype.enabled = false; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig instance + */ + DataplexConfig.create = function create(properties) { + return new DataplexConfig(properties); + }; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Cluster.DataplexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataplexConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataplexConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} DataplexConfig + */ + DataplexConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Cluster.DataplexConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Cluster.DataplexConfig} message DataplexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataplexConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this DataplexConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @instance + * @returns {Object.} JSON object + */ + DataplexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataplexConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Cluster.DataplexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Cluster.DataplexConfig"; + }; + + return DataplexConfig; + })(); + /** * State enum. * @name google.cloud.alloydb.v1alpha.Cluster.State @@ -83298,6 +83764,7 @@ * @property {google.cloud.alloydb.v1beta.Cluster.ITrialMetadata|null} [trialMetadata] Cluster trialMetadata * @property {Object.|null} [tags] Cluster tags * @property {string|null} [serviceAccountEmail] Cluster serviceAccountEmail + * @property {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null} [dataplexConfig] Cluster dataplexConfig */ /** @@ -83606,6 +84073,14 @@ */ Cluster.prototype.serviceAccountEmail = ""; + /** + * Cluster dataplexConfig. + * @member {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig|null|undefined} dataplexConfig + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Cluster.prototype.dataplexConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -83719,6 +84194,8 @@ $root.google.cloud.alloydb.v1beta.CloudSQLBackupRunSource.encode(message.cloudsqlBackupRunSource, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) writer.uint32(/* id 46, wireType 2 =*/370).string(message.serviceAccountEmail); + if (message.dataplexConfig != null && Object.hasOwnProperty.call(message, "dataplexConfig")) + $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.encode(message.dataplexConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); return writer; }; @@ -83956,6 +84433,10 @@ message.serviceAccountEmail = reader.string(); break; } + case 47: { + message.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -84205,6 +84686,11 @@ if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) if (!$util.isString(message.serviceAccountEmail)) return "serviceAccountEmail: string expected"; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify(message.dataplexConfig); + if (error) + return "dataplexConfig." + error; + } return null; }; @@ -84486,6 +84972,11 @@ } if (object.serviceAccountEmail != null) message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.dataplexConfig != null) { + if (typeof object.dataplexConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Cluster.dataplexConfig: object expected"); + message.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.fromObject(object.dataplexConfig); + } return message; }; @@ -84538,6 +85029,7 @@ object.subscriptionType = options.enums === String ? "SUBSCRIPTION_TYPE_UNSPECIFIED" : 0; object.trialMetadata = null; object.serviceAccountEmail = ""; + object.dataplexConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -84630,6 +85122,8 @@ } if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) object.serviceAccountEmail = message.serviceAccountEmail; + if (message.dataplexConfig != null && message.hasOwnProperty("dataplexConfig")) + object.dataplexConfig = $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig.toObject(message.dataplexConfig, options); return object; }; @@ -85852,6 +86346,211 @@ return TrialMetadata; })(); + Cluster.DataplexConfig = (function() { + + /** + * Properties of a DataplexConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @interface IDataplexConfig + * @property {boolean|null} [enabled] DataplexConfig enabled + */ + + /** + * Constructs a new DataplexConfig. + * @memberof google.cloud.alloydb.v1beta.Cluster + * @classdesc Represents a DataplexConfig. + * @implements IDataplexConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig=} [properties] Properties to set + */ + function DataplexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataplexConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @instance + */ + DataplexConfig.prototype.enabled = false; + + /** + * Creates a new DataplexConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig instance + */ + DataplexConfig.create = function create(properties) { + return new DataplexConfig(properties); + }; + + /** + * Encodes the specified DataplexConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified DataplexConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Cluster.DataplexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.IDataplexConfig} message DataplexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataplexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataplexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataplexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataplexConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataplexConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a DataplexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} DataplexConfig + */ + DataplexConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Cluster.DataplexConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a DataplexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {google.cloud.alloydb.v1beta.Cluster.DataplexConfig} message DataplexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataplexConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this DataplexConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @instance + * @returns {Object.} JSON object + */ + DataplexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataplexConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Cluster.DataplexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataplexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Cluster.DataplexConfig"; + }; + + return DataplexConfig; + })(); + /** * State enum. * @name google.cloud.alloydb.v1beta.Cluster.State diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index 7db9072a420..7cbde53da89 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -768,6 +768,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "dataplexConfig": { + "type": "DataplexConfig", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -852,6 +859,14 @@ } } }, + "DataplexConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -5654,6 +5669,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "dataplexConfig": { + "type": "DataplexConfig", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -5738,6 +5760,14 @@ } } }, + "DataplexConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -10763,6 +10793,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "dataplexConfig": { + "type": "DataplexConfig", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -10847,6 +10884,14 @@ } } }, + "DataplexConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0,